Beam Problem
An optimal control version of the Singly Supported NonLinear BEAM problem.
The energy of a beam of length 1 compressed by a force P is to be minimized.
The control variable is the derivative of the deflection angle.
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)