function xplp=fh(t,x) %%%%%%%%%%%%%%%%%%%%%%%%%%%% % % function xplp=fh(t,x) % Right hand side to the differential equations governing % the optimal orbit transfer in the omputer exercise for the % course Optimal Control 5B1872 % % x = x(1:3) % lambda = x(4:6) global c1 c2 c3 x1=x(1); x2=x(2); x3=x(3); l1=x(4); %lambda1 l2=x(5); %lambda2 l3=x(6); %lambda3 global c1 c2 c3 %constants % Control - thrust angle % Antiparallell to (l2, c3*l3) nrm = sqrt(l2^2+(c3*l3)^2); if nrm ~= 0 sinu=-l2/nrm; cosu=-c3*l3/nrm; else sinu = 0; cosu = 1; end % Fuel consumption -> Mass decreasing with time mt=(1/c1-c2*c3*t); % xplp: xDotLambdaDot vector % WRITE STUFF BELOW: xplp=[(?) ; % x1dot (?) ; % x2dot (?) ; % x3dot (?) ; % l1dot (?) ; % l2dot (?)]; % l3dot