Bryson Denham
This problem can be found here.
Packages that will be used
using NLOptControl
Differential Equations
de=[:(x2[j]),:(u1[j])]
Define and Configure the Problem:
n=define!(de;numStates=2,numControls=1,X0=[0.,1],XF=[0.,-1.],XL=[0.,NaN],XU=[1/9,NaN],CL=[NaN],CU=[NaN]);
configure!(n;(:finalTimeDV=>false),(:tf=>1.0));
Objective Function
obj=integrate!(n,n.r.u[:,1];C=0.5,(:variable=>:control),(:integrand=>:squared));
@NLobjective(n.mdl,Min,obj);
Optimize
optimize!(n);
Post Process
using PrettyPlots
allPlots(n)