Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TOOLKIT
Boris Houska, Moritz Diehl
subject to:
0 = r(y(0), y(T ), p)
ACADO Toolkit:
• Automatic Control And Dynamic Optimization
• great variety of numerical optimization algorithms
• open framework for users and developers
ACADO Toolkit:
• Automatic Control And Dynamic Optimization
• great variety of numerical optimization algorithms
• open framework for users and developers
Key Properties of ACADO Toolkit
• Open Source (LGPL) www.acadotoolkit.org
• user interfaces close to mathematical syntax
• Code extensibility: use C++ capabilities
• Self-containedness: only need C++ compiler
Mathematical Formulation:
minimize T
s(·),v(·),m(·),u(·),T
subject to
ṡ(t) = v(t)
u(t)−0.2 v(t)2
v̇(t) = m(t)
2
ṁ(t) = −0.01 u(t)
s(0) = 0 s(T ) = 10
v(0) = 0 v(T ) = 0
m(0) = 1
DifferentialState s,v,m;
Mathematical Formulation:
Control u;
Parameter T;
minimize T DifferentialEquation f( 0.0, T );
s(·),v(·),m(·),u(·),T OCP ocp( 0.0, T );
ocp.minimizeMayerTerm( T );
subject to
f « dot(s) == v;
ṡ(t) = v(t) f « dot(v) == (u-0.2*v*v)/m;
u(t)−0.2 v(t)2 f « dot(m) == -0.01*u*u;
v̇(t) = m(t) ocp.subjectTo( f );
2
ṁ(t) = −0.01 u(t)
ocp.subjectTo( AT_START, s == 0.0 );
ocp.subjectTo( AT_START, v == 0.0 );
s(0) = 0 s(T ) = 10 ocp.subjectTo( AT_START, m == 1.0 );
ocp.subjectTo( AT_END , s == 10.0 );
v(0) = 0 v(T ) = 0 ocp.subjectTo( AT_END , v == 0.0 );
m(0) = 1
ocp.subjectTo( -0.1 <= v <= 1.7 );
−0.1 ≤ v(t) ≤ 1.7 ocp.subjectTo( -1.1 <= u <= 1.1 );
ocp.subjectTo( 5.0 <= T <= 15.0 );
−1.1 ≤ u(t) ≤ 1.1 OptimizationAlgorithm algorithm(ocp);
algorithm.solve();
5 ≤ T ≤ 15
Jojo Model
• Position/velocity of the hand: x, v
• Position/velocity of the hand: y , w
• Control the acceleration u of the hand
Jojo Model
• Position/velocity of the hand: x, v
• Position/velocity of the hand: y , w
• Control the acceleration u of the hand
0 1 0 1
ẋ(t) v(t)
B C B C
B v̇(t) C B u(t) C
C = B
B C B C
B C
B ẏ(t) C B w(t) C
@ A @ A
ẇ(t) −µg + ku(t) + a(w(t) − v(t))
Our aim:
R t2
• Minimize the control action Φ := 0 u2 (t)dt
• Satisfy all model equations and constraints:
x(0) = y(0) = 0 m v(0) = w(0) = 0 ms
x(t1 ) − y(t1 ) = L
x(t2 ) = y(t2 ) = −0.1 m v(t2 ) = w(t2 ) = 0 ms
subject to:
0 = r(x(t1 ), . . . , x(tn+1 ), p)
for all i ∈ I, k ∈ K
RT
minimize 0
L(τ, y(τ ), u(τ ), p) dτ + M (y(T ), p)
y(·),u(·),p,T
subject to:
0 = r(y(0), y(T ), p)
Highlights of ACADO
• Self contained C++ code
• Automatic differentiation, integration routines
• Single- and multiple shooting
• SQP methods (exact Hessian, GN, BFGS,...)
• Easy setup of optimal control problems
Highlights of ACADO
• Self contained C++ code
• Automatic differentiation, integration routines
• Single- and multiple shooting
• SQP methods (exact Hessian, GN, BFGS,...)
• Easy setup of optimal control problems
In Exercises:
• Simulation, Optimal Control, MPC, ...
• Please install from www.acadotoolkit.org.