If I'm not wrong this fall in DAEs. I would suggest:
use deSolve with the option LSODAR.
Write a function for derivatives (let call func) that gives:
dPhi/dt = ....
dAlpha/dt = ....
Write a function for the algebric part (let call rootfunc ):
inside rootfunc, first call func and get inside it the values of  dPhi/dt
and dAlpha/dt,
end then you can calculate:
r=-Pi +a * dPhi/dt + b * dAlpha/dt + c
the parameters a,b,c, can be passed by the vector, pars, in the main call
to LSODAR.
I hope this help you.
Bye
Gianmarco
PS in deSolve there are routines for DAEs solution in one shot, however I
have not direct experience. Maybe someone has a better knowledge.


2014-05-17 2:45 GMT+02:00 Jinsong Zhao <jszhao@yeah.net>:

> Hi there,
>
> Don't know if the subject is reasonable. In the model I am trying to solve
> have a function like:
>
> Pi = a * dPhi/dt + b * dAlpha/dt + c
> dPhi/dt = ....
> dAlpha/dt = ....
>
> I don't know how to make the model equation for the first equation.
>
> I try to use deSolve package.
>
> Any suggestions? Thanks in advance.
>
> Best,
> Jinsong
>
> _______________________________________________
> R-sig-dynamic-models mailing list
> R-sig-dynamic-models@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models
>



-- 
Gianmarco

	[[alternative HTML version deleted]]

