View source: R/calculate_temperature_response_polynomial.R
calculate_temperature_response_polynomial | R Documentation |
Calculate leaf-temperature-dependent values of various parameters using
polynomial equations. It is rare for users to call this function directly;
instead, it is used internally by
calculate_temperature_response
.
calculate_temperature_response_polynomial(
exdf_obj,
polynomial_parameters,
tleaf_column_name = 'TleafCnd'
)
exdf_obj |
An |
polynomial_parameters |
A list of named lists. Each list element should describe the polynomial
coefficients ( |
tleaf_column_name |
The name of the column in |
Polynomial equations are often used to calculate the temperature dependence of the rates of chemical reactions. For example, a second-order polynomial could be given as follows:
(1) rate = R_0 + R_1 * T + R_2 * T^2
where R_0
, R_1
, and R_2
are the zeroth, first, and second
order coefficients and T
is the temperature. Higher order polynomials
can also be defined, where an order-N
polynomial is given by
(2) rate = R_0 + R_1 * T + R_2 * T^2 + ... + R_N * T^N
In general, an order-N
polynomial has N
coefficients, although
some of them may be zero.
In calculate_temperature_response_polynomial
, the coefficients
(coef
) and units (units
) for a variable must be specified as
elements of a list, which itself is a named element of
polynomial_parameters
. The coefficients must be specified as a numeric
vector, where the i
th element represents the i
th coefficient.
For example, if a dimensionless variable called theta
is calculated
according to theta = 0.352 + 0.022 * T - 3.4e-4 * T^2
, the
polynomial_parameters
argument could be supplied as follows:
list(theta = list(coef = c(0.352, 0.022, -3.4e-4), units = 'dimensionless'))
.
It is rare to directly specify the polynomial parameters; instead, it is more
typical to use one of the pre-set values such as those included in
jmax_temperature_param_bernacchi
.
An exdf
object based on exdf_obj
that includes one new column
for each element of polynomial_parameters
, where the
temperature-dependent values of these new columns are determined using the
temperature values specified by the tleaf_column_name
column. The
category of each of these new columns is
calculate_temperature_response_polynomial
to indicate that they were
created using this function.
# Read an example Licor file included in the PhotoGEA package
licor_file <- read_gasex_file(
PhotoGEA_example_file_path('ball_berry_1.xlsx')
)
licor_file <- calculate_temperature_response_polynomial(
licor_file,
list(theta = list(coef = c(0.352, 0.022, -3.4e-4), units = 'dimensionless'))
)
licor_file$units$theta # View the units of the new `theta` column
licor_file$categories$theta # View the category of the new `theta` column
licor_file[,'theta'] # View the values of the new `theta` column
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.