load mars.dat % t=mars(:,1); r=mars(:,2); w=mars(:,3); v=mars(:,4); m=mars(:,5); lr=mars(:,6); lw=mars(:,7); lv=mars(:,8); lm=mars(:,9); Phi=mars(:,11); Swit=mars(:,12); Beta=mars(:,13); Psi=mars(:,14); % load mars.krs X=mars(:,1); Y=mars(:,2); % clf subplot(221) plot(t,r,'b') axis([0 1 1 1.6]) xlabel('distance r(t/t_f)','FontSize',13) % subplot(222) plot(t,w,'b') axis([0 1 0 0.2]) xlabel('velocity w(t/t_f)','FontSize',13) % subplot(223) plot(t,v,'b') axis([0 1 0.7 1.1]) xlabel('velocity v(t/t_f)','FontSize',13) % subplot(224) plot(t,m,'b') axis([0 1 0.9 1]) xlabel('mass m(t/t_f)','FontSize',13) % print -depsc marsa % % pause figure % clf subplot(221) plot(t,lr,'b') axis([0 1 -0.5 -0.25]) xlabel('Adjoint \lambda_r(t/t_f)','FontSize',13) % subplot(222) plot(t,lw,'b') axis([0 1 -0.06 0.02]) xlabel('Adjoint \lambda_w(t/t_f)','FontSize',13) % subplot(223) plot(t,lv,'b') axis([0 1 -0.485 -0.47]) xlabel('Adjoint \lambda_v(t/t_f)','FontSize',13) % subplot(224) plot(t,lm,'b') axis([0 1 -1 -0.9]) xlabel('Adjoint \lambda_m(t/t_f)','FontSize',13) % print -depsc marsb % % pause figure % clf subplot(221) plot(t,Beta) axis([0 1 -0.01 0.08]) xlabel('Thrust \beta(t/t_f)','FontSize',13) % subplot(222) plot(t,Psi) axis([0 1 -0.02 0.11]) xlabel('Thrust Angle \psi(t/t_f)','FontSize',13) % subplot(223) plot(t,Swit) axis([0 1 -0.003 0.015]) xlabel('Switching Function S(t/t_f)','FontSize',13) % print -depsc marsc % pause figure % clf t=[0.0:0.01:6.3]'; x=cos(t); y=sin(t); plot(x,y,'b') axis([-1.6 1.6 -1.6 1.6]) axis('square') xlabel('Earth-Mars Trajectory','FontSize',13) hold x=1.525*x; y=1.525*y; plot(x,y,'b') x=r.*cos(Phi); y=r.*sin(Phi); plot(x,y,'r') plot(0,0,'ro','MarkerSize',10) plot(X,Y,'ro','MarkerSize',8) % x=[0 1]; y=[0 0]; plot(x,y,'b--') le=length(X); x=[0,X(le-1)]; y=[0,Y(le-1)]; plot(x,y,'b--') % print -depsc marsd %