Evaluating stability of fixed points in a system of differential equations,
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Noob
am 3 Apr. 2025
Kommentiert: Sam Chak
am 11 Apr. 2025
Hi there!
Let's say I have a set of coupled ordinary differential equations for which I have found a certain number of fixed points, say, 50. Now I want to evaluate the stability of these 50 fixed points, so I have to first compute the Jacobian matrix of these differential equations, and then evaluate this Jacobian matrix at each of the 50 fixed points. Now I have 50 Jacobian matrices that I need to find eigenvalues for. Stability theory says that for any fixed point, if all of the corresponding eigenvalues have real part < 0, then the fixed point is stable. Otherwise, the fixed point is unstable. That is at least my preliminary understanding of stability.
How can I implement this in Matlab?
Should I write the differential equations symbolically (I have the Symbolic Math Toolbox), and then compute the Jacobian 50 times, and find eigenvalues for all 50 matrices using, say, a for loop? Or should I instead do this numerically? In the recent past, I wrote codes that started symbolically, and later converted to numerical codes, using, say, Matlab's EquationsToMatrix( ) function. Then, with numerical files, I created simulation codes to study a dynamical system. I wonder if I should be doing something similar -- writing both symbolic and numerical codes in Matlab -- in order to evaluate stability.
Sorry for my lack of understanding here.
I'm sort of trying to gauge the difficulty of this task, as well as trying to understand what would be considered best practice, before I proceed, so any help would be greatly appreciated.
Thanks in advance!
7 Kommentare
Sam Chak
am 11 Apr. 2025
Hi @Noob
If you mean that the values of the state variable have remained constant and relatively consistent up to 14 decimal places for a considerable period when no external "energy" is being added to the dynamical system, this may imply that the system response has reached the steady state. This set of steady-state values is mathematically referred to as the "Equilibrium Point."
Based on your description, you may be struggling to get the solver to reach the "theoretical Equilibrium Point," but are unable to do so. Consider the ordinary differential equation
as an example. The theoretical Equilibrium Point of the system is at
. However, no matter how large (and positive) the value you set for the parameter k, it will never truly reach
in finite time.



format long g
[t, x] = ode45(@(t, x) - 10*x, [0 100], 1);
x(end)
Akzeptierte Antwort
John D'Errico
am 3 Apr. 2025
Bearbeitet: John D'Errico
am 3 Apr. 2025
First, there is nothing wrong with a loop! You know how to evaluate stability for each case. Just write the loop. Could you do something more sophisticated? Possibly, but it would be more complex to understand and code. Remember that you need to be able to read the code you wrote next year, when you need to debug it. And when the loop will be just as efficient, don't freak out about not using loops. And what happens when some of the cases are marginal? (There always will be some cases like that.) You want to be able to look more carefully at them. Again, this is something you would be able to do far bettter in a loop.
Should you do exactly as you suggest? That will work. So do it. Never worry about whether some scheme is the best, most highly optimal scheme, unless the code you write becomes a computational problem. Never pre-optimize your code! Write it. Make it work. Remember that your programming time is worth far more than a few milliseconds of CPU time, even a few minutes or more.
So I would do as you say. The only thing I would plan on is using a numerical eigenvalue decomposition, thus the double version of eig, since we expect the symbolic eig will be much slower. Always watch for issues of course, but there should be nothing to fear.
There is nothing difficult in this, unless you try to make it more difficult than it needs to be.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!