[R] Differential problem

2013-07-26 Thread Raphaëlle Carraud
Hello, I am trying to solve the following algebraic differential equation : dy1 = h - dy3 dy2 = g - dy4 y3 = K1*y1/(y3+y4) y4 = K2*y2/(y3+y4) I tried using the function daspk, but it gives me the following error : > out <- daspk(y = yini, dy = dyini, times = z, res = liquide, parms = 0) daspk--

Re: [R] Differential problem

2013-07-11 Thread Raphaëlle Carraud
ut <- daspk(y = state, dy = dval, times = z, res = reaction, parms = 0) head(out) plot(out) -Message d'origine- De : Berend Hasselman [mailto:b...@xs4all.nl] Envoyé : jeudi 11 juillet 2013 14:13 À : Raphaëlle Carraud Cc : r-help@r-project.org Objet : Re: [R] Differential problem On 11-0

Re: [R] Differential problem

2013-07-11 Thread Raphaëlle Carraud
ms = 0)) Is it wrong? When I modify the order, I obtain again that object dA is not found, so I guessed the doc was right. -Message d'origine----- De : Berend Hasselman [mailto:b...@xs4all.nl] Envoyé : jeudi 11 juillet 2013 12:33 À : Raphaëlle Carraud Cc : r-help@r-project.org Objet : Re:

Re: [R] Differential problem

2013-07-11 Thread Berend Hasselman
On 11-07-2013, at 13:53, Raphaëlle Carraud wrote: > Sorry for the bug, I had eliminated some lines to avoid making the program > too big. Here is the version that works : > > reaction<-function(z, state, dval, parameters) { > with(as.list(c(state)),{ ># rate of change > >Tr <- 273+9

Re: [R] Differential problem

2013-07-11 Thread Raphaëlle Carraud
deSolve) out <- daspk(y = state, dy = dval, times = z, res = reaction, parms = 0) head(out) plot(out) -Message d'origine- De : Berend Hasselman [mailto:b...@xs4all.nl] Envoyé : jeudi 11 juillet 2013 11:18 À : Raphaëlle Carraud Cc : r-help@r-project.org Objet : Re: [R] Differential

Re: [R] Differential problem

2013-07-11 Thread Berend Hasselman
nd shouldn't the first line of the reaction function be this with(as.list(c(state,dval,parameters)),{ in stead of this with(as.list(c(state)),{ The call of daspk also seems incorrect; shouldn't it be out <- daspk(y = state, dy = dval, times = z, res = reaction, parms = parameter

Re: [R] Differential problem

2013-07-11 Thread Berend Hasselman
On 11-07-2013, at 09:13, Raphaëlle Carraud wrote: > Hello, > > I have the following differential equation system to solve, the variables I > wish to obtain being A, B, C, D, E, I, G and H. > >0 = -dA + dB + 2*dC - 2*r1 - 2*r5 >0 = dA + dD + r1 + r4 >0 = K2 - C/B^2 >0 = K3 - D

[R] Differential problem

2013-07-11 Thread Raphaëlle Carraud
Hello, I have the following differential equation system to solve, the variables I wish to obtain being A, B, C, D, E, I, G and H. 0 = -dA + dB + 2*dC - 2*r1 - 2*r5 0 = dA + dD + r1 + r4 0 = K2 - C/B^2 0 = K3 - D/(A*B) 0 = r5 + 2*r4 - dE 0 = r5 -dI 0 = -r5 - r4 - dG