332:505 Control Theory I

Phase Plane Analysis Example

Let's investigate the behavior of the nonlinear second order system described by

x'' + 0.5 x' + 2 x + x^2 = 0

which was mentioned in the first lecture. You will need to copy two files to your computer. php_example.m interactively draws phase portraits for the system whose derivative is given by php_deriv.m. After starting Matlab, you type `php_example' at the prompt to start executing the script. Following the instructions that appear in the matlab window, you use the mouse to enter an initial condition. Matlab then draws the trajectory starting at that initial condition.

In order to draw the trajectories of the above system, we must write it in state space form by letting x1 := x and x2 := x'. Then we obtain

x1' = x2 = f1(x1,x2)
x2' = -0.5 x2 - 2 x1 - x1^2 = f2(x1,x2)

These are the derivatives that are specified in the file `php_deriv.m'.

Let's predict what the phase portrait will look like. At an equilibrium, the system must satisfy x1' = x2' = 0, so solving the above equation for x1', we see that at an equilibrium, x2 must be zero. From the second equation we then have 0 = -2 x1 - x1^2, which is zero when x1 is either zero or -2. Accordingly the system has two equilibria: (0,0) and (-2,0).

When you run the Matlab script, the first trajectory is drawn for you and spirals inward toward the equilibrium (0,0). If you choose some initial conditions in the upper left and lower left quadrants, you can begin to see the behavior of the trajectories in the neighborhood of the other equilibrium (-2,0). Notice that these trajectories approach (-2,0) and then continue away from it. Apparently this equilibrium is of a different type than the one at the origin. In fact, we can see that the behavior of the trajectories near the origin resembles that of a linear second order system with both roots having negative real part, namely a stable focus. Near the equilibrium at (-2,0) we see that the behavior of the trajectories resembles that of a linear second order system with one positive and one negative root, namely a saddle point. We'll discuss this further when we get to Chapter 4 of the textbook.

Before ending the exercise, try choosing a couple of initial conditions and predicting the direction that the trajectory will go. Remember that the slope of the trajectory passing through the point (x1*,x2*) is given at (x1*,x2*) by dx2/dx1 = f2(x1*,x2*)/f1(x1*,x2*), so if we choose the initial condition (x1*,x2*)=(1,5) we expect to see the initial slope of the trajectory be f2(1,5)/f1(1,5) = (-0.5(5) - 2(1) - 1^2)/5 = -5.5/5 = -1.1 .

If you'd like to see how changing the system description changes the behavior of the trajectories, you can edit the script `php_deriv.m'. For instance, change the last term of f2(x1,x2) from -x1^2 to x1^2 and see what happens. You can predict what will happen by finding the equilibria of the new system just as we did above, and calculating some isoclines as above.

The Matlab scripts used in this example are adapted from those provided by Zak on his web page.

Page last modified 07/18/07.