Bryson Denham

Bryson Denham

This problem can be found here.

Packages that will be used

using NLOptControl

Define the Problem:

n=define(numStates=2,numControls=1,X0=[0.,1],XF=[0.,-1.],XL=[0.,NaN],XU=[1/9,NaN]);

Differential Equations

dx=[:(x2[j]),:(u1[j])]
dynamics!(n,dx)

Configure the Problem

configure!(n;(:Nck=>[100]),(:finalTimeDV=>true));

Objective Function

obj=integrate!(n,:(0.5*u1[j]^2));
@NLobjective(n.ocp.mdl,Min,obj);

Optimize

optimize!(n);

Post Process

allPlots(n)
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.000 0.025 0.050 0.075 0.100 time (s) x1 max min mpc 0.0 0.1 0.2 0.3 0.4 0.5 0.6 -1.0 -0.5 0.0 0.5 1.0 time (s) x2 mpc 0.0 0.1 0.2 0.3 0.4 0.5 0.6 -6 -5 -4 -3 -2 -1 0 time (s) u1 mpc