我有每次特定的参数值。我想提供此参数值以解决以下ODE:<script src="https://www.gstatic.com/charts/loader.js"></script>
<input type="number" id="rand-min" value="0" min="0" max="10">
<input type="number" id="rand-max" value="9" min="0" max="10">
<input type="button" id="draw-chart" value="Apply">
<div id="chart-1" style="height: 500px">Generating chart...</div>
其中dN/dt = mu*N
。 mu = b*(X-12.2)^2
值随时间变化。请参阅我提出的以下代码:
X
library(deSolve)
times = seq(from = 0, to = 2, by = 0.1)
X = c(57.20000, 57.19989, 57.18739, 57.08867, 56.80817, 56.31114, 55.61912,
54.77622, 53.82779, 52.81217, 51.75900, 50.69015, 49.62139, 48.56372,
47.52467, 46.50934, 45.52096, 44.56154, 43.63211, 42.73310, 41.86450)
N0 <- 1
b <- 7.45 # Model parameter
Xmin = 12.2
model <- function(t, y, parms) {
with(as.list(c(y, parms)),{
mu <- b*(X-Xmin)^2
dN <- mu*N
return(list(dN))
})
}
yini <- c(N=N0)
parms <- mu
t <- times
out <- ode(y=yini, times=times, func=model, parms=parms)
值特定于每次,即X
,t = 0, X = 57.2
等等......并且需要提供这些值以随时间计算N.它不起作用。任何人都可以帮忙吗?
谢谢,