Exercises - Basic
Important
Windows users should add the command VisualStudioSelect("20XX")
(2017, 2019, 2022 are supported) before running the optimal control problem
from Maple© (for instance before running the command launchSolver
). The
command VisualStudioSelect
will initialize the right compiling
environment in the Windows command prompt opened by Maple©.
DIDO problem 4.1
We consider the equations of motion of a single mass moving with linear motion with velocity \(v\) and subjected to an acceleration \(a\):
We impose some boundary conditions on the problem:
The goal of the optimal control problem is to minimise the following
target:
the final time \(t_f\) is given and equal to 1.
Cart pole swing-up
The system comprises a cart that travels along a horizontal track and a pendulum that hangs freely from the cart. There is a motor that drives the cart forward and backward along the track. It is possible to move the cart in such a way that the pendulum, initially hanging below the cart at rest, is swung up to a point of inverted balance above the cart. The objectiove is to compute the minimum-force trajectory to perform this so-called ‘swing-up’ maneuver.
The cart-pole is a second-order dynamical system with the following equations:
with the boundary conditions:
and the function to be minimised is:
subject to the following constraints:
The problem parameters are \(=2(m)\) and \(u_{\max} = 20 (N)\)
Try to solve the problem for different values of final time. Start with \(T = 2(s)\) and then reduce to \(T = 1.5(s)\) and \(T = 1.0(s)\). Analyse what happens.
Animation of the swing up manoeuver obtained