A partial re-implementation of the Arabidopsis Framework Model v2 (Github) utilising Julia with a focus on flexibility and extensibility.
Expresses a simulation as a set of models describing the circadian (clock) behaviour, plant phenology (based on clock), and "features" which are models that utilise the outputs from the configured models for clock, phenology or both.
Plant simulation state is recorded as a series of "frames" which the models utilise to record data and which can then be processed after the simulation.
Implemented using Julia 1.10.x.
The Julia project provides a self-contained definition of the development environment and dependencies.
Follow these steps to ensure the project environment & dependencies are fully satisfied and available:
- clone this repo
- cd into repo
- enter julia repl
- enter package manager
]
- activate project
activate .
- install plant model framework & dependencies
dev PlantModelFramework/
- install project space dependencies
instantiate
A simple simulation can be constructed & run in the REPL as follows:
# dependencies
using PlantModelFramework
# simulation initial conditions
# - conditions @ T0
initialFrame = Simulation.Frame()
# - environment model
environment = Environment.ConstantModel(sunset=8)
# circadian (clock) model
# - configuration
clockParameters = Clocks.F2014.COP1.parameters(Set(["wt"]))
clockBehaviour = Clocks.F2014.COP1.dynamics(clockParameters)
clock = Clock.Model(environment, clockBehaviour)
# - prepare clock model (initial conditions -> initial T0 frame)
Clock.entrain(clock, Clocks.F2014.COP1.initialState(), initialFrame)
# construct plant simulation
plant = PlantModel(clock)
# run simulation
simulationResults = PlantModelFramework.run(plant, 40, initialFrame)
examples/ directory contains a number of scripts constructing example plant simulations & plotting output.
The scripts run simulations with example data output & plotting. All have debug logging enabled and are relatively verbose in terms of output to aid understanding.
These scripts can be run either by pulling them into the REPL via include()
or by running from the command line with julia --project=. examples/<script>.jl
.
40 day simulation utilising only a clock model (F2014_COP1).
90 day simulation (or until flowering occurs) utilising clock (F2014_COP1) & phenology (PIF_CO_FT) models. Replaces default QNDF differential equation solver with a RODAS5P solver
Demonstrates tracing capabilities by recording phenology model data whilst simulation data in-flight. Generates a considerable amount of data.
Extends Clock+Phenology.jl with addition of a "Feature" model that simulates hypocotyl development based on outputs of phenology model.
Simulation is constructed by creating a set of sub-models describing the circadian (clock) behaviour, the plant phenology behaviour (optional) and an optional number of plant "features". These models are then brought together into a plant model instance that manages the simulation process & retuns a history of the simulation behaviour expressed as data captured in a list of simulation "frames".
Julia types used to implement plant simulation framework.