MinimumFunction

The MinimumFunction is a utility function that returns the minimum value from all of its child functions, making it essential for identifying limiting factors in agricultural models.

Overview

The MinimumFunction is used to determine the smallest value among multiple child functions. It evaluates each child function and returns the minimum result. This is particularly useful when you need to select the limiting factor or the lowest value among several parameters in plant or soil models, such as identifying which resource (water, nitrogen, temperature) is most constraining to growth.

Model Structure

This section describes how this model is positioned within the APSIM framework. It outlines the broader structural and computational components that define its role and interactions in the simulation system.

This model inherits structural and functional behaviour from the following core APSIM components:

Connections to Other Components

This section describes how the model interacts with other components in the APSIM Next Generation framework.
These connections allow the model to exchange information—such as environmental conditions, developmental stage, or physiological responses—with other parts of the simulation system. For a general overview of how model components are connected in APSIM, see the Connections Overview.

Component Model Connection Type Description
Child Functions IFunction Children Any number of child functions whose values will be compared.

Model Variables

This section lists the key variables that describe or control the behaviour of this component. Some variables can be adjusted by the user to modify how the model behaves (configurable), while others are calculated internally and can be viewed as model outputs (reportable). For a general explanation of variable types and how they are used within the APSIM Next Generation framework, see the Model Variables Overview.

Configurable and Reportable Properties

No configurable properties are available for this function.

Read-Only Reportable Properties

Property Type Description
Value double The sum of values from all child functions.

Processes and Algorithms

This section describes the scientific processes and algorithms represented by this component. Each process corresponds to a biological, physical, or chemical mechanism simulated during a model time step. Where appropriate, equations or conceptual summaries are provided to explain how the process operates within the APSIM Next Generation framework.

Minimum Value Calculation

The MinimumFunction evaluates all of its child functions and returns the smallest value. The algorithm iterates through each child function, comparing their returned values:

\[ Value_{min} = \min(F_1, F_2, F_3, \ldots, F_n) \]

where \(F_i\) represents the value returned by the \(i\)-th child function, and \(n\) is the total number of child functions.

The implementation initializes the return value to a very large number (999,999,999) and then compares each child function’s value, retaining the minimum:

\[ Value_{return} = \begin{cases} 999999999 & \text{initially} \\ \min(Value_{return}, F_i) & \text{for each child } i \end{cases} \]

This approach ensures that even if all child functions return large values, the smallest among them is selected. If no child functions are present, the function returns the initial large value.

User Interface

MinimumFunction can be added as a child of any parent node that accepts functions in the model tree. Right-click the parent node, select “Add Model…”, and search for MinimumFunction in the Filter Box.

Practical Example

The MinimumFunction is commonly used to identify limiting factors in crop growth models. For example, you might want to determine which environmental factor most limits photosynthesis or growth:

Example 1: Temperature Stress

If you have functions calculating stress factors for different temperature thresholds, the MinimumFunction identifies the most limiting constraint:

\[ TemperatureStress = \min(StressLow, StressHigh, StressOptimal) \]

Example 2: Water and Nitrogen Co-limitation

In resource-limited growth scenarios, the MinimumFunction can determine which resource is most constraining:

\[ GrowthLimitation = \min(WaterStress, NitrogenStress, PhosphorusStress) \]

The returned value (ranging from 0 to 1) indicates the severity of the most limiting factor, where values closer to 0 represent greater limitation.

Example 3: Soil Layer Constraints

When evaluating soil water availability across multiple layers, the MinimumFunction can identify the layer with the least available water:

\[ MinimumWater = \min(Layer_1Water, Layer_2Water, Layer_3Water) \]

This helps identify which soil horizon presents the greatest constraint to root water uptake.

See Also