Automating the stability calculation for an ODE

I want to numerically solve an ODE using ODE45. Let's say the ODE is
function dydt = odefun(t,y,a,b,g,d)
dydt = [
y(1)*(a - b*y(2));
-y(2)*(g - d*y(1));
];
end;
but I will actually work with a much higher dimensional system. Elsewhere, I make the call
[t,y] = ode45(@(t,y) odefun(t,y,alpha,beta,gamma,delta), [0 tmax], [initialx initialy]);
Currently it runs fine. However, I would like to:
  • calculate the Jacobian matrix
  • evaluate it at an equilibrium whose coordinates I know
  • do standard stability analysis (eigenvalues and eigenvectors)
I don't want to hard-code in the Jacobian, since I will tinker with the differential equation. Getting Matlab to calculate the Jacobian is my current problem. Suggestions would be appreciated.

2 Commenti

Hello, Did you figure out any solution for this, I am looking for a similar kind of capability.
Thanks
Not yet. For now, I have the Jacobian typed in, so that a change to the differential equation means I have to go and change the Jacobian by hand.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Numerical Integration and Differential Equations in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by