The function finds the lower and upper roots (where the
thermal curve crosses 0) with the
uniroot
function and then integrates
the area under the thermal curve with the
integrate
function. This is useful as
part of the optimization routine in
optim_thermal
.
thermal_area(max_a, desired_area, optim_temp, width_param, lower = -5,
upper = 40)
Maximum Ricker a productivity value
Desired area under the thermal curve
Optimal temperature
The width parameter as a numeric value
Lower bound to pass to
uniroot
Upper bound to pass to
uniroot