Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Topic: want to save internal data from ode45 - is this true?
Replies: 1   Last Post: Dec 9, 2012 2:29 AM

 Messages: [ Previous | Next ]
 text-dude Posts: 74 Registered: 4/30/08
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:
>
> 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?

Date Subject Author
12/9/12 text-dude
12/9/12 text-dude