Cropbox

Cropbox is a declarative framework for building and running crop models in Julia. You describe model components, variables, equations, data sources, and update rules. Cropbox orders those calculations, carries configuration and time through the model, and collects simulation output into data frames.

using Cropbox

@system Growth(Controller) begin
    rate: growth_rate => 1.5 ~ preserve(parameter, u"g/hr")
    mass(rate)               ~ accumulate(u"g")
end

result = simulate(Growth; stop = 3u"hr")
4×3 DataFrame
Rowtimeratemass
Quantity…Quantity…Quantity…
10//1 hr1.5 g hr^-10.0 g
21//1 hr1.5 g hr^-11.5 g
32//1 hr1.5 g hr^-13.0 g
43//1 hr1.5 g hr^-14.5 g

This is a small example, but the same workflow is used in coupled leaf gas exchange, garlic growth, SimpleCrop, layered soil, and root architecture models.

Choose a path

The normal workflow

Cropbox follows the same three-phase workflow used in Cropbox courses:

PhaseGoalMain tools
SpecificationDefine processes, states, inputs, and dependencies.@system, behaviors, tags, units
SimulationApply scenarios, advance state, and collect selected output.parameters, @config, instance, simulate
Visualization and evaluationExplore predictions and compare them with observations.visualize, evaluate, calibrate

Cropbox deliberately separates model equations from scenario configuration. One model definition can therefore be reused with different weather data, cultivars, management settings, and parameter combinations. See How Cropbox Works for the complete workflow diagram and the role of each phase.

Model examples

The worked tutorials progress from framework mechanics to coupled applications:

TutorialWhat it demonstrates
Logistic Growthtranslating a differential equation into states, rates, and configuration
Weather-driven Phenologycalendar time, tabular weather input, thermal time, and a biological stop condition
Predator–Prey ModelLotka–Volterra equations, coupled accumulated states, mixin extension, and observation-based fitting
Leaf Gas Exchangeinspecting a coupled biochemical model across configured environmental ranges
Garlic Growth Modelwhole-plant composition, daily output, and dynamic organs
SimpleCroprunning a compact crop model and reading development, growth, and environmental output
Soil Water Transportlayered storage and fluxes, pedotransfer functions, and a test-suite simulation
Root System Architecturestochastic configuration, dynamic systems, geometry, and custom summaries

These examples are drawn from Cropbox tests, courses, and workshops. The Model Gallery links their package repositories and additional workshop material.

After a model can be simulated and visualized, continue with Evaluate and Calibrate Models. It belongs to the workflow that compares predictions with observations, rather than to the sequence of model examples.

Citation

When using Cropbox in your work, please cite the following paper:

Yun K, Kim S-H (2023) “Cropbox: a declarative crop modelling framework.” in silico Plants 5(1), diac021. doi:10.1093/insilicoplants/diac021

@article{Cropbox2023,
    title = {Cropbox: a declarative crop modelling framework},
    author = {Yun, Kyungdahm and Kim, Soo-Hyung},
    journal = {in silico Plants},
    volume = {5},
    number = {1},
    year = {2023},
    doi = {10.1093/insilicoplants/diac021}
}

The repository also keeps this entry in CITATION.bib.