Beam Problem

Beam Problem

This problem can be found here.

Packages that will be used

using NLOptControl

Define and Configure the Problem:

n=define(numStates=2,numControls=1,XL=[-0.05,-1.0],XU=[-0.05,1.0]);

Differential Equations

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

Configure the Problem

configure!(n;(:integrationScheme=>:trapezoidal),(:finalTimeDV=>false),(:tf=>1.0));

Objective Function

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

Optimize

optimize!(n);

Post Process

allPlots(n)
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00 time (s) x1 max min mpc 0.00 0.25 0.50 0.75 1.00 -1.0 -0.5 0.0 0.5 1.0 time (s) x2 max min mpc 0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00 time (s) u1 mpc