Path: news.mathworks.com!not-for-mail
From: "Md. Shahriar Karim" <karim.shahriar@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: dy/dt value from ode45 solver
Date: Wed, 19 Aug 2009 14:22:00 +0000 (UTC)
Organization: EBL
Lines: 39
Message-ID: <h6h1q8$sp5$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>
Reply-To: "Md. Shahriar Karim" <karim.shahriar@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250691720 29477 172.30.248.37 (19 Aug 2009 14:22:00 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 19 Aug 2009 14:22:00 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1507044
Xref: news.mathworks.com comp.soft-sys.matlab:564451


Hi Steve,

Thanks for your help so far. However, I am totally unsure from the below part--

Write a function to DEVAL the SOL struct array at a given time and subtract 
that result from the desired dy/dt, then use FZERO on that function.

 sol=ode45(@steadystate, [0:0.1:10000], y0);

once I do the above, I get my all variables value  after solving the ODEs..variables are..B C D ..etc.

Now from this I am told to use the DEVAL   on "sol", it gives me the values of my variables B,C,D...but I was needed the "dy/dt...the slope values.  

Now, I am supposed to subtract my desired "dy/dt"..say 0.00001 from DEVAL output which is my variables values? Once this is done, I do FZERO on the result I get after subtraction....this is what I was told.

Could you please clarify how am I getting dy/dt out of the whole process? I am quite confused at this stage. Thanking you,

Md. Shahriar Karim



"Steven Lord" <slord@mathworks.com> wrote in message <h6firi$red$1@fred.mathworks.com>...
> 
> "Md. Shahriar Karim" <karim.shahriar@gmail.com> wrote in message 
> news:h6fikv$egv$1@fred.mathworks.com...
> > Hi Steve,
> >
> > DEVAL asks for a structure input. I also replaced
> >
> > [t, y]=ode45('steadystate', [0:0.1:10000], y0); part of my code  by
> > sol=ode45('steadystate', [0:0.1:10000], y0);
> 
> Try replacing the string input with a function handle to your function and 
> use the second of those syntaxes..
> 
> -- 
> Steve Lord
> slord@mathworks.com 
>