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
RowRa_SW_fsky_fractiondTₗRnRa_LW_fHλECₛCᵢAGₛGbₕDₗGbciteraPPFDtimestep
Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Float64Int64Float64Int64
1400.01.00.0326.444394.879-5.1214472.5868322.292332.949284.87730.59570.6376710.02099861.556380.6502613877.441
2400.01.00.0327.0235396.296-3.7044360.1401336.155339.324291.22230.89310.6428130.02460821.492310.7594913877.442
3400.01.00.0326.2001396.814-3.185752.7257344.089339.264290.58930.85910.6345840.02448721.537210.757533877.443

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.