Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Torsten
Posts:
1,674
Registered:
11/8/10


Re: solving a set of odes and nonodes system
Posted:
Feb 26, 2013 2:53 AM


On 25 Feb., 20:20, "Elsis " <el...@fakeemail.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 nonodes 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 ODEintegrator (like ODE15s) to solve for the differential variables and to deduce the algebraic variables "internally". Example: dy1/dt = 3*sin(y1)+5*cos(y2) y2y110=0 Here you could simply solve for y1 and deduce y2 explicitly as y2=10+y1. If the nondifferential equations are not that simple, you will have to solve for both differential and nondifferential 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);y2y110];
Best wishes Torsten.



