Displaying 6 results from an estimated 6 matches for "yini".
Did you mean:
mini
2011 Oct 02
0
deSolve - Function daspk on DAE system - Error
...Thanks, Vince
CODE:
library(deSolve)
Res_DAE=function(t, y, dy, pars) {
with(as.list(c(y, dy, pars)), {
res1 = -dS -dES-k2*ES
res2 = -dP + k2*ES
eq1 = Eo-E -ES
eq2 = So-S -ES -P
return(list(c(res1, res2, eq1, eq2)))
})
}
pars <- c(Eo=0.02, So=0.02, k2=250, E=0.01); pars
yini <- c(S=0.01, ES = 0.01, P=0.0, E=0.01); yini
times <- seq(0, 0.01, by = 0.0001); times
dyini = c(dS=0.0, dES=0.0, dP=0.0)
## Tabular output check of matrix output
DAE <- daspk(y = yini, dy = dyini, times = times, res = Res_DAE, parms =
pars, atol = 1e-10, rtol = 1e-10)
ERROR:
daspk-- w...
2011 Oct 03
0
deSolve - Function daspk on DAE system - Error (Vince)
...Thanks, Vince
CODE:
library(deSolve)
Res_DAE=function(t, y, dy, pars) {
with(as.list(c(y, dy, pars)), {
res1 = -dS -dES-k2*ES
res2 = -dP + k2*ES
eq1 = Eo-E -ES
eq2 = So-S -ES -P
return(list(c(res1, res2, eq1, eq2)))
})
}
pars <- c(Eo=0.02, So=0.02, k2=250, E=0.01); pars
yini <- c(S=0.01, ES = 0.01, P=0.0, E=0.01); yini
times <- seq(0, 0.01, by = 0.0001); times
dyini = c(dS=0.0, dES=0.0, dP=0.0)
## Tabular output check of matrix output
DAE <- daspk(y = yini, dy = dyini, times = times, res = Res_DAE, parms =
pars, atol = 1e-10, rtol = 1e-10)
ERROR:
daspk-- w...
2018 Apr 12
1
ODE
Hello All,
I'm struggling to solve this ODE using R,
vdpol <- function (h, v, t) (
list(c (
-0.1*v/(pi*(2*10*h-h^2)),
(v = (-0.1*v/(pi*(2*10*h-h^2))^2) + 2*9.81*h))
))
library(deSolve)
yini <- (c(h = 20, v=0))
nonstiff <- ode(y = yini, func = vdpol,
times= seq(0, 30, by = 0.01),
parms = 1)
It says that
The number of derivatives returned by func() (4) must equal the length of the initial conditions vecto...
2013 Apr 21
1
lsoda question from deSolve package
Dear List,
Wonder if you have some thoughts on the following question using lsoda in desolve:
I have the following data and function:
require(deSolve)
times <- c(0:24)
tin <- 0.5
D <- 400
V <- 26.3
k <-0.056
k12 <- 0.197118
k21 <- 0.022665
yini <- c(dy1 = 0,dy2 = 0)
events <- data.frame(var = "dy1",time = c(10,15),value = c(200,100),method = "add")
pkmod <- function(t, y, p) {
if (t < tin) R <- (D/tin) else R <- 0
dy1 <- R - (p["k12"]+p["k"])* y[1] + p["k21"]*y[2]...
2016 Apr 26
0
vectors of equations in ode / desolve
...these parameters as a vector this
productes and error
rGrow = c(1.0, 1.3, 1.7) # /day, growth rate of prey
rMort = 0.2 , # /day, mortality rate of predator
assEff = 0.5, # -, assimilation efficiency
K = 10) # mmol/m3, carrying capacity
yini <- c(Prey = c(1, 2,3), Predator = 2)
times <- seq(0, 200, by = 1)
out <- ode(yini, times, LVmod, pars)
summary(out)
Thanks
Frank
2010 Dec 11
2
Predator Prey Models
...with(as.list(c(State, Pars)), {
IngestPred <- rI * N * Pred
GrowthN <- rG * N * (1 - N/K)
MortPred <- rM * Pred
dN <- GrowthN - IngestPred
dPred <- IngestPred * AE - MortPred
return(list(c(dN, dPred)))
})
}
pars <- c(rI = 0.1, rG = 0.9, rM = 0.8, AE = 0.9, K = 20)
yini <- c(N = 20, Pred = 20)
times <- seq(0, 200, by = 1)
y(time=100)<-c(N=10, Pred=5)
print(system.time)
zout <- as.data.frame(lsoda(yini, y(time=100), times, LVmod0D, pars))
plot(zout[,1],zout[,2], type="l",col="black", ylim=range(0,25),
xlab="time",ylab=...