SubtractFunction
The SubtractFunction
is a utility function that returns the difference of values from its child functions.
Overview
The SubtractFunction
is used to subtract the values of other child functions from the first child. It calculates the difference between the first child function and the sum of all subsequent child functions. This is useful when you need to compute a value that is derived from subtracting multiple traits or parameters in plant growth models.
Events
Events Listened For
No events are listened for by this function.
Events Raised to
No events are raised by this function.
Properties
Configurable and Reportable Properties
No configurable properties are available for this function.
Read-Only Reportable Properties
No read-only reportable properties are available for this function.
User Interface
SubtractFunction
can be added into the model tree by right-clicking on a parent node and selecting “Add Model…”, and then search SubtractFunction
in the Filter Box. A symbol for the SubtractFunction
is displayed in the user interface to represent the function.
Practical Example
The wheat yield is reduced by frost stress as a ratio of total yield (e.g. FrostDamage
). The final yield is calculated by subtracting the frost damage from the total potential yield.
\[ FinalYield = TotalPotentialYield \times (1 - FrostDamage) \]
The SubtractFunction
is used to subtract these two values to get the final yield in the equation above.
See Also
- Source code: SubtractFunction.cs on GitHub