|
|
Re: want to save internal data from ode45 - is this true?
Posted:
Dec 9, 2012 2:29 AM
|
|
On 12/09/2012 08:25 AM, someone wrote: > I want to save internal data from ode45, but NOT from the intermediate > timesteps (only the full timestep). > > I found this: > http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/246590 > > And tried to implement it - but I think it's wrong. > > If the last line(s) of the mass-matrix is zero, the ode45-solver will > not even solve it. > > Am I right? Isn't there any way of only solving the whole (full) > timestep internal values of ode45?
This is what I'm referring to:
---------- dx(1)/dt = f1(t,x(1),x(2)) dx(2)/dt = f2(t,x(1),x(2)) y = f3(t,x(1),x(2)).
Then define a problem of dimension 3, set the mass matrix to [1,0,0; 0,1,0; 0,0,0] (rows are seperated by ;) and the system to dx(1) = f1(t,x(1),x(2)) dx(2) = f2(t,x(1),x(2)) dx(3) = x(3) - f3(t,x(1),x(2))
Often it is essential that the initial condition you provide for y are consistent, i.e. set exactly x(3) (t=0) = f3(t=0,x(1)(t=0),x(2)(t=0)). ----------
I don't think this should work, with zeros in the last row of the mass-matrix. Am I right?
|
|