




































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





































































Calculus of Variations: in CoV one seeks a function f (x∗) that minimizes (or maximizes) an integral cost (functional) subject to different constraints. The focus is on continuous function spaces and smooth variations. It represents a special case of the Optimal Control Problem, in which the dynamics is simplified.
F^ ˜ [x] =
Z (^) t 2
t 1
f (x(t), x˙(t), t) + λ(t)T^ g(x(t), x˙(t), t)
dt (2)
where: g(x(t), x˙(t), t) : Rn^ × Rn^ × [ti, tf ] 7 → Rm^ (m ≤ n)
We seek optimum extremal x∗(t) : [ti, tf ] 7 → Rn^ and Lagrange multipliers λ∗(t) : [ti, tf ] 7 → Rm.
Optimal Control: it expands the framework by treating both state evolution x and control inputs u as independent variables, as control functions directly influence system dynamics. It enforces dynamical constraints through costate variables (Lagrange multipliers), leading to a Hamiltonian formulation that unifies dynamics and cost.
J^ ˜[u] = ϕ(x(tf ), tf ) +
Z (^) tf
ti
n L(x(t), u(t), t) + λT^ (t)[f (x(t), u(t), t) − x˙(t)]
o dt (3)
with: g(x(t), u(t), x˙(t), t) = f (x(t), u(t), t) − x˙(t) = 0
The unknown is u(t) : [ti, tf ] 7 → Rm^ and must be found in a continuous and piecewise differentiable space to ensure that the control action allows for consistent state evolution over time without introducing abrupt discontinuities. Piecewise differentiability also accommodates practical scenarios where control values may change behavior abruptly (for example Bang-Bang controls). ϕ(x(tf ), tf ) is the terminal cost and takes in account penalties to quantify how far you ended up from your target, while R (^) tf ti
n L(x(t), u(t), t) + λT^ (t)[f (x(t), u(t), t) − x˙(t)]
o dt is called integral cost and takes in account penalties
throughout all the path (i.e. loss of efficiency).
The general formulation of a functional for an optimum control problem, including the Hamiltonian H, is the following one:
J[u] = ϕ(x(tf ), tf ) +
Z (^) tf
ti
Lagrangian L z }| { L(x(t), u(t), t) +λ⊤(t)[f (x(t), u(t), t) | {z } Hamiltonian H
− x˙(t)]dt
Given this, we have that λ⊤f is scalar, therefore H(x, u, λ, t) is itself generally a time-dependent scalar function. But there are exceptions:
The Lagrangian is typically the integrand of the cost functional. It represents the instantaneous cost or performance measure at each point in time. As said, the Lagrangian is scalar and varies depending on the problem formulation. Moreover, Lagrangian is related to an "energetical method" of optimality: it defines the best path in case of a free system (best theoretical scenario) and doesn’t take in account all the constraints and the physics of the real world.
The Hamiltonian combines the Lagrangian and the system dynamics. It incorporates the adjoint variables (costate variables) λ, which are introduced to enforce the system’s dynamics as constraints. The Hamiltonian is also scalar. For this reason, the Hamiltonian can define the best path accounting the physics of the external environment (best bounded scenario, related to a "geometrical approach").
Hypotheses:
Z (^) t 2
t 1
f (x(t), x˙(t), t) dt (4)
∂f ∂x
d dt
∂f ∂ x˙
Thesis: The solution function x*(t) is an extremal of functional F[x] with boundaries on x(t 1 ) and x(t 2 ). (hence, it minimizes the functional).
PROOF:
x(t) = x∗(t) + α ξ(t) (6)
The cost functional evaluated along x is:
F [x] = F [x 0 + α ξ] (7)
If x 0 and ξ are fixed: F [x] = F [x∗^ + αξ] ≡ g(α) (8)
g(α) = g(0) +
dg dα (^0)
α + o(α) (9)
F [x(t)∗^ + αξ(t)] =
Z (^) t 2
t 1
f (x(t)∗^ + αξ(t), x˙(t)∗^ + α ξ˙(t), t) dt (10)
d dα
F [x(t)∗^ + αξ(t)] 0
d dα
Z (^) t 2
t 1
f (x∗(t) + αξ(t), x˙∗(t) + α ξ˙(t), t) dt 0
The 2 nd^ order NECESSARY condition holds:
δ^2 Fx∗^ [ξ] =
d^2 g dα^2
To satisfy it, the matrix defining the quadratic term in ξ˙ must be positive semi-definite at each time instant (Legendre Condition):
P(x∗(t), x˙∗(t), t) =
∂^2 f ∂ x˙^2
(x∗(t), x˙∗(t), t) = f (^) x˙ x˙ ⪰ 0 (24)
NOTICE: Legendre condition is only a necessary local condition for optimality; it can becomes sufficient only if the problem is convex. If convex:
Most of the problems can be simply solved with necessary conditions as long as the knowledge of the problem is enough to guarantee optimality (I must know the physics of the problem).
NOTICE 2: Using the 1st and 2nd necessary conditions, we perform a second-order Taylor expansion around the point of interest. This expansion captures only the local behavior of the function—focusing on its imme- diate slope and curvature—while neglecting higher-order terms that describe its overall (global) structure. As a result, these conditions identify candidate points that are locally optimal. However, to confirm that a candidate is truly the global optimum, additional sufficient conditions must also be satisfied. Necessary conditions identify local candidate points; they must be satisfied at any extremum (local or global) but don’t by themselves ensure global optimality. Sufficient conditions (especially when additional structure like convexity is present) guarantee that the candidate is indeed optimal on a global scale.
Is a typical case of Optimal control problem. Generic form of cost function (OC problem with constraints):
J[u] = ϕ(x(t 1 ), t 1 ) +
Z (^) t 1
t 0
L(x, u, t) + λT^ (t) · [f (x, u, t) − x˙(t)]
dt (25)
= ϕ(x(t 1 ), t 1 ) +
Z (^) t 1
t 0
H(x, u, t, λ) dt −
Z (^) t 1
t 0
λT^ (t) ˙x(t) dt (26)
The cost functional in this case holds (with free-end time):
J[u] =
Z (^) t 1
t 0
1 dt = t 1 − t 0 (27)
We exploit the Pontryagin Maximum Principle and, for example, in a simple system which the control action on acceleration is bounded (− 1 ≤ u ≤ 1):
{λ∗ 1 (t)x∗ 2 (t) + λ∗ 2 (t)u + 1} (28)
Since we want to minimize the terms linked to the control action: u∗(t) = arg min |u|≤ 1
{λ∗ 1 (t)x∗ 2 (t) + λ∗ 2 (t)u + 1} = arg min |u|≤ 1
{λ∗ 2 (t)u} (29)
u∗(t) =
1 if λ∗ 2 (t) < 0 − 1 if λ∗ 2 (t) > 0 ? if λ∗ 2 (t) = 0 (hp. u∗(t) = 1)
=⇒ u∗(t) = −sign(λ∗ 2 (t)) (30)
In time–optimal problems, the control u∗(t) is typically “Bang-Bang,” meaning it alternates between its maximum and minimum allowable values. The switching structure is determined by the sign of the switching function λ∗ 2 (t).
Assumption: the optimal control input u(t) we’re searching for will lead to generate the optimal trajectory x(t), which is the solution of x˙(t) = f (x(t), u(t), t).
x ˙∗(t) + α ξ˙(t) = f (x∗(t) + αξ(t), u∗(t) + αω(t), t) (31)
f (x∗^ + αξ, u∗^ + αω, t) = f (x∗, u∗, t) +
∂f (x∗, u∗, t) ∂x ξ |{z} ( d dαx )
∂f (x∗, u∗, t) ∂u |{z}ω ( d dαu )
α (32)
f^ (·) +^ α^ ξ˙(t) = ^ f^ (x
∗, u∗, t) +
∂f (x∗, u∗, t) ∂x
ξ +
∂f (x∗, u∗, t) ∂u
ω
α =⇒ (33)
ξ^ ˙(t) = ∂f^ (x
∗(t), u∗(t), t) ∂x
ξ(t) + ∂f (x∗(t), u∗(t), t) ∂u
ω(t) (34)
ξ(t 0 ) = 0 := initial condition due to x(t 0 ) = x∗(t 0 ) = x 0 (no perturb.)
NOTICE: This differential eq. describes the evolution of linearized system around the optimal trajectory. The Jacobians computed at optimal trajectory are time-varying matrices.
( ξ˙(t) = [A(t)]∗ξ(t) + [B(t)]∗ω(t) ξ(t 0 ) = 0
knowing ω(t), this system allows to deter- mine ξ(t) and so x(t) (it says where pertur- bation is going on).
δJu∗ [ω] =
d dα (^0)
J[u∗^ + αω] (36)
u∗^ affects x∗, so we have also x = x∗^ + αξ:
J[u∗^ + αω] = ϕ(x(t 1 )∗^ + αξ(t 1 ), t 1 ) | {z } ○^1
Z (^) t 1
t 0
H(x∗^ + αξ, u∗^ + αω, λ(t), t) | {z } ○^2
dt+
Z (^) t 1
t 0
λ^ ˙T^ (t)[x∗^ + αξ] | {z } ○^3
dt + λT^ (t 0 )[x∗(t 0 ) + αξ(t 0 )] − λT^ (t 1 )[x∗(t 1 ) + αξ(t 1 )] | {z } ○^4
Carrying out derivatives term by term:
d dα (^) ∗
ϕ(x(t 1 )∗^ + αξ(t 1 ), t 1 ) = ∂ϕ(x∗(t 1 ) + αξ(t 1 ), t 1 ) ∂x
∂x ∂α (^) t 1 | {z } =ξ(t 1 )
d dα (^) ∗
Z (^) t 1
t 0
H(x∗^ + αξ, u + αω, λ(t), t) dt =
Z (^) t 1
t 0
∂H(x∗(t), u∗(t), t) ∂x
ξ(t) +
∂H(x∗(t), u∗(t), t) ∂u
ω(t)
dt (38)
In 1 st^ variation evaluation we expect to find an additional necessary conditon to find t∗ 1.
J[u] = ϕ(x(t 1 ), t 1 ) +
Z (^) t 1
t 0
L(x(t), u(t), t) + λT^ (t)[f (x(t), u(t), t) − x˙(t)]dt (47)
J[u∗^ + αω] = ϕ(x(t∗ 1 + ατ )∗, t∗ 1 + ατ )+
Z (^) t∗ 1 +ατ
t 0
H(x(t)∗^ + αξ(t), u(t)∗^ + αω(t), λ(t), t) dt+
Z (^) t∗ 1 +ατ
t 0
λ^ ˙(t)T^ [x(t)∗^ + αξ(t)] dt+
NOTICE: the 3 rd^ and the 4 th^ term derive from integration by parts of the
R (^) t 1 t 0 λ
T (^) x˙ term.
δJu∗^ [ω] =
d dα (^) ∗ J[u∗^ + αω] (49)
Term ○ 1 : Final Cost ϕ(x(t 1 ), t 1 ) Using the chain rule, we account for both the change in state and the change in the final time:
d dα (^) ∗
ϕ(x(t 1 ), t 1 ) = ∂ϕ ∂x
( ˙x∗(t∗ 1 )τ + ξ(t∗ 1 )) + ∂ϕ ∂t
τ (50)
Term ○^2 : Integral of the Hamiltonian H Applying the Leibniz Rule, we obtain the variation of the integrand plus the value of the Hamiltonian at the moving boundary: d dα (^) ∗
Z (^) t 1
t 0
H dt =
Z (^) t∗ 1
t 0
∂x
ξ +
∂u
ω
dt + H(t∗ 1 )τ (51)
Term ○^3 : Integral of the Adjoint Dynamics λ˙T^ x Similarly, applying the Leibniz Rule to the term arising from integration by parts:
d dα (^) ∗
Z (^) t 1
t 0
λ^ ˙T^ x dt =
Z (^) t∗ 1
t 0
λ^ ˙T^ ξ dt + λ˙T^ (t∗ 1 )x∗(t∗ 1 )τ (52)
Term ○ 4 : Boundary terms from Integration by Parts The derivative of the boundary term −λT^ (t 1 )x(t 1 ) is calculated using the product rule:
d dα (^) ∗
λT^ (t 1 )x(t 1 ) = − λ˙T^ (t∗ 1 )x∗(t∗ 1 )τ − λT^ (t∗ 1 ) ( ˙x∗(t∗ 1 )τ + ξ(t∗ 1 )) (53)
Summing all terms and grouping by the time variation parameter τ , we find the condition for the optimal terminal time t∗ 1 : (^) ∂ϕ ∂t
∂ϕ ∂x
− λT
x ˙∗^ + H
t∗ 1
Applying the transversality condition λT^ (t∗ 1 ) = ∂ϕ∂x , the middle term vanishes, leading to the final necessary condition: ∂ϕ(x∗(t∗ 1 ), t∗ 1 ) ∂t
Finally we obtain the following conditions:
x ˙∗(t) = f (x∗(t), u∗(t), t) =
∂H(x∗(t), u∗(t), λ∗(t), t) ∂λ
T (n eqs.)
x∗(ti) = x 0 (n eqs.)
λ∗(t∗ f ) =
∂ϕ(x∗(t∗ f ), t∗ f ) ∂x
T (n eqs.)
λ˙∗(t) = − ∂H(x
∗(t), u∗(t), λ∗(t), t) ∂x
T (n eqs.)
∂H(x∗(t), u∗(t), λ∗(t), t) ∂u = 0 (m eqs.)
∂ϕ(x∗(t∗ f ), t∗ f ) ∂t
The first 5 equations are the same conditions valid also for fixe time problems.
Property I: on the optimal trajectory, the total time derivative of the Hamiltonian is equal to its partial time derivative: dH∗ dt
∂t
= λT^ ∂f ∗ ∂t
∂t
Property II: if the functions L and f are not explicitly dependent on time, then the Hamiltonian is constant:
H(x∗(t), u∗(t), λ∗(t), t) = H∗^ = c c ∈ R (58)
Property III: If ϕ does not explicitly depend on time (i.e. ϕ = ϕ(x(t))) then the Hamiltonian is equal to zero along the optimal trajectory: H∗^ = 0 ∀t ∈ [ti, t∗ f ] (59)
Hypothesis: Throughout the solution time interval, the optimal triple (x∗, u∗, λ∗) must satisfy the following condition: ∂^2 H ∂u^2
[x∗(t), u∗(t), λ∗(t), t] ⪰ 0 ∀t ∈ [t 0 , t 1 ] (60)
NOTICE: H is a scalar function of time =⇒ its second derivative wrt control is a time-varying matrix:
∂^2 H ∂u^2
[x∗(t), u∗(t), λ∗(t), t] = M ∗(t) ∈ ℜmxm^ (61)
NOTICE 2: As seen for Legendre conditions (in CoV), also these equations provide a local necessary condition for optimality (hence, they’re not sufficient unless the problem is convex).
Saturation in control inputs refers to enforcing constraints on the allowable values of u, ensuring they stay within a predefined range umin ≤ u ≤ umax. There are several ways to implement saturation:
λ 0 (t 1 ) = ∂ϕ(x ∂(tx^1 ),t^1 )
T t 1
λ^ ˙ 0 (t) = − ∂H^0 (x(t),u(t),λ(t),t) ∂x
T = −
∂f (x(t), u(t), t) ∂x
| {z } =−[A(t)]T
λ 0 (t) − ∂L(x(t ∂)x,u(t),t)
λ 1 (t 1 ) = ∂ψ(x ∂(tx^1 ),t^1 )
T t 1
λ^ ˙ 1 (t) = − ∂H^1 (x(t),u(t),t) ∂x
T = −
∂f (x(t), u(t), t) ∂x
| {z } =−[A(t)]T
·λ 1 (t)
δJ 0 =
Z (^) t 1
t 0
∂u
· ω(t) +
∂x
· ξ(t) + λ˙T 0 · ξ(t)
dt (70)
δJ 1 =
Z (^) t 1
t 0
∂u
· ω(t) +
∂x
· ξ(t) + λ˙T 1 · ξ(t)
dt (71)
δJ 0 =
Z (^) t 1
t 0
∂u
· ω(t) +
∂x
· ξ(t) −
∂x
· ξ(t)
dt =
Z (^) t 1
t 0
∂u
· ω(t)
dt (72)
δJ 1 =
Z (^) t 1
t 0
∂u
· ω(t) +
∂x
· ξ(t) −
∂x
· ξ(t)
dt =
Z (^) t 1
t 0
∂u
· ω(t)
dt (73)
Since H = L + λT^ f , the derivative wrt u becomes:
∂H ∂u
∂u
∂f |{z}^ ∂u =B
So:
δJ 0 =
Z (^) t 1
t 0
∂u
ω(t)
dt δJ 1 =
Z (^) t 1
t 0
λT 1 B
ω(t) dt (75)
δJC =
Z (^) t 1
t 0
∂u
· ω(t)
dt =
Z (^) t 1
t 0
∂u
ω(t)
dt (76)
Remember: The first variation of the augmented cost functional must be zero for every perturbation
δJC =
Z (^) t 1
t 0
∂u
· ω(t)
dt = 0 (77)
Respect to the previous case (no constraints), we have to find a NEW EQUATION for the new multiplier μ.
GOAL: find an eq. that defines μ → see in δJC equation where μ appears.
Z (^) t 1
t 0
∂u · ω(t)
dt (78)
Since, in general, ω(t) is a small perturbation on the control input u(t) we rewrite it through an infinitesimal scale factor ϵ:
ω(t) = ϵ ·
∂u
T (79)
We obtain:
δJ 1 =
Z (^) t 1
t 0
∂u
· ϵ ·
∂u
T
dt (80)
Coupling it with:
Z (^) t 1
t 0
∂u
· ω(t)
dt =
Z (^) t 1
t 0
λT 1 · [B]ω(t) dt
Z (^) t 1
t 0
∂u
· ω(t)
dt =
Z (^) t 1
t 0
∂u
ω(t)
dt
We obtain:
δJ 1 = ϵ
Z (^) t 1
t 0
(λT 1 [B])
∂u
dt (82)
Carrying out the calculations:
δJ 1 = ϵ
Z (^) t 1
t 0
λT 1 [B]
∂u
dt | {z } a
+μϵ
Z (^) t 1
t 0
λT 1 [B][B]T^ λ 1 dt | {z } b
Thus: δJ 1 = ϵ(a + μb)
Along the optimal trajectory x∗(t) the 1st^ variation of cost functional is = 0 =⇒ μ = −
a b b must be ̸= 0 → True when system is controllable. =⇒ this is the additional optimality condition when final state has to be reached without errors.
Problem Formulation: equality constraints c are a function of state, control and time
min u(t)∈C^0 ([t 0 ,t 1 ])
J[u] = ϕ(x(t 1 ), t 1 ) +
Z (^) t 1
t 0
L(x(t), u(t), t) dt
s.t. x˙(t) = f (x(t), u(t), t) x(t 0 ) = x 0 c(x(t), u(t), t) = 0 (equality constraint is a r-dimensional equation)
The cost functional is augmented with Lagrangian multipliers associated with the system dynamics (λ) and with the equality constraints (μ):
J = ϕ(x(t 1 ), t 1 ) +
Z (^) t 1
t 0
L + λT^ (f − x˙) + μT^ · c
dt (85)
Trajectory observation:
Trajectory and constraints
Separating active and inactive constraints, it’s possible to adopt an equality-constraint-like writing:
H = L + λT^ · f + μTEF F · cEF F (93) ( μEF F = 0 if cEF F < 0 μEF F ≥ 0 if cEF F = 0
These conditions above expressed are another way of representing the KKT conditions → it’s a way to implement them in optimal control. In fact, it’s required that the product μEF F · cEF F = 0 with μEF F ≥ 0. Adjoint Equation Results:
λ^ ˙ =
∂x
− AT^ · λ cef f < 0
∂x
− AT^ · λ −
∂cTef f ∂x
· μEF F cef f = 0
Adjoint equation assumes different values depending on whenever cEF F is active or inactive.
Final condition on the adjoint vector equal to: λ(t 1 ) = ∂ϕ(x ∂x(t ),t) t 1 The optimality condition results in:
∂u
∂u
∂cEF F ∂x
cEF F = 0
When switching from an active set to another one, it holds:
λ(t− i ) = λ(t+ i ) H(t− i ) = H(t+ i )
NOTICE: function by parts introduce discontinuities. Inequality constraints considered up to now are called hard constraints. To avoid discontinuities, one can decide to accept constraint violations weighting these violations: in this case inequality constraints are removed and a weighting function is introduced =⇒ we talk about soft constraints.
L(u) =
k(u − umax)^2 if u ≥ umax 0 if umin < u < umax k(u − umin)^2 if u ≤ umin
g(x, u) ≤ 0 , (98)
it can be reformulated as:
g(x, u) + s = 0, s ≥ 0. (99)
The slack variable s represents the "buffer" or the extent to which the inequality is not tight. When g(x, u) = 0 , s = 0; if g(x, u) < 0 , s > 0 ensures the equality holds. In optimization, s is often included in the objective function with a penalty term to minimize its value, encouraging the solution to approach the boundary of the original inequality constraint. Slack variables strictly enforce the constraint by restructuring it, while soft constraints permit violations and penalize them.
In this case, the first step can be either up (10) or down (11). If we consider the travel time from x, one can go up and down (16) or can go down and up (18); from principle of optimality, up-down is the best way to get B for any path passes from x. Repeat the process for all other points until you get to the inital point.
V (^) k∗ (xik) = min uijk
L(xik, uijk , tk)∆t | {z } backward-step immediate cost
V (^) N∗ (xiN ) = ϕ(xiN , tN ) (terminal B.C.)
In the brute force approach, the number of possible routes grows exponentially with the number of segments n (∼ (2(nn!))! 2 ). In the DP method they scale polynomially (∼ (n + 1)^2 − 1 ) because it reuses solutions to the subproblems (segments not involved in optimal route are discarded), increasing efficiency. In our example we have n = 3, hence 20 routes possible and 15 DP computations.
Also the number of computations are reduced. Assume that the states are discretized in a finite set of X elements, the control space is discretized in U elements and the time steps are N. For the brute force approach there are XU N^ computations, while for the DP approach there are XU N computations.
A drawback feature of this problem is the "curse of dimensionality" meaning that for large X, the search space grows exponentially (since at each step you have X = pd, where p is the number of state variables and d the number of dimensions); hence, exhaustive methods become impractical.
The curse of dimensionality is the problem that affects Dynamic Programming. Trade-off Analysis: While Dynamic Programming (DP) successfully reduces the temporal complexity from exponential O(U N^ ) to linear O(N ) relative to the time horizon, it remains sensitive to the state-space dimensionality. The memory requirement (spatial complexity) grows exponentially as X = O(pd), where d is the number of state variables, p is the number of points that describes your discrete model and X is the total number of states to compute. Thus, DP optimizes time at the expense of memory. To overcome the Curse of Dimensionality, several techniques can be employed to approximate or simplify the state-space search:
Starting from classical OC problem formulation:
min u(t)∈C^0 ([t 0 ,t 1 ])
J[u] = ϕ(x(t 1 ), t 1 ) +
Z (^) t 1
t 0
L(x(t), u(t), t)dt
subject to x˙(t) = f (x(t), u(t), t) x(t 0 ) = x 0
In order to apply the Dynamic Programming algorithm (as just done for the traveller’s problem), it is necessary to discretize the problem both in time and in space (i.e. state variables):
min U
J^ ˜ = ϕ(xN , tN ) +
k=
L(xk, uk, tk)∆t
subject to xk+1 = xk + f (xk, uk, tk)∆t x 0 = x 0
States are discretized in a finite set of X elements, control space in U elements and time steps are N. When the optimal cost is evaluated backward it’s called residual cost J* or value function or cost-to-go. Iteratively, the value function is built as a function of both time step "k" and state "i" at each step:
V (^) k∗ (xik) (103)
The algorithm is initialized at the final time step as:
V (^) N∗ (xiN ) = ϕ(xiN , tN ) (104)
The cost increment at each step is computed as:
∆Jkij =
Z (^) tk+
tk
L(x(t), u(t), t)dt ≈ L(xik, uijk , tk)∆t (105)
To determine the value of uijk , the system can be discretized using Euler integration method:
xjk+1 ≈ xik + f (xik, uijk , tk)∆t =⇒ f (xik, uijk , tk) ≈
xjk+1 − xik ∆t
Then, proceeding backwards from N-1 to 0, the following minimization search is done:
V (^) k∗ (xik) = min uijk
{L(xik, uijk , tk)∆t + V (^) k∗+1(xjk+1)} (107)
At each time step, the value function is computed for each possible state together with the optimal control input uij k ∗that brings the system from state "i" to "j" as a result of the minimization.
Non-Affine Systems: A system is said to have dynamics that are affine in its control inputs when the control u(t) influences the system in a linear way, while other parts of the system (like the state x(t)) might still behave nonlinearly.
x ˙(t) = g(x(t), t) | {z } non-linear portion of the system dynamics
The discretized dynamics is: xjk− 1 = xik + g(xik, tk)∆t + q(xik, tk)uijk ∆t (109)
Thus, the control input to pass from state xik at tk to xjk+1 at tk+1 is:
uijk = q(xik, tk)−^1 [
xjk+1 − xik ∆t
− g(xik, tk)] (110)