0

If I have two sets of highly coupled ODEs such as:

dy/dt = A*dx/dt + B*y + C*x
dx/dt = D*dy/dt + E*y + F*x

or if I have a system like:

U = function(dy/dt)
dy/dt = function(U,...)

How would ode45 normally handle this? If I were to do the following:

DY(1) = A*DY(2) + B*y(1) + C*y(2)
DY(2) = D*DY(1) + E*y(1) + F*y(2)

or similarly for the second problem:

U = A*DY(1) + ...
DY(1) = B*U + ...

and run ode45, MATLAB produces results without complaint but I'm slightly hesitant as I'm not sure how it's handling such a coupled system of equations. And suggestions?

Kimusubi
  • 155
  • 1
  • 8
  • MATLAB shouldn't be able to solve this sort of problem with ode45 as it's generally an implicit problem (example number 2 provided above). It should give me an error when I try to run it, however, it runs smoothly and that's what's confusing me. Realistically I should only be able to use ode15i for this sort of problem... – Kimusubi May 19 '13 at 22:25
  • Unless `DY(2)` is initialized, Matlab will cough up an error, otherwise Matlab is going to use some pre-determined value, not necessarily the value you want. – Rasman May 20 '13 at 04:07
  • What predetermined value is it going to use though? DY(2) is not defined anywhere in the program which is what's confusing me. – Kimusubi May 20 '13 at 05:24
  • Give me a [SSCCE](http://sscce.org/) and then get back to me – Rasman May 20 '13 at 13:20
  • After reading through all the lines of code, I know exactly why it's accepting it without complaint. When you're running a system of ODEs in MATLAB, you have to initialize a column vector with DY = zeros(N,1) where N is the number of equations. When you initialize it, it continuously uses those values throughout the solution process for implicit situations. – Kimusubi May 20 '13 at 19:56

0 Answers0