Skip to contents

This implements an inverse modeling approach which optimizes vertically resolved production (or consumption) of the gases in question to fit a modeled concentration profile to observed data.

One boundary condition of this model is, that there is no incoming or outgoing flux at the bottom of the lowest layer of the profile. If this boundary condition is not met, the flux must be optimised as well. This can be set in zero_flux.

Usage

pro_flux(x, ...)

# S3 method for class 'cfp_dat'
pro_flux(x, ...)

# S3 method for class 'cfp_pfres'
pro_flux(x, ...)

# S3 method for class 'cfp_pfmod'
pro_flux(x, ...)

Arguments

x

A cfp_dat object with all the necessary input datasets.

...

Arguments passed on to cfp_pfmod

zero_flux

(logical) Applies the zero-flux boundary condition? If FALSE, F0 is optimized alongside the production rates.

zero_limits

(numeric vector) a vector of length 2 defining the lower and upper limit of the lowest flux if zero_flux = FALSE.

DSD0_optim

[Deprecated]

evenness_factor

[Experimental](numeric) A user defined factor used to penalise strong differences between the optimised production rates. This must be identified by trial-and-error and can help prevent that production rates are simply set to zero basically the lower a production is relative to the the maximum of the absolute of all productions, the higher it is penalised. The evenness_factor then defines the weight of this penalty in the optimisation algorithm prod_optim.

See also

Other flux models: fg_flux()

Examples

{

soilphys <-
 cfp_soilphys(
   ConFluxPro::soilphys,
   id_cols = c("site", "Date")
 )

gasdata <-
 cfp_gasdata(
   ConFluxPro::gasdata,
   id_cols = c("site", "Date")
 )


lmap <-
 cfp_layers_map(
   ConFluxPro::layers_map,
   gas = "CO2",
   lowlim = 0,
   highlim = 1000,
   id_cols = "site"
 )

PROFLUX <-
 cfp_dat(gasdata,
         soilphys,
         lmap ) |>
 pro_flux()
}
#> 
#> added 'gas' to id_cols
#> 
#> added 'gas' to id_cols
#> 
#> added 'gas' to id_cols
#> 
#> validating datasets
#> id_cols: site, Date, gas
#> 24 unique profiles