Skip to contents

Gives the substrate uptake rate based on the shape and species-specific parameters supplied. If no shape is supplied, attempts to infer the correct shape from supplied parameters.

Usage

get_uptake(conc, uptake_shape = NA, Nform_abbr, spec_params)

Arguments

conc

substrate concentration

uptake_shape

kinetic shape for substrate uptake. One of "linear" or "Michaelis-Menton" (or "MM"). Defaults to Michaelis-Menton.

Nform_abbr

the abbreviation used in spec_params for the relevant nitrogen form. See details.

spec_params

a vector of named numbers. Must include:

  • M and C for linear uptake, OR

  • V and K for Michaelis-Menton uptake

  • uptake_shape of "linear" or "MM" (or "Michaelis-Menton"). Not required if only one set of the above parameters are provided.

Details

Nform_abbr allows the function to link species parameters with concentration. E.g. if Nform_abbr = "amm" (for ammonium) the function will look for M_amm and C_amm or V_amm and K_amm in spec_params and will ignore other uptake parameters which may be included for other substrates.

Examples

Ni <- seq(0, 300, 10)
Am <- seq(0, 1000, 20)
my_species <- c(V_ni = 4.5, K_ni = 300, V_am = 5.5, K_am = 150, M_am = 1.5, C_am = 10)

# Get uptake for a vector of concentrations
sapply(Am, function(conc) {get_uptake(conc = conc, uptake_shape = "linear", Nform_abbr = "am", spec_params = my_species)})
#>  [1]   10   40   70  100  130  160  190  220  250  280  310  340  370  400  430
#> [16]  460  490  520  550  580  610  640  670  700  730  760  790  820  850  880
#> [31]  910  940  970 1000 1030 1060 1090 1120 1150 1180 1210 1240 1270 1300 1330
#> [46] 1360 1390 1420 1450 1480 1510

# Uptake shape does not need to be specified if only one set of parameters is provided
sapply(Ni, function(conc) {get_uptake(conc = conc, uptake_shape = NA, Nform_abbr = "ni", spec_params = my_species)})
#>  [1] 0.0000000 0.1451613 0.2812500 0.4090909 0.5294118 0.6428571 0.7500000
#>  [8] 0.8513514 0.9473684 1.0384615 1.1250000 1.2073171 1.2857143 1.3604651
#> [15] 1.4318182 1.5000000 1.5652174 1.6276596 1.6875000 1.7448980 1.8000000
#> [22] 1.8529412 1.9038462 1.9528302 2.0000000 2.0454545 2.0892857 2.1315789
#> [29] 2.1724138 2.2118644 2.2500000

# Create a custom compound to uptake
my_species <- c(V_urea = 1.5, K_urea = 10)
Urea <- seq(0, 25, 0.5)
sapply(Urea, function(conc) {get_uptake(conc = conc, Nform_abbr = "urea", spec_params = my_species)})
#>  [1] 0.00000000 0.07142857 0.13636364 0.19565217 0.25000000 0.30000000
#>  [7] 0.34615385 0.38888889 0.42857143 0.46551724 0.50000000 0.53225806
#> [13] 0.56250000 0.59090909 0.61764706 0.64285714 0.66666667 0.68918919
#> [19] 0.71052632 0.73076923 0.75000000 0.76829268 0.78571429 0.80232558
#> [25] 0.81818182 0.83333333 0.84782609 0.86170213 0.87500000 0.88775510
#> [31] 0.90000000 0.91176471 0.92307692 0.93396226 0.94444444 0.95454545
#> [37] 0.96428571 0.97368421 0.98275862 0.99152542 1.00000000 1.00819672
#> [43] 1.01612903 1.02380952 1.03125000 1.03846154 1.04545455 1.05223881
#> [49] 1.05882353 1.06521739 1.07142857