## Section 2.6: Back to Basics

Section 2.6: Back to Basics

Back to Basics

I think that at this stage it’s useful, with some new context, to go back to basics and to cover the ideas of phase space and phase portraits again. In class, I’ve found that students find themselves feeling a bit confused by some ideas so it’s good to make sure that we are all on the same page now.

Phase Space

The phase space of a dynamical system is the space of all possible states that it can take. For instance, if you have a pendulum governed by the differential equation:

θ

g

l

You can ask what the possible states of the system are.

Well, you can have the pendulum be at a particular angle at some time, . This doesn’t give us all the information about the system. It will not tell you about how fast it was going, so you need to specify that. You don’t need to give the angular acceleration as that is given to you by the differential equation provided you have the angle. So you only need two pieces of information to tell you exactly the state that the system is in at any one moment: θ and .

t

θ

Given these, you can calculate any other derivatives you want. There is nothing more to know about the system. So, we can plot the space of all possible solutions, and it is given by:

In[]:=

ListPlot[{{0,0}},PlotStylePointSize[0],PlotRange{{-4,4},{-4,4}},AxesLabel{Style["θ",18],Style["θ'",18]},AspectRatio1]

Out[]=

This is a pretty boring plot, as it stands, but if you pick any spot in this two dimensional phase space corresponds to some configuration of the pendulum. Furthermore, given any one point, the differential equation will tell you where it is at any future moments in time. So you can plot trajectories in the phase space, and these look like:

In[]:=

xsol[t_,xv_]:=Module[{},sol=NDSolve[{x''[t]+Sin[x[t]]0,x[0]0,x'[0]xv},x,{t,0,100}][[1]];{x[t],x'[t]}/.sol];ParametricPlotEvaluate[xsol[t,#]&/@Range[0,2.5,0.25]],{t,0,100},PlotRange{{-3,10},{-3,3}},AspectRatio12,AxesLabelStyle["θ",16],Style"",16,ImageSize600

θ

Out[]=

There are different kinds of solutions plotted in the above: pendulum swings that just go back and forth (the closed loops) and swings which go over the top and keep swinging around.

So, the phase space itself is just the space of all possible states of the system, and within that, if you solve the differential equation you can calculate trajectories within the phase space. Note that a trajectory in phase space will correspond to a particular trajectory in the solution space. So for instance the largest yellow loop in the plot above would correspond to the following trajectory of θ:

So, the phase space itself is just the space of all possible states of the system, and within that, if you solve the differential equation you can calculate trajectories within the phase space. Note that a trajectory in phase space will correspond to a particular trajectory in the solution space. So for instance the largest yellow loop in the plot above would correspond to the following trajectory of θ:

In[]:=

Plot[Evaluate[xsol[t,1.75][[1]]],{t,0,20},AxesLabel{Style["t",16],Style["θ",16]}]

Out[]=

A single, autonomous second order differential equation will give you a two dimensional phase space. The differential equation can also be rewritten as two first order autonomous differential equations:

v

g

l

θ

Where is the angular velocity. This says that given the angle, and the velocity, the rate of change of the angle and velocity can be calculated directly.

v(t)

There is another way that we might end up with a two dimensional phase space, and that’s when the dynamical system is made up, from the start, of two systems which interact. For instance, a so-called predator-prey model (also called a Lotka-Volterra model). If you have a population of rabbits and foxes interacting (i.e. each reproducing, but the foxes eating the rabbits), this can be described by the following differential equations:

R

F

where the parameters α, β, γ, δ are factors related to the environment and they will generally be fixed for a given system. is the rabbit population and . The phase space again in this case is two-dimensional, made up now of the number of the number of rabbits and foxes:

R(t)

F(t)isthefoxpopulation

In[]:=

ListPlot[{{0,0}},PlotStylePointSize[0],PlotRange{{0,4},{0,4}},AxesLabel{Style["R",18],Style["F'",18]},AspectRatio1]

Out[]=

Pick any point in this space and it’s a particular population of rabbits and foxes. Use the differential equations and you can find out how this then evolves in time. For instance, if we set α, β, γ, δ all to be 1 for simplicity’s sake, and set (let’s say that these are in units of a thousand individuals), we get the following closed curve in phase space:

R(0)=2andF(0)=1

In[]:=

{r[t],f[t]}/.NDSolve[{r'[t]r[t]-r[t]f[t],f'[t]r[t]f[t]-f[t],r[0]2,f[0]1},{r,f},{t,0,10}]ParametricPlot[%,{t,0,10},PlotRange{{0,4},{0,4}},AxesLabel{Style["R",18],Style["F'",18]},AspectRatio1]

Out[]=

InterpolatingFunction[t],InterpolatingFunction[t]

Out[]=

In the space of trajectories of rabbits and foxes separately, this looks like:

In[]:=

{r[t],f[t]}/.NDSolve[{r'[t]r[t]-r[t]f[t],f'[t]r[t]f[t]-f[t],r[0]2,f[0]1},{r,f},{t,0,10}]Plot[Evaluate[%],{t,0,10},PlotStyle{Red,Blue},PlotRange{0,3},AxesLabel{Style["t",18],Style["R (red) & F (blue)",18]}]

Phase portraits

Phase portraits give us more information than simply plotting the phase space. They generally give us the behaviour of all possible solutions. We have only been plotting phase portraits of one dimensional systems, not two dimensional systems as above.

For a one dimensional system like:

It is possible to plot a phase portrait for a second order equation and it will include a two dimensional surface in a three dimensional space, but we are not going to do that in this course.