solving of ordinary differential equations
solving of ordinary differential equations
(OP)
Hi there,
maybe someone can help me with this problem:
I need to solve two coupled ODE's (dq and dp) (each one has eight rows)
which I have written in one function file: function[dq,dp]=twopairs( here are the input
variables)
further down in this file
the dq is written out
and then the dp as a separate function
function dp=...
in the main file I want to solve dq and dp with
the ode45 solver. how do you refer to every function separately? They are stored in twopair.m
so this does not work?
[t1,Q]=ode45(@twopairs,...)
[t2,P]=ode45(@twopairs,...)
Any help is much appreciated!!!
Many thanks
olli
maybe someone can help me with this problem:
I need to solve two coupled ODE's (dq and dp) (each one has eight rows)
which I have written in one function file: function[dq,dp]=twopairs( here are the input
variables)
further down in this file
the dq is written out
and then the dp as a separate function
function dp=...
in the main file I want to solve dq and dp with
the ode45 solver. how do you refer to every function separately? They are stored in twopair.m
so this does not work?
[t1,Q]=ode45(@twopairs,...)
[t2,P]=ode45(@twopairs,...)
Any help is much appreciated!!!
Many thanks
olli





RE: solving of ordinary differential equations
Since the equations are not coupled you might be able to assume the form of Q, and then take the part of the matrix that is the Q you want. Likewise for P, find out what part of the Q! you generate is and then take the part that is for the P that you want.. I am guessing that t1=t2 and it is good for both.