Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
want to save internal data from ode45 - is this true?

Subject: want to save internal data from ode45 - is this true?

From: someone

Date: 9 Dec, 2012 07:25:18

Message: 1 of 2

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?

Subject: want to save internal data from ode45 - is this true?

From: someone

Date: 9 Dec, 2012 07:29:47

Message: 2 of 2

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?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us