I have an exercise to linearize the following nonlinear system

$$\dot{x} = A - B x - x y^2$$ $$\dot{y} = A\cdot (x y^2 - y)$$

I tried it with

osz = NonlinearStateSpaceModel[{{A - B*x - x*y^2, A*(x*y^2 - y)}, {x, y}}, {x, y}, {A, B}]

for the input of this system.

How can I linearize this system now?

StateTransformationLinearize[osz] doesnt obviously work, because its not an affine system...

  • 1
    $\begingroup$ I think you should be able to just wrap your NonlinearStateSpaceModel in StateSpaceModel (which is always linear) and it will convert automatically. Or you just define the non-linear equations inside of StateSpaceModel. Look in the documentation of StateSpaceModel under "Scope" > "Basic Uses" for an example. $\endgroup$ Feb 28, 2017 at 16:38
  • $\begingroup$ I'm a bit unclear on what you want to do. Is there a particular (x,y) point that you want to linearize around? Is the goal some kind of stability analysis? Of an equilibrium or of a limit cycle? $\endgroup$
    – Chris K
    Feb 28, 2017 at 16:58
  • $\begingroup$ @SjoerdSmit: I looked it up, but its very difficult to transform this system into a StateSpaceModel. There isnt a specific example which has something to do with my nonlinear system... @ChrisK: The exercise has three parts: a) find the stationary points b) linearize the system c) find a lyapunov-function I think you have to linearize this system with the stationary points, or at least with one of the two points. $\endgroup$
    – Manu
    Feb 28, 2017 at 17:55

2 Answers 2


a) To find equilibria, use Solve:

eq = Solve[{A - B*x - x*y^2, A*(x*y^2 - y)} == {0, 0}, {x, y}]

Mathematica graphics

b) Linearizing around the point $(\hat x,\hat y)$ means making a new, linear system $$\dot{\vec{z}}=J\vec{z}$$ where $\vec{z}=(x-\hat x,y-\hat y)$ and $J$ is the Jacobian matrix $$J=\begin{bmatrix}d\dot x\over dx & d\dot x\over dy \\ d\dot y\over dx & d\dot y\over dy\end{bmatrix}$$ evaluated at $(\hat x,\hat y)$.

It's easy to calculate the Jacobian:

j = D[{A - B*x - x*y^2, A*(x*y^2 - y)}, {{x, y}}]
(* {{-B - y^2, -2 x y}, {A y^2, A (-1 + 2 x y)}} *)

The only thing left is to evaluate $J$ at the different equilibria:

j /. eq[[1]]
(* {{-B, 0}, {0, -A}} *)

j /. eq[[2]]

Mathematica graphics

j /. eq[[3]]

Mathematica graphics

To check the stability of the equilibria, calculate the eigenvalues of the Jacobian. If all eigenvalues have negative real part, then the equilibrium is stable. j/.eq[[1]] is easy to understand: the eigenvalues are on the diagonal. j/.eq[[2]] and j/.eq[[3]] are uglier. For those you might want to try the Routh-Hurwitz stability criteria: stable if $Tr(J)<0$ and $Det(J)>0$.

Sorry, I don't know about c).


Strogatz SH. 2014. Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering.

Ellner SP, Guckenheimer J. 2006. Dynamic Models in Biology.

"Linear Stability Analysis" at Wolfram MathWorld

  • 1
    $\begingroup$ Thank you for this answer. Now I can send my students over to this very answer when I have to show them how to use Mathematica for simple stability analysis. btw, the graphics you have included, do not show. Best wishes. $\endgroup$
    – dearN
    Mar 1, 2017 at 13:50
  • 1
    $\begingroup$ Thank you very much for your answer :-) I have the same points in a) (I solved it with wolfram alpha) and the way how to solve b) is new for me, but its probably these solution which my professor wants to have from me. Can you tell me a source for the definition in b) please? $\endgroup$
    – Manu
    Mar 1, 2017 at 14:11
  • 2
    $\begingroup$ @Manu I added a few references off the top of my head, but you can find this in any book on nonlinear differential equations $\endgroup$
    – Chris K
    Mar 1, 2017 at 14:31

Your nonlinear system is a good example for showing Hopf and Bogdanov-Takens bifurcations. With the following changes


we obtain the equilibria:

(*{{x -> 1/A0, y -> A0}, {x -> 1/y0, y -> y0}, {x -> (A0 + y0)/(A0 y0), y -> 0}}*)

If we analyze the linearization at the first non-trivial equilibrium


we find that there is a Hopf bifurcation when $A_{0} = 1$ and $0<y_{0} <1$. Furthermore, if $A_{0} = 1$ and $y_{0}=1$, the two non-trivial equilibria collide at (1,1) and a Bogdanov-Takens bifurcation occurs.

The local stability analysis is easy with these changes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.