No BSD License  

Highlights from
GPOPS

from GPOPS by Camila Francolin
Solves multiple phase optimal control problems.

hyperSensitiveCost(sol,iphase);
function [Mayer,Lagrange] = hyperSensitiveCost(sol,iphase);

t0 = sol{1,1};
x0 = sol{1,2};
tf = sol{1,3};
xf = sol{1,4};
t  = sol{2,1};
x  = sol{2,2};
u  = sol{2,3};
p  = sol{2,4};

Mayer = zeros(size(t0));
Lagrange = 0.5*(x.^2+u.^2);

Contact us at files@mathworks.com