Validating dynamical system inputs
dynamical_system.Rd
Utility function for checking inputs to run_biocro
without running it
Arguments
- initial_values
Identical to the corresponding argument from
run_biocro
.- parameters
Identical to the corresponding argument from
run_biocro
.- drivers
Identical to the corresponding argument from
run_biocro
.- direct_module_names
Identical to the corresponding argument from
run_biocro
.- differential_module_names
Identical to the corresponding argument from
run_biocro
.- verbose
Identical to the corresponding argument from
run_biocro
.
Details
validate_dynamical_system_inputs
accepts the same input arguments as
run_biocro
with the exception of ode_solver
(which is
not required to check the validity of a dynamical system).
validate_dynamical_system_inputs
checks a set of parameters, drivers,
modules, and initial values to see if they can properly define a dynamical
system and can therefore be used as inputs to run_biocro
.
Although the run_biocro
function performs the same validity
checks, the validate_dynamical_system_inputs
includes additional
information, such as a list of parameters whose values are not used as inputs
by any modules, since in principle these parameters could be removed for
clarity.
When using one of the pre-defined crop growth models, it may be helpful to
use the with
command to pass arguments to
validate_dynamical_system_inputs
; see the documentation for
crop_model_definitions
for more information.
Examples
# Example 1: missing a parameter and an initial value
validate_dynamical_system_inputs(
within(soybean$initial_values, rm(Leaf)), # remove the initial `Leaf` value
within(soybean$parameters, rm(leaf_reflectance)), # remove `leaf_reflectance`
soybean_weather$'2002',
soybean$direct_modules,
soybean$differential_modules
)
#>
#> Checking the validity of the system inputs:
#>
#> [pass] No quantities were defined multiple times in the inputs
#>
#> [fail] The following module inputs were not defined:
#> Leaf from the 'parameter_calculator' module
#> leaf_reflectance from the 'ten_layer_canopy_properties' module
#> Leaf from the 'senescence_logistic' module
#> Leaf from the 'partitioning_growth' module
#>
#> [fail] The following differential module outputs were not part of the initial values:
#> Leaf from the 'senescence_logistic' module
#> Leaf from the 'partitioning_growth' module
#>
#> [pass] There are no cyclic dependencies among the direct modules.
#>
#> System inputs are not valid
#>
#> Printing additional information about the system inputs:
#>
#> The direct modules are in a suitable order for evaluation.
#>
#> The following quantities were each required by at least one module:
#> Catm
#> DVI
#> Gs_min
#> Leaf
#> LeafN
#> LeafN_0
#> LeafWS
#> O2
#> Rd
#> Rhizome
#> Rmax_emrV0
#> Root
#> Sp_thermal_time_decay
#> Stem
#> StomataWS
#> TTc
#> TTemr_threshold
#> Tbase_emr
#> Tmax_R0R1
#> Tmax_R1R7
#> Tmax_emrV0
#> Tmin_R0R1
#> Tmin_R1R7
#> Tmin_emrV0
#> Topt_R0R1
#> Topt_R1R7
#> Topt_emrV0
#> absorptivity_par
#> alpha1
#> alphaLeaf
#> alphaRoot
#> alphaSeneLeaf
#> alphaSeneRhizome
#> alphaSeneRoot
#> alphaSeneStem
#> alphaShell
#> alphaStem
#> alphab1
#> atmospheric_pressure
#> atmospheric_scattering
#> atmospheric_transmittance
#> average_absorbed_shortwave_layer_0
#> average_absorbed_shortwave_layer_1
#> average_absorbed_shortwave_layer_2
#> average_absorbed_shortwave_layer_3
#> average_absorbed_shortwave_layer_4
#> average_absorbed_shortwave_layer_5
#> average_absorbed_shortwave_layer_6
#> average_absorbed_shortwave_layer_7
#> average_absorbed_shortwave_layer_8
#> average_absorbed_shortwave_layer_9
#> b0
#> b1
#> betaLeaf
#> betaRoot
#> betaSeneLeaf
#> betaSeneRhizome
#> betaSeneRoot
#> betaSeneStem
#> betaShell
#> betaStem
#> beta_PSII
#> canopy_assimilation_rate
#> canopy_transpiration_rate
#> chil
#> cosine_zenith_angle
#> cws1
#> cws2
#> day_length
#> development_rate_per_hour
#> electrons_per_carboxylation
#> electrons_per_oxygenation
#> growth_respiration_fraction
#> height_layer_0
#> height_layer_1
#> height_layer_2
#> height_layer_3
#> height_layer_4
#> height_layer_5
#> height_layer_6
#> height_layer_7
#> height_layer_8
#> height_layer_9
#> heightf
#> hydrDist
#> iSp
#> irradiance_diffuse_fraction
#> irradiance_direct_fraction
#> jmax
#> kGrain
#> kLeaf
#> kRhizome
#> kRhizome_emr
#> kRoot
#> kSeneLeaf
#> kSeneRhizome
#> kSeneRoot
#> kSeneStem
#> kShell
#> kStem
#> kd
#> kpLN
#> lai
#> lat
#> leaf_reflectance
#> leaf_transmittance
#> lnfun
#> longitude
#> maturity_group
#> minimum_gbw
#> mrc1
#> mrc2
#> net_assimilation_rate_grain
#> net_assimilation_rate_leaf
#> net_assimilation_rate_rhizome
#> net_assimilation_rate_root
#> net_assimilation_rate_shell
#> net_assimilation_rate_stem
#> par_energy_content
#> par_energy_fraction
#> par_incident_diffuse
#> par_incident_direct
#> phi1
#> phi2
#> precip
#> rateSeneLeaf
#> rateSeneRhizome
#> rateSeneRoot
#> rateSeneStem
#> remobilization_fraction
#> retrans
#> retrans_rhizome
#> rfl
#> rh
#> rsdf
#> rsec
#> shaded_Assim_layer_0
#> shaded_Assim_layer_1
#> shaded_Assim_layer_2
#> shaded_Assim_layer_3
#> shaded_Assim_layer_4
#> shaded_Assim_layer_5
#> shaded_Assim_layer_6
#> shaded_Assim_layer_7
#> shaded_Assim_layer_8
#> shaded_Assim_layer_9
#> shaded_GrossAssim_layer_0
#> shaded_GrossAssim_layer_1
#> shaded_GrossAssim_layer_2
#> shaded_GrossAssim_layer_3
#> shaded_GrossAssim_layer_4
#> shaded_GrossAssim_layer_5
#> shaded_GrossAssim_layer_6
#> shaded_GrossAssim_layer_7
#> shaded_GrossAssim_layer_8
#> shaded_GrossAssim_layer_9
#> shaded_Gs_layer_0
#> shaded_Gs_layer_1
#> shaded_Gs_layer_2
#> shaded_Gs_layer_3
#> shaded_Gs_layer_4
#> shaded_Gs_layer_5
#> shaded_Gs_layer_6
#> shaded_Gs_layer_7
#> shaded_Gs_layer_8
#> shaded_Gs_layer_9
#> shaded_Rp_layer_0
#> shaded_Rp_layer_1
#> shaded_Rp_layer_2
#> shaded_Rp_layer_3
#> shaded_Rp_layer_4
#> shaded_Rp_layer_5
#> shaded_Rp_layer_6
#> shaded_Rp_layer_7
#> shaded_Rp_layer_8
#> shaded_Rp_layer_9
#> shaded_TransR_layer_0
#> shaded_TransR_layer_1
#> shaded_TransR_layer_2
#> shaded_TransR_layer_3
#> shaded_TransR_layer_4
#> shaded_TransR_layer_5
#> shaded_TransR_layer_6
#> shaded_TransR_layer_7
#> shaded_TransR_layer_8
#> shaded_TransR_layer_9
#> shaded_absorbed_ppfd_layer_0
#> shaded_absorbed_ppfd_layer_1
#> shaded_absorbed_ppfd_layer_2
#> shaded_absorbed_ppfd_layer_3
#> shaded_absorbed_ppfd_layer_4
#> shaded_absorbed_ppfd_layer_5
#> shaded_absorbed_ppfd_layer_6
#> shaded_absorbed_ppfd_layer_7
#> shaded_absorbed_ppfd_layer_8
#> shaded_absorbed_ppfd_layer_9
#> shaded_fraction_layer_0
#> shaded_fraction_layer_1
#> shaded_fraction_layer_2
#> shaded_fraction_layer_3
#> shaded_fraction_layer_4
#> shaded_fraction_layer_5
#> shaded_fraction_layer_6
#> shaded_fraction_layer_7
#> shaded_fraction_layer_8
#> shaded_fraction_layer_9
#> soil_air_entry
#> soil_b_coefficient
#> soil_clod_size
#> soil_depth1
#> soil_depth2
#> soil_depth3
#> soil_field_capacity
#> soil_reflectance
#> soil_sand_content
#> soil_saturated_conductivity
#> soil_saturation_capacity
#> soil_transmission
#> soil_water_content
#> soil_wilting_point
#> solar
#> sowing_time
#> specific_heat_of_air
#> sunlit_Assim_layer_0
#> sunlit_Assim_layer_1
#> sunlit_Assim_layer_2
#> sunlit_Assim_layer_3
#> sunlit_Assim_layer_4
#> sunlit_Assim_layer_5
#> sunlit_Assim_layer_6
#> sunlit_Assim_layer_7
#> sunlit_Assim_layer_8
#> sunlit_Assim_layer_9
#> sunlit_GrossAssim_layer_0
#> sunlit_GrossAssim_layer_1
#> sunlit_GrossAssim_layer_2
#> sunlit_GrossAssim_layer_3
#> sunlit_GrossAssim_layer_4
#> sunlit_GrossAssim_layer_5
#> sunlit_GrossAssim_layer_6
#> sunlit_GrossAssim_layer_7
#> sunlit_GrossAssim_layer_8
#> sunlit_GrossAssim_layer_9
#> sunlit_Gs_layer_0
#> sunlit_Gs_layer_1
#> sunlit_Gs_layer_2
#> sunlit_Gs_layer_3
#> sunlit_Gs_layer_4
#> sunlit_Gs_layer_5
#> sunlit_Gs_layer_6
#> sunlit_Gs_layer_7
#> sunlit_Gs_layer_8
#> sunlit_Gs_layer_9
#> sunlit_Rp_layer_0
#> sunlit_Rp_layer_1
#> sunlit_Rp_layer_2
#> sunlit_Rp_layer_3
#> sunlit_Rp_layer_4
#> sunlit_Rp_layer_5
#> sunlit_Rp_layer_6
#> sunlit_Rp_layer_7
#> sunlit_Rp_layer_8
#> sunlit_Rp_layer_9
#> sunlit_TransR_layer_0
#> sunlit_TransR_layer_1
#> sunlit_TransR_layer_2
#> sunlit_TransR_layer_3
#> sunlit_TransR_layer_4
#> sunlit_TransR_layer_5
#> sunlit_TransR_layer_6
#> sunlit_TransR_layer_7
#> sunlit_TransR_layer_8
#> sunlit_TransR_layer_9
#> sunlit_absorbed_ppfd_layer_0
#> sunlit_absorbed_ppfd_layer_1
#> sunlit_absorbed_ppfd_layer_2
#> sunlit_absorbed_ppfd_layer_3
#> sunlit_absorbed_ppfd_layer_4
#> sunlit_absorbed_ppfd_layer_5
#> sunlit_absorbed_ppfd_layer_6
#> sunlit_absorbed_ppfd_layer_7
#> sunlit_absorbed_ppfd_layer_8
#> sunlit_absorbed_ppfd_layer_9
#> sunlit_fraction_layer_0
#> sunlit_fraction_layer_1
#> sunlit_fraction_layer_2
#> sunlit_fraction_layer_3
#> sunlit_fraction_layer_4
#> sunlit_fraction_layer_5
#> sunlit_fraction_layer_6
#> sunlit_fraction_layer_7
#> sunlit_fraction_layer_8
#> sunlit_fraction_layer_9
#> tbase
#> temp
#> theta
#> time
#> time_zone_offset
#> tpu_rate_max
#> vmax1
#> vmax_n_intercept
#> windspeed
#> windspeed_height
#> windspeed_layer_0
#> windspeed_layer_1
#> windspeed_layer_2
#> windspeed_layer_3
#> windspeed_layer_4
#> windspeed_layer_5
#> windspeed_layer_6
#> windspeed_layer_7
#> windspeed_layer_8
#> windspeed_layer_9
#> wsFun
#> year
#>
#> The following parameters were not used as inputs to any module:
#> jmax_mature
#> km_leaf_litter
#> sf_jmax
#> soil_bulk_density
#> soil_clay_content
#> soil_silt_content
#> You may want to consider removing them for clarity
#>
#> The following drivers were not used as inputs to any module:
#> dw_solar
#> netsolar
#> up_solar
#> zen
#> You may want to consider removing them for clarity
#>
#> All quantities in the initial values have associated derivatives
#>
#> Derivatives for the following quantities are each determined by more than one module:
#> Grain
#> Leaf
#> Rhizome
#> Root
#> Shell
#> Stem
#>
#> No direct modules require a fixed step size Euler ode_solver
#>
#> No differential modules require a fixed step size Euler ode_solver
#>
#> All modules in the direct module list are direct modules
#>
#> All modules in the differential module list are differential modules
#>
#> [1] FALSE
# Example 2: a valid set of input arguments
validate_dynamical_system_inputs(
soybean$initial_values,
soybean$parameters,
soybean_weather$'2002',
soybean$direct_modules,
soybean$differential_modules
)
#>
#> Checking the validity of the system inputs:
#>
#> [pass] No quantities were defined multiple times in the inputs
#>
#> [pass] All module inputs were properly defined
#>
#> [pass] All differential module outputs were included in the initial values
#>
#> [pass] There are no cyclic dependencies among the direct modules.
#>
#> System inputs are valid
#>
#> Printing additional information about the system inputs:
#>
#> The direct modules are in a suitable order for evaluation.
#>
#> The following quantities were each required by at least one module:
#> Catm
#> DVI
#> Gs_min
#> Leaf
#> LeafN
#> LeafN_0
#> LeafWS
#> O2
#> Rd
#> Rhizome
#> Rmax_emrV0
#> Root
#> Sp_thermal_time_decay
#> Stem
#> StomataWS
#> TTc
#> TTemr_threshold
#> Tbase_emr
#> Tmax_R0R1
#> Tmax_R1R7
#> Tmax_emrV0
#> Tmin_R0R1
#> Tmin_R1R7
#> Tmin_emrV0
#> Topt_R0R1
#> Topt_R1R7
#> Topt_emrV0
#> absorptivity_par
#> alpha1
#> alphaLeaf
#> alphaRoot
#> alphaSeneLeaf
#> alphaSeneRhizome
#> alphaSeneRoot
#> alphaSeneStem
#> alphaShell
#> alphaStem
#> alphab1
#> atmospheric_pressure
#> atmospheric_scattering
#> atmospheric_transmittance
#> average_absorbed_shortwave_layer_0
#> average_absorbed_shortwave_layer_1
#> average_absorbed_shortwave_layer_2
#> average_absorbed_shortwave_layer_3
#> average_absorbed_shortwave_layer_4
#> average_absorbed_shortwave_layer_5
#> average_absorbed_shortwave_layer_6
#> average_absorbed_shortwave_layer_7
#> average_absorbed_shortwave_layer_8
#> average_absorbed_shortwave_layer_9
#> b0
#> b1
#> betaLeaf
#> betaRoot
#> betaSeneLeaf
#> betaSeneRhizome
#> betaSeneRoot
#> betaSeneStem
#> betaShell
#> betaStem
#> beta_PSII
#> canopy_assimilation_rate
#> canopy_transpiration_rate
#> chil
#> cosine_zenith_angle
#> cws1
#> cws2
#> day_length
#> development_rate_per_hour
#> electrons_per_carboxylation
#> electrons_per_oxygenation
#> growth_respiration_fraction
#> height_layer_0
#> height_layer_1
#> height_layer_2
#> height_layer_3
#> height_layer_4
#> height_layer_5
#> height_layer_6
#> height_layer_7
#> height_layer_8
#> height_layer_9
#> heightf
#> hydrDist
#> iSp
#> irradiance_diffuse_fraction
#> irradiance_direct_fraction
#> jmax
#> kGrain
#> kLeaf
#> kRhizome
#> kRhizome_emr
#> kRoot
#> kSeneLeaf
#> kSeneRhizome
#> kSeneRoot
#> kSeneStem
#> kShell
#> kStem
#> kd
#> kpLN
#> lai
#> lat
#> leaf_reflectance
#> leaf_transmittance
#> lnfun
#> longitude
#> maturity_group
#> minimum_gbw
#> mrc1
#> mrc2
#> net_assimilation_rate_grain
#> net_assimilation_rate_leaf
#> net_assimilation_rate_rhizome
#> net_assimilation_rate_root
#> net_assimilation_rate_shell
#> net_assimilation_rate_stem
#> par_energy_content
#> par_energy_fraction
#> par_incident_diffuse
#> par_incident_direct
#> phi1
#> phi2
#> precip
#> rateSeneLeaf
#> rateSeneRhizome
#> rateSeneRoot
#> rateSeneStem
#> remobilization_fraction
#> retrans
#> retrans_rhizome
#> rfl
#> rh
#> rsdf
#> rsec
#> shaded_Assim_layer_0
#> shaded_Assim_layer_1
#> shaded_Assim_layer_2
#> shaded_Assim_layer_3
#> shaded_Assim_layer_4
#> shaded_Assim_layer_5
#> shaded_Assim_layer_6
#> shaded_Assim_layer_7
#> shaded_Assim_layer_8
#> shaded_Assim_layer_9
#> shaded_GrossAssim_layer_0
#> shaded_GrossAssim_layer_1
#> shaded_GrossAssim_layer_2
#> shaded_GrossAssim_layer_3
#> shaded_GrossAssim_layer_4
#> shaded_GrossAssim_layer_5
#> shaded_GrossAssim_layer_6
#> shaded_GrossAssim_layer_7
#> shaded_GrossAssim_layer_8
#> shaded_GrossAssim_layer_9
#> shaded_Gs_layer_0
#> shaded_Gs_layer_1
#> shaded_Gs_layer_2
#> shaded_Gs_layer_3
#> shaded_Gs_layer_4
#> shaded_Gs_layer_5
#> shaded_Gs_layer_6
#> shaded_Gs_layer_7
#> shaded_Gs_layer_8
#> shaded_Gs_layer_9
#> shaded_Rp_layer_0
#> shaded_Rp_layer_1
#> shaded_Rp_layer_2
#> shaded_Rp_layer_3
#> shaded_Rp_layer_4
#> shaded_Rp_layer_5
#> shaded_Rp_layer_6
#> shaded_Rp_layer_7
#> shaded_Rp_layer_8
#> shaded_Rp_layer_9
#> shaded_TransR_layer_0
#> shaded_TransR_layer_1
#> shaded_TransR_layer_2
#> shaded_TransR_layer_3
#> shaded_TransR_layer_4
#> shaded_TransR_layer_5
#> shaded_TransR_layer_6
#> shaded_TransR_layer_7
#> shaded_TransR_layer_8
#> shaded_TransR_layer_9
#> shaded_absorbed_ppfd_layer_0
#> shaded_absorbed_ppfd_layer_1
#> shaded_absorbed_ppfd_layer_2
#> shaded_absorbed_ppfd_layer_3
#> shaded_absorbed_ppfd_layer_4
#> shaded_absorbed_ppfd_layer_5
#> shaded_absorbed_ppfd_layer_6
#> shaded_absorbed_ppfd_layer_7
#> shaded_absorbed_ppfd_layer_8
#> shaded_absorbed_ppfd_layer_9
#> shaded_fraction_layer_0
#> shaded_fraction_layer_1
#> shaded_fraction_layer_2
#> shaded_fraction_layer_3
#> shaded_fraction_layer_4
#> shaded_fraction_layer_5
#> shaded_fraction_layer_6
#> shaded_fraction_layer_7
#> shaded_fraction_layer_8
#> shaded_fraction_layer_9
#> soil_air_entry
#> soil_b_coefficient
#> soil_clod_size
#> soil_depth1
#> soil_depth2
#> soil_depth3
#> soil_field_capacity
#> soil_reflectance
#> soil_sand_content
#> soil_saturated_conductivity
#> soil_saturation_capacity
#> soil_transmission
#> soil_water_content
#> soil_wilting_point
#> solar
#> sowing_time
#> specific_heat_of_air
#> sunlit_Assim_layer_0
#> sunlit_Assim_layer_1
#> sunlit_Assim_layer_2
#> sunlit_Assim_layer_3
#> sunlit_Assim_layer_4
#> sunlit_Assim_layer_5
#> sunlit_Assim_layer_6
#> sunlit_Assim_layer_7
#> sunlit_Assim_layer_8
#> sunlit_Assim_layer_9
#> sunlit_GrossAssim_layer_0
#> sunlit_GrossAssim_layer_1
#> sunlit_GrossAssim_layer_2
#> sunlit_GrossAssim_layer_3
#> sunlit_GrossAssim_layer_4
#> sunlit_GrossAssim_layer_5
#> sunlit_GrossAssim_layer_6
#> sunlit_GrossAssim_layer_7
#> sunlit_GrossAssim_layer_8
#> sunlit_GrossAssim_layer_9
#> sunlit_Gs_layer_0
#> sunlit_Gs_layer_1
#> sunlit_Gs_layer_2
#> sunlit_Gs_layer_3
#> sunlit_Gs_layer_4
#> sunlit_Gs_layer_5
#> sunlit_Gs_layer_6
#> sunlit_Gs_layer_7
#> sunlit_Gs_layer_8
#> sunlit_Gs_layer_9
#> sunlit_Rp_layer_0
#> sunlit_Rp_layer_1
#> sunlit_Rp_layer_2
#> sunlit_Rp_layer_3
#> sunlit_Rp_layer_4
#> sunlit_Rp_layer_5
#> sunlit_Rp_layer_6
#> sunlit_Rp_layer_7
#> sunlit_Rp_layer_8
#> sunlit_Rp_layer_9
#> sunlit_TransR_layer_0
#> sunlit_TransR_layer_1
#> sunlit_TransR_layer_2
#> sunlit_TransR_layer_3
#> sunlit_TransR_layer_4
#> sunlit_TransR_layer_5
#> sunlit_TransR_layer_6
#> sunlit_TransR_layer_7
#> sunlit_TransR_layer_8
#> sunlit_TransR_layer_9
#> sunlit_absorbed_ppfd_layer_0
#> sunlit_absorbed_ppfd_layer_1
#> sunlit_absorbed_ppfd_layer_2
#> sunlit_absorbed_ppfd_layer_3
#> sunlit_absorbed_ppfd_layer_4
#> sunlit_absorbed_ppfd_layer_5
#> sunlit_absorbed_ppfd_layer_6
#> sunlit_absorbed_ppfd_layer_7
#> sunlit_absorbed_ppfd_layer_8
#> sunlit_absorbed_ppfd_layer_9
#> sunlit_fraction_layer_0
#> sunlit_fraction_layer_1
#> sunlit_fraction_layer_2
#> sunlit_fraction_layer_3
#> sunlit_fraction_layer_4
#> sunlit_fraction_layer_5
#> sunlit_fraction_layer_6
#> sunlit_fraction_layer_7
#> sunlit_fraction_layer_8
#> sunlit_fraction_layer_9
#> tbase
#> temp
#> theta
#> time
#> time_zone_offset
#> tpu_rate_max
#> vmax1
#> vmax_n_intercept
#> windspeed
#> windspeed_height
#> windspeed_layer_0
#> windspeed_layer_1
#> windspeed_layer_2
#> windspeed_layer_3
#> windspeed_layer_4
#> windspeed_layer_5
#> windspeed_layer_6
#> windspeed_layer_7
#> windspeed_layer_8
#> windspeed_layer_9
#> wsFun
#> year
#>
#> The following parameters were not used as inputs to any module:
#> jmax_mature
#> km_leaf_litter
#> sf_jmax
#> soil_bulk_density
#> soil_clay_content
#> soil_silt_content
#> You may want to consider removing them for clarity
#>
#> The following drivers were not used as inputs to any module:
#> dw_solar
#> netsolar
#> up_solar
#> zen
#> You may want to consider removing them for clarity
#>
#> All quantities in the initial values have associated derivatives
#>
#> Derivatives for the following quantities are each determined by more than one module:
#> Grain
#> Leaf
#> Rhizome
#> Root
#> Shell
#> Stem
#>
#> No direct modules require a fixed step size Euler ode_solver
#>
#> No differential modules require a fixed step size Euler ode_solver
#>
#> All modules in the direct module list are direct modules
#>
#> All modules in the differential module list are differential modules
#>
#> [1] TRUE