% % Problem of Goddard: % load goddard.dat t=goddard(:,1); h=goddard(:,2); v=goddard(:,3); m=goddard(:,4); lh=goddard(:,6); lv=goddard(:,7); lm=goddard(:,8); Swit=goddard(:,10); Swit1=goddard(:,11); u=goddard(:,9); % clf subplot(2,2,1) plot(t,h,'b') xlabel('t/tf','FontSize',14) ylabel('altitude h(t)','FontSize',14) % subplot(2,2,2) plot(t,v,'b') xlabel('t/tf','FontSize',14) ylabel('velocity v(t)','FontSize',14) % subplot(2,2,3) plot(t,m,'b') xlabel('t/tf','FontSize',14) ylabel('mass m(t)','FontSize',14) % subplot(2,2,4) plot(t,lh,'b') xlabel('t/tf','FontSize',14) ylabel('\lambda_h','FontSize',14) % print -depsc goddarda pause % figure clf subplot(2,2,1) plot(t,lv,'b') axis([0 1 -250 0]) xlabel('t/tf','FontSize',14) ylabel('\lambda_v','FontSize',14) % subplot(2,2,2) plot(t,u,'b') axis([0 1 -0.01 0.05]) xlabel('t/tf','FontSize',14) ylabel('thrust u(t)','FontSize',14) % subplot(2,2,3) plot(t,lm,'b') xlabel('t/tf','FontSize',14) ylabel('\lambda_m','FontSize',14) % subplot(2,2,4) plot(t,Swit,'b') hold plot([0 1],[0 0],':') axis([0 1 -50 500]) xlabel('t/tf','FontSize',14) ylabel('switching function S(t)','FontSize',14) % print -depsc goddardb pause % clear all pause %************************************************************* return