## The PhasePlane for a nonlinear system

In this brief note, I will tell you how to use XPP to analyze the behavior of a simple two-dimensional nonlinear dynamical system. Since nonlinearities make no difference for a numerical program, the methods used are essentially the same as in the linear turtorial . Nevertheless, I will briefly touch on the various commands. We will consider
x' = f(x,y)
y'= g(x,y)

where f(x,y) and g(x,y) are user specified functions. This file has 4 parameters labeled a,b,c,d which you can include in your right-hand sides. Here are some important commands:

• To quit click on (File) (Quit)
• To turn off the bell so your neighbor won't kill you, click on (File) (Bell off).
• To change the right-hand side functions f,g click on the (File) (Edit) (Functions) menu items and edit the two functions. Click (Ok) when you are done.
• To use the mouse to enter initial conditions click on (Initialconds) (Mouse) and then click in the phase-plane
• To manually enter initial data, either
• Click on (Initialconds) (New) and then type them in in the command window or,
• Find the initial condition window, (iconified and labeled ICs) and open it up. Then type in initial data in the window and click on OK. Then click on (Initialconds) (Go) in the main menu
• To find fixed points, click on (Sing pts) (Mouse) and click nearby where you think there is a fixed point. Answer the prompts (No) and (No) for now.
• To find nullclines, click on (Nullclines) (New)
• To draw direction fields, click on (Dir.field/flow) (Direct Field) and choose 10 or so as the grid.
• Click on (Restore) to redraw trajectories and click on (Nullcline) (Restore) to
• To print out click on (Graphics) (Postscript) and type in the name of a file. Then at the console prompt, print your file remembering the name.
• To permanently keep up to 26 trajectories click on (Graphics) (Freeze) (On freeze) and all trajectories that you compute will be stored in succession. When you want to delete all these for a new problem, click on (Graphics) (Freeze) (Remove all). To turn off the permanent freeze option, click on (Graphics) (Freeze) (Off freeze).
• To change the graphics window click on (Window) (Window) and enter the ranges for the axes.
• To change the view, i.e. the variables on the axes, click on (View axes) (2D) and set the parameters accordingly.

The first example is from the book and is

x' = x+exp(-y)
y'= -y

Draw the nullclines and the direction fields. What is the fixed point? (It is where the nullclines intersect.) What kind is it? The line y=0 is invariant; that is, any initial conditions that start with y=0 stay there. This is the unstable manifold for the fixed point. The stable manifold is not a straight line which is one instance where linear and nonlinear systems differ. XPP can usually compute stable and unstable manifolds for nonlinear systems (although not for this problem!) To compute manifolds, click on (Sing pts) (Mouse) and make a guess in the phaseplane. Then answer (yes) to the question about invariant manifolds. For this problem, it fails to compute the appropriate eigenvector, but it usually doesn't. NOTE If XPP fails to compute the stable manifold here is how to do it manually. Click on (nUmerics) (Dt) and change the timestep to its negative so that you can integrate backward in time. Now click (Esc) to return to the main menu. Compute two trajectories on either side of the saddle point, close to it. These will approximate the stable manifold pretty well. Make sure you return (Dt) to its positive value in the (nUmerics) menu. If XPP fails to compute the unstable manifold then just choose a few initial conditions near the fixed point and integrate forward in time.

The next example is a little bit more complicated. There are 4 fixed points and many interesting features of the phaseportrait. Here are the equations:

x' = y-y^3-ax
y'= x-y-xy

with a=0.25 as the parameter. Type them in making sure that you use the "*" symbol for multiplication. Set the window to be -5 < x < 5 and -5 < y < 5 by clicking on (Window) (Window). Verify that there are 4 fixed points. Find the values of the fixed points and determine their type (node,saddle, spiral, etc). (Answer No on any questions asked!) Since XPP has a bit of a problem finding the stable manifolds for this, lets do it manually. First we will compute the unstable manifolds by integrating forward. As you have found the origin (0,0) is a saddle as is the fixed point near (-4.05,1.33). Clear all the graphs you may have frozen and turn the automatic freeze on. Integrate with the following sets of initial conditions:

• x=.03, y=.01
• x=-.03,y=-.01
• x=-4.1, y=1.37
• x=-4,y=1.3
These approximations to the unstable manifolds of these saddle points. Note how the unstable manifolds of the origin tend to the two stable fixed points. One of the unstable manifolds of the other saddle point tends to the upper fixed point. Now lets approximate the stable manifolds. Since the stable manifold goes into the fixed point,starting near the fixed point and integrating forward in time will not show us much. Thus we will integrate backwards in time. Click on (nUmerics) (Dt) and change it from 0.05 to -0.05 and then click on (Esc) to return to the main menu. Choose the following sets of initial conditions:
• x=-.03, y=.01
• x=.03,y=-.01
• x=-4.2, y=1.32
• x=-3.9,y=1.32
to approximate the stable manifolds. When you are done you should have a picture something like this:
I have added the arrows to make it a little clearer. There are three types of behavior depending on the initial conditions:
• solutions go off to infinity (A)
• solutions tend to the stable node in the positive quadrant (B)
• solutions tend to the stable spiral in the lower left quadrant (C)
The phaseplane can be broken into 3 regions according to which of these behaviors occurs. The stable manifolds of the two saddle points determine which goes where. The stable manifold of the upper-left saddlepoint determines the region A. All initial conditions above this manifold will go off to infinity. The stable manifold of the saddle-point at the origin determines the boundaries of region B. Finally the remainder of the phase-plane belongs to region C and all initial conditions in this region go to the stable node.

The moral of this is that the stable manifolds of saddle points delineate the regions of behavior for many planar differential equations.

The domain of asymptotic stability for a fixed point or periodic solution is the region in the plane for which all solutions tend to that fixed point or periodic solution.

Thus the domain of asymptotic stability (DAS) for the node in the upper right quadrant is all of region C and the DAS for the lower left fixed point is region B.

If there are no saddle points or periodic solutions, often the domain of asymptotic stability for the stable fixed point is the whole plane!

### Exercises

In addition to the homework problems in the book, study the phase-plane of the following systems. In particular:
• Draw nullclines
• Find all fixed points and their stability
• Find any stable periodic solutions
• Determine the domain of asymptotic stability for the stable fixed points.
• Compute a few representative trajectories
( NOTE: For all of these a good window is -2 < x < 2 and -2 < y < 2. )
• dx/dt=x-x^3-y, dy/dt=x-a*y (choose a=0 and a=2)
• dx/dt=-x + tanh(4*x-y), dy/dt = -y + tanh(4*y-x)
• dx/dt=y, dy/dt=x*(1-x^2)+a*y-y^3 (choose a=-.25, a=.25, a=1)
( Hint An easy way to compute the stable manifolds for the saddle points is to go into the nUmerics menu and change Dt from 0.05 to -0.05 . DON'T FORGET TO CHANGE IT BACK WHEN YOU COMPUTE REPRESENTATIVE TRAJECTORIES !! )