From: Alex on 19 Apr 2010 13:00 So I have two seperate programs. The first, solved by ODE45 outputs matrix [t,Q], the second outputs matrix [t,P] also solved by ODE45. I need to use the results [t,Q] in the right hand side equation that ODE45 solves for [t,P]. Run the first program, obtain [t,Q], now I need to use Q at time t in the program that obtains [t,P] i.e something like P(t) = k*Q(t); what is the syntax for this?
From: Steven Lord on 19 Apr 2010 14:41 "Alex " <a.mlw.walker(a)googlemail.com> wrote in message news:hqi27o$nbh$1(a)fred.mathworks.com... > So I have two seperate programs. The first, solved by ODE45 outputs matrix > [t,Q], the second outputs matrix [t,P] also solved by ODE45. > > I need to use the results [t,Q] in the right hand side equation that ODE45 > solves for [t,P]. > > Run the first program, obtain [t,Q], now I need to use Q at time t in the > program that obtains [t,P] > > i.e something like > > P(t) = k*Q(t); > > what is the syntax for this? And what if you need to obtain a value for "Q(t)" at a time for which the first ODE45 call did not return a value? Specify _one_ output for your first ODE45 call then pass that structure into your second ODE45 call's ODE function and use DEVAL to evaluate the solution at desired times. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
|
Pages: 1 Prev: fmincon problem Next: What type of NNet problem is this Options |