First simulation
Make your first simulation for a leaf energy balance, photosynthesis and stomatal conductance altogether with few lines of codes:
using PlantBiophysics, PlantSimEngine, PlantMeteo
using Dates, DataFrames
meteo = read_weather(
joinpath(dirname(dirname(pathof(PlantMeteo))), "test", "data", "meteo.csv"),
:temperature => :T,
:relativeHumidity => (x -> x ./100) => :Rh,
:wind => :Wind,
:atmosphereCO2_ppm => :Cₐ,
:Re_SW_f => :Ri_SW_f,
date_format = DateFormat("yyyy/mm/dd")
)
leaf = ModelList(
Monteith(),
Fvcb(),
Medlyn(0.03, 7.0),
status = (
Ra_SW_f = meteo[:Ri_SW_f] .* 0.8,
sky_fraction = 1.0,
aPPFD = meteo[:Ri_SW_f] .* 0.8 .* 0.48 .* 4.57,
d = 0.03
)
)
run!(leaf,meteo)
DataFrame(leaf)
3×18 DataFrame
Row | Ra_SW_f | sky_fraction | d | Tₗ | Rn | Ra_LW_f | H | λE | Cₛ | Cᵢ | A | Gₛ | Gbₕ | Dₗ | Gbc | iter | aPPFD | timestep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Float64 | Int64 | Float64 | Int64 | |
1 | 400.0 | 1.0 | 0.03 | 26.444 | 394.879 | -5.12144 | 72.5868 | 322.292 | 332.949 | 284.877 | 30.5957 | 0.637671 | 0.0209986 | 1.55638 | 0.650261 | 3 | 877.44 | 1 |
2 | 400.0 | 1.0 | 0.03 | 27.0235 | 396.296 | -3.70443 | 60.1401 | 336.155 | 339.324 | 291.222 | 30.8931 | 0.642813 | 0.0246082 | 1.49231 | 0.759491 | 3 | 877.44 | 2 |
3 | 400.0 | 1.0 | 0.03 | 26.2001 | 396.814 | -3.1857 | 52.7257 | 344.089 | 339.264 | 290.589 | 30.8591 | 0.634584 | 0.0244872 | 1.53721 | 0.75753 | 3 | 877.44 | 3 |
Curious to understand more ? Head to the next section to learn more about parameter fitting, or to the Simple simulation section for more details about how to make simulations.