Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten

Posts: 1,440
Registered: 11/8/10
Re: solving a set of odes and non-odes system
Posted: Feb 26, 2013 2:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.