ODE solver for coupled equations

5 Ansichten (letzte 30 Tage)
Josh
Josh am 28 Jun. 2016
Kommentiert: Star Strider am 1 Jul. 2016
Hi,
I have a set of equations I am trying to solve using an ODE solver. I originally posted on this thinking about using ODE45. After looking into this more, I'm not too sure ODE45 is the best solver since they are highly coupled. I'm now looking at ODE15s. Are there any suggestions? My code is below.
Also, I am getting an error when running my code. I am trying to use dxdt(2) in the equation for dxdt(1) and also use dxdt(1) in the equation for dxdt(2) and dxdt(3). The error is "Undefined function or variable dxdt".

Akzeptierte Antwort

Star Strider
Star Strider am 28 Jun. 2016
See if this helps:
...
iLoad = vC/Rload;
dxdt = zeros(7,1);
dxdt(1,:) = (x*(Vs - vC) + y*(-vj1 - dxdt(2) - vC))/L; % diL/dt
...
  2 Kommentare
Josh
Josh am 1 Jul. 2016
Thanks, this solved the problem.
Star Strider
Star Strider am 1 Jul. 2016
My pleasure.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by