Phase plane plot

by

 

25 Jan 2007 (Updated )

plots the phase plane plot of a second order system

phase_plane.m
%
%
%  Plots phase plane of a second order system
%  the plot can be changed for different values of ZETA & wn

global zeta wn
prompt = {'ENTER VALUE OF ZETA',};
dlg_title = 'PHASE PLANE PLOT';
num_lines= 1;
def     = {'0.5'};
input1  = inputdlg(prompt,dlg_title,num_lines,def);
J=cell2mat(input1);
zeta=eval(J);
prompt = {'ENTER VALUE OF NATURAL FREQUENCY "w"',};
dlg_title = 'PHASE PLANE PLOT';
num_lines= 1;
def     = {'1'};
input2  = inputdlg(prompt,dlg_title,num_lines,def);
W=cell2mat(input2);
wn=eval(W);
[t,y]=ode45('eqn',[-5 5],[1;1]);
plot(y(:,1),y(:,2))
grid

Contact us