Dear Members
Regards of the day.
I have one doubt which came across by solving ODE using deSolve.
If you do not mind can i exaplin here in email.
My Differential Equation is attached in the word file.
My all parameters are remaining constant for the time series.
Only changing variable is Cp.
My question is how can i get the deSolve in play in this condition ??
So that i get my new column named V (after the integration)
For your reference ::
Following is the matrix output of my one of the data.
time Cp ka ke Vd ks Em_s E5_s kr Em_r E5_r
[1,] 0.0 0.000000e+00 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[2,] 0.5 6.191404e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[3,] 1.0 8.534519e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[4,] 1.5 8.839764e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[5,] 2.0 8.153719e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[6,] 2.5 7.063856e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[7,] 3.0 5.885603e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[8,] 3.5 4.776258e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[9,] 4.0 3.803654e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
Can you please guide me in it?
Will be greatly appriciated
Thank you
Munjal
[R-sig-dyn-mod] Question About solving ODE with help of deSolve
4 messages · Munjal Patel, Daniel Reed, Thomas Petzoldt
Hi Munjal: The Word document seems to have been stripped from your email. Can you copy and paste its contents into an email with your code, etc.? Cheers, Daniel _______________________________ Daniel C. Reed, PhD. Postdoctoral Fellow, Dept. of Earth & Environmental Sciences, University of Michigan, Ann Arbor, MI, USA. email: reeddc at umich.edu web: www.danielreed.org Twitter: @DanielReedOcean
On Jun 19, 2014, at 11:21 AM, Munjal Patel <munjalpatel85 at gmail.com> wrote:
Dear Members
Regards of the day.
I have one doubt which came across by solving ODE using deSolve.
If you do not mind can i exaplin here in email.
My Differential Equation is attached in the word file.
My all parameters are remaining constant for the time series.
Only changing variable is Cp.
My question is how can i get the deSolve in play in this condition ??
So that i get my new column named V (after the integration)
For your reference ::
Following is the matrix output of my one of the data.
time Cp ka ke Vd ks Em_s E5_s kr Em_r E5_r
[1,] 0.0 0.000000e+00 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[2,] 0.5 6.191404e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[3,] 1.0 8.534519e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[4,] 1.5 8.839764e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[5,] 2.0 8.153719e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[6,] 2.5 7.063856e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[7,] 3.0 5.885603e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[8,] 3.5 4.776258e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
[9,] 4.0 3.803654e-01 0.9 0.6 500 0.1 1.1 12 0.05 0.8 9
Can you please guide me in it?
Will be greatly appriciated
Thank you
Munjal
_______________________________________________ R-sig-dynamic-models mailing list R-sig-dynamic-models at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models
Dear Munjal Patel,
this mailing does not support attachments, i.e. no Word, PDF, ... Please
include your material as plain text (preferred) or put supporting
material to a web server and link to it.
However, if I understand your "changing variable" correctly, it can be
implemented as a forcing function, see
?forcings
or the minimal example below.
Thomas
library("deSolve")
mod <- function(t, y, p) {
a <- p[1]
b <- signal(t)
dy <- a + b * y[1]
list(c(dy), a, b=b)
}
times <- seq(0, 4, 0.5)
Cp <- c(0.00E+00, 6.19E-01, 8.53E-01, 8.84E-01, 8.15E-01, 7.06E-01,
5.89E-01, 4.78E-01, 3.80E-01)
signal <- approxfun(times, Cp, rule=2)
p <- c(a=.1)
y0 <- c(y=1)
out <- ode(y0, times, mod, p)
plot(out)
out
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-dynamic-models/attachments/20140620/368ff001/attachment.pl>