I have a function of a single variable, and various parameters.
For each value of one of the parameters (the others are fixed) there is a single root of the function. From a vector of the parameter I would like to generate a vector of the roots (using uniroot
).
The actual example I'm working on is a bit messy, but I'll give it. Here are the fixed parameters:
eta_inf = -0.0139 eta_0 = 178.5 lambda = 2.4954 m = 0.83094
Here is the function:
crossFnc <- function(gamma_dot) tau - gamma_dot*(eta_inf + (eta_0-eta_inf)/(1 + (lambda*gamma_dot)^m))
Here is an example of a root for a particular value of the tau
parameter:
tau=10 uniroot(crossFnc, c(0,1))$root
[1] 0.06900807
I would like to generate a vector of these roots, for example, for:
tau <- seq(0,10,length.out=101)
Thanks,
Steve