Juliacon 2024

PlantModules.jl: a package for modular plant growth modeling
07-10, 19:30–20:00 (Europe/Amsterdam), Function (4.1)

We introduce PlantModules.jl, a package for modeling plant hydraulics in a modular way. Its purpose is to allow the user to define, run and visualize plant models based on an input structure of any desired complexity and scale, from cell to fields of plants. Its base functionality allows for the simulation of water flows based on water potentials in a tree with hundreds of branches in just a few dozen lines of code, and a focus on extensibility allows for easily adding other processes.


A rising world population and changing environmental conditions have created a need for an increasing food supply using the same amount of agricultural area and under often more difficult growing conditions. A better understanding of plant growth has become essential in achieving this, allowing, among others, the targeted breeding of plants with greater resistance to these changing conditions. Plant models, in turn, have become an indispensable tool for steering plant growth.

The state-of-the-art in plant modeling are Functional-Structural Plant Models (FSPMs). These models consider both functional processes such as photosynthesis, water flow, and carbon allocation, as well as the structure of the plant, usually represented as a network of repeating elementary units such as leaves, root segments, or cells. Our package is intended to serve as an addition to the FSPM modeling framework in Julia. Among these, the Virtual Plant Laboratory is a notable collection of FSPM-related Julia packages and already includes a wide range of functionalities, such as graph rewriting for simulating the growth of the structure of a plant through time, visualization functions, and models for calculating certain plant biophysical processes given the weather conditions.

What is not yet available is a way to accurately model functional processes over time using sets of differential equations. This package provides this functionality by interfacing with Julia's modeling ecosystem, specifically ModelingToolkit.jl (MTK). As this package aims to maximize ease of extensibility, the intuitive syntax of this modeling package is ideal as it allows users to easily implement their own functional processes as MTK systems and provide high-performance models. Writing out a FSPM in this modeling language by hand would be incredibly time-consuming, since it can consist of over thousands of elementary units that all need to be created and connected. PlantModules.jl automates this process, allowing for modeling plants whose structure consists of many elements or even changes over time.

The final contribution of the package is the inclusion of a simple, yet powerful implementation of hydraulics as a functional process. It describes the growth of plant parts due to turgor pressure, which results from water flows in the plant driven by water potentials. This process is often overlooked in favor of carbon-related processes, yet it is also an essential driver of growth and is easily coupled to carbon models. Another advantage of the provided hydraulics implementation is that it works on all spatial scales and can be used in multi-scale models. This type of model, which simulates a system on multiple spatial scales simultaneously, can be very advantageous for modeling plant growth and is also supported by the package.