Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: solving a set of odes and non-odes system
Replies: 6   Last Post: Apr 4, 2014 7:22 AM

 Messages: [ Previous | Next ]
 Torsten Posts: 1,717 Registered: 11/8/10
Re: solving a set of odes and non-odes system
Posted: Feb 26, 2013 2:53 AM

On 25 Feb., 20:20, "Elsis " <el...@fake-email.com> wrote:
> Hello!
>
> I have a set of equations, all coupled but some of them are odes and the others are not differential... meaning: half of my equations are odes and the other half are simple equations with variables but... all of them are coupled, the odes and non-odes have to be all solved at the same time... how could I do this? I am a matlab beginner and I have no idea about how to proceed.
>
> Thank you very much! :)
>
> Elsa

The easiest way to proceed is to use an ODE-integrator (like ODE15s)
to solve for the differential variables and to deduce the algebraic
variables "internally".
Example:
dy1/dt = 3*sin(y1)+5*cos(y2)
y2-y1-10=0
Here you could simply solve for y1 and deduce y2 explicitly as
y2=10+y1.
If the non-differential equations are not that simple, you will have
to solve for both differential and non-differential equations using
ODE15s.
The solver offers the possibility to define a mass matrix M in which
you set the rows in M to zero that correspond to algebraic variables.
For the example above,
M=[1 0 ; 0 0];
f=[3*sin(y1)+5*cos(y2);y2-y1-10];

Best wishes
Torsten.

Date Subject Author
2/26/13 Torsten
3/7/13 Torsten