Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: dy/dt value from ode45 solver
Date: Thu, 20 Aug 2009 13:28:10 -0400
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <h6k132$qhl$1@fred.mathworks.com>
References: <h6f14q$7a7$1@fred.mathworks.com> <h6f5pa$hct$1@fred.mathworks.com> <h6fikv$egv$1@fred.mathworks.com> <h6firi$red$1@fred.mathworks.com> <h6h1q8$sp5$1@fred.mathworks.com> <h6jv5k$mfq$1@fred.mathworks.com> <h6k0q9$9f5$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1250789282 27189 172.31.44.65 (20 Aug 2009 17:28:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 20 Aug 2009 17:28:02 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:564829



"Md. Shahriar Karim" <karim.shahriar@gmail.com> wrote in message 
news:h6k0q9$9f5$1@fred.mathworks.com...
> Hi Steve,
>
> Thanks.
>
> I need dy/dt value from a set of ODE. y value is not mandatory for me. 
> however, it's okay if I have those. I have coded it in following manner--
> ***********************************************************
> [t, y]=ode45('steadystate', [0:0.1:10000], y0);
> %       dydt=steadystate(t,y);
> plot(t, y)
> xlabel('TIME'); ylabel('Concentration of Species in Molecules');
> dydt=y;
> for k=1:numel(t)
>    dydt(k,:)=steadystate(t(k),y(k,:));
> end

*snip*

> But I am not yet clear how the calling of steadystate function is giving 
> me the data dy/dt? Could you please explain a little bit?

Remember, as stated in the documentation for ODE45, the first input argument 
that it requires is a function that accepts two inputs, t and y, and returns 
the right-hand side of the system of differential equations y' = dy/dt = 
f(t, y).  Thus the values from that function _are_ the dy/dt values you're 
looking for.

-- 
Steve Lord
slord@mathworks.com