PlantBiophysics provides reusable Julia models for leaf light interception, photosynthesis, stomatal conductance, and energy balance. Models implement the PlantSimEngine kernel contract and can be assembled on one leaf or inside larger multi-plant scenes.
using Pkg
Pkg.add("PlantBiophysics")using PlantBiophysics, PlantSimEngine, PlantMeteo, Dates
meteo = Atmosphere(
T=22.0,
Wind=0.8333,
P=101.325,
Rh=0.45,
duration=Hour(1),
)
scene = leaf_scene(
Monteith(),
Fvcb(),
Medlyn(0.03, 12.0);
status=Status(
Ra_SW_f=13.747,
sky_fraction=1.0,
aPPFD=1500.0,
d=0.03,
),
environment=meteo,
)
simulation = run!(scene)
leaf = only(model_objects(scene; scale=:Leaf))
(temperature=leaf.status.Tₗ, assimilation=leaf.status.A)leaf_scene is a convenience constructor. The returned value is an ordinary
PlantSimEngine.CompositeModel, so applications can also be assembled explicitly with
Object, ModelSpec, selectors such as One and Many, explicit inputs=,
Call dependencies, and every= timestep policies.
PlantBiophysics models preserve generic numeric types, which supports units,
automatic differentiation, and uncertainty propagation when the supplied
operations support those types. Model parameter types do not implicitly change
runtime status carriers: use type_promotion for a general mapping or
status_transform for variable-specific conversion.
Until PlantSimEngine 0.15 is released, check out its multi-plants branch
wherever you keep development packages, then point the PlantBiophysics
environment to that working tree:
pkg> activate .
pkg> develop /path/to/PlantSimEngine
pkg> testPkg.develop records the working-tree path only in the local Manifest.toml;
the repository does not assume where PlantSimEngine is cloned. Once a
compatible PlantSimEngine release is available, run free in each environment
where it was developed:
pkg> free PlantSimEngineThe documentation uses the same workflow:
pkg> activate docs
pkg> develop /path/to/PlantSimEngine
pkg> instantiateThen build it with julia --project=docs docs/make.jl.
Use the issue tracker or the Virtual Plant Lab forum.