# Phase Portrait of a Non-Linear System

#### Phase Portrait

A phase portrait is a geometric representation of the trajectories of a dynamic system in the phase plane. Every curve or point represents a set of initial conditions.

Phase portraits are an invaluable tool in studying nonlinear systems. They consist of a plot of typical trajectories in the state space. This reveals information such as whether an attractor, a repellor or limit cycle is present for the chosen parameter value.

A phase portrait graph of a dynamical system depicts the system’s trajectories (with arrows) and stable steady states (with dots) and unstable steady states (with circles) in a state space. The axes are of state variables.

Principles of Trajectory Sketching:

1.  Trajectories follow the direction field. The velocity vector for a solution at a point (x,y) in the plane is f(x,y), g(x,y). The direction of the trajectory is the direction of this vector.

2.  The curves f(x,y)=0 and g(x,y)=0 are the isoclines on which the direction of a trajectory is vertical and horizontal respectively. These isoclines divide up the plane into regions. In each region, the signs of x’ and y’ don’t change, so e.g. if both are positive the direction is always up and to the right. Typically as you cross an isocline, one component of the velocity changes sign. Thus by knowing the direction at one point you can determine the directions in all the regions.

3.  An isocline x’ = 0 (or part of it) that is a vertical line is a trajectory (or maybe several of them). Similarly, an isocline y’ = 0 (or part of it) that is a horizontal line is a trajectory (or several).

4.  Trajectories don’t meet or stop, except that in the limit as t tends to infinity or negative infinity, they can approach an equilibrium point.

5.  The equilibrium points (also known as critical or stationary points) are the points where both f(x,y) = 0 and g(x,y) = 0. Thus they are at intersections of those isoclines.

6.  The behaviour near the equilibrium points is important. The trajectories near an equilibrium point are approximated very well by those of the linearization of the system at that point, and the critical point can be classified using that linearization (with two exceptions which we will see).

Follow the given steps to draw a phase trajectory of a nonlinear system in MATLAB.Open New << Script in MATLAB

1.  Open New << Script in MATLAB.

2.  Paste the following code in the script.

```function phasemod()
syms u w;
p = (-0.3:0.01:0.3)';
o =(-0.3:0.01:0.3)';
IC =;
%IC =[0 0;0 1;1 1;0 2;0 3];
hold on
%Plotting the Phase Portrait
for ii = 1:length(IC(:,1))
[Y,X] = ode45(@EOM,[0 5],IC(ii,:));
hold on
quiver(X(:,1),X(:,2),a,b);
plot(X(:,1),X(:,2));
end
xlabel('u')
ylabel('w')
grid
end
% Defining the state variables of the nonlinear system.
function dX = EOM(t,x)
dX = zeros(2,1);
u = x(1);
w = x(2);
x1dot =w;
x2dot = -u +((1/10)*w)-w^2-((10/3)*(power(w,3)));
dX =[x1dot ;x2dot];
end
```

3. Simulate the script. The output observed is as follows:

#### Conclusion

Phase Portrait of a non linear system was plotted in MATLAB.

##### Shivani Singh

A final year engineering student from Bharati Vidyapeeth's College of Engineering, New Delhi with great zeal and passion for writing and technology. I have great love for food, nature, reading and am a true Delhiite at heart !

### Recommended Posts

##### Counters using conditionally executed subsystems | Simulink Tutorial

16 Feb 2018 - Simulink, Tutorial

##### Regulating drum boiler pressure

16 Feb 2018 - Simulink, Tutorial