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

using PrettyPlots
allPlots(n)