How do you make phase plots in MATLAB for nonlinear systems? Can we see any MATLAB code used to make graphs in the lecture notes?

Tim Chung, 21 Oct 02

Plotting phase portraits for nonlinear systems is very much the same as for linear systems. You still can use "phaseplot.m" and just need to specify the nonlinear system in the function file, as done for the linear case. For example, to get the plot of the nonlinear damped pendulum shown in class (see figure below),

Nonlinear Pendulum

one simply needs to use the following function file (Courtesy of RMM):

function dxdt=damppend(t,x)

g=1; l=1; b = 0.5;

dxdt = [3*x(2); -g*l*sin(x(1)) - b*x(2)];