From: Anon123 on
I want to write the ODE dR/dT=k0-k1*S-k2*R where S and R are variables and k0,k1 and k2 are constants.

in matlab so that i can give it as a parameter to odes15 solver. How should i write that function? also wat initial values i should give?

Finally I want to plot R vs S. Should i use a for loop or can i give some range of values in some way?
From: Steven Lord on

"Anon123" <cse.search(a)gmail.com> wrote in message
news:30727985.139682.1273910714009.JavaMail.root(a)gallium.mathforum.org...
>I want to write the ODE dR/dT=k0-k1*S-k2*R where S and R are variables and
>k0,k1 and k2 are constants.

You have a system of one ODE in two unknowns. Do you also have an
expression for dS/dT?

> in matlab so that i can give it as a parameter to odes15 solver. How
> should i write that function? also wat initial values i should give?

If you have an expression for dS/dT, or if S is a known constant, look at
the first and third van der Pol examples in this documentation page:

http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-662913.html#f1-38582

If those conditions are not satisfied, then you can't solve this system
numerically -- you will need to use DSOLVE in Symbolic Math Toolbox. For
that I'll refer you to the HELP and DOCumenatation for DSOLVE.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ