Code covered by the BSD License  

Highlights from
Numerical Computing with Simulink, Vol. 1

image thumbnail
from Numerical Computing with Simulink, Vol. 1 by Richard Gran
This sequel to Numerical Computing with MATLAB explores the mathematics of simulation.

TimeOptimal_phaseplot.m
%  Plot the phase plane trajectories of the varous switch curves.
%    Jets on and Coast swtich curves for time optimal control to a dead
%    zone at the origin are computed.  The actual LM switch curves were the
%    combination of time optimal and fuel optimal switch curves.

%    The data is representative of the pitch and roll axis inertias.
figure(1)
alph = 1100/20000;

thd = -0.25:.001:0;
th1 = thd.^2/(2*alph);
thd = 0.001:.001:0.25;
th2 = thd.^2/(-2*alph);
thd = -0.25:.001:0.25;

th = [th1-5*pi/180 th2+5*pi/180];
plot(th,thd)
grid
hold on
th = [th1+5*pi/180 th2-5*pi/180];
plot(th,thd)
grid

Contact us at files@mathworks.com