From 96aa9d77fb286ff7d486208afb174eecad56d00a Mon Sep 17 00:00:00 2001 From: Dutto Date: Wed, 14 Aug 2024 16:20:34 +0200 Subject: [PATCH] Remove old text --- docs/src/2D-example.md | 120 ++++------------------------------------- 1 file changed, 11 insertions(+), 109 deletions(-) diff --git a/docs/src/2D-example.md b/docs/src/2D-example.md index ab8bb42..0c7aa28 100644 --- a/docs/src/2D-example.md +++ b/docs/src/2D-example.md @@ -6,14 +6,16 @@ We introduce the pseudo-Hamiltonian h(x,p,p^0,u) = p^0 x + p u. ``` -For the sake of simplicity, we consider in this notebook only the normal case, and we fix $p^0 = -1$. According to the Pontryagin maximum principle, the maximizing control is given by $u(x,p) \to \mathrm{sign}(p)$. This function is non-differentiable, and may lead to numerical issues. +For the sake of simplicity, we assume that the BC-extremals associated to the solution of the studied problem is normal, and so we fix $p^0 = -1$. According to the Pontryagin maximum principle, the maximizing control is given by $u(x,p) \to \mathrm{sign}(p)$. This function is non-differentiable, and may lead to numerical issues. + +Let's start by defining the problem. ```@example main -using OptimalControl # hide -using Plots # hide -using ForwardDiff # hide -using DifferentialEquations # hide -using MINPACK # hide +using OptimalControl +using Plots +using ForwardDiff +using DifferentialEquations +using MINPACK t0 = 0 # initial time x0 = 0 # initial state @@ -101,44 +103,6 @@ plot(sol) # plot Now, we want to provide $J_S$ to the solver, thanks to the $\texttt{ForwardDiff.jl}$ package. This Jacobian is computed with the variational equation, and leads to a false result in our case. -Details. ( To be removed ) - -Denoting $z = (x,p)$, we have - -```math - \varphi(t_0, z_0, t_f) = z_0 + \int_{t_0}^{t_f} \vec H\big(\varphi(t_0, z_0, t)\big) \,\mathrm dt. -``` - -If we assume that $z_0 \to \varphi(t_0, z_0, t_f)$ is differentiable, we have - -```math - \frac{\partial \varphi}{\partial z_0}(t_0, z_0, t_f)\cdot \delta z_0 = \delta z_0 + \int_{t_0}^{t_f} \vec H'\big(\varphi(t_0, z_0, t)\big)\cdot \left( \frac{\partial \varphi}{\partial z_0}(t_0, z_0, t) \cdot \delta z_0 \right) \,\mathrm dt, -``` - -and so, $z_0 \to \frac{\partial \varphi}{\partial z_0}(t_0, z_0, t_f)\cdot \delta z_0$ is solution of the variational equations - -```math - \frac{\partial \delta z}{\partial t}(t) = \vec H'\big(\varphi(t_0, z_0, t_f)\big) \cdot \delta z(t), \qquad \delta z(t_0) = \delta z_0. -``` - -In the studied optimal control problem, we have - -```math - \vec H(x,p) = (\mathrm{sign}(p), -1) -``` - -and so, we have $\vec H'(z) = 0_2$ almost everywhere, which implies - -```math - \frac{\partial \varphi}{\partial z_0}(t_0, z_0, t_f) \cdot \delta z_0 = \mathrm{exp}\big((t_f-t_0) 0_2 \big)\cdot \delta z_0 = \delta z_0. -``` - -The Jacobian of the shooting function is then given by - -```math - S'(p_0) = \pi \left( \frac{\partial \varphi}{\partial p_0}(t_0, x_0, p_0, t_f) \right) = \pi \left( \frac{\partial \varphi}{\partial z_0}(t_0, z_0, t_f) \cdot (0,1) \right) = \pi(0,1) = 0. -``` - ```@raw html
@@ -146,7 +110,7 @@ The Jacobian of the shooting function is then given by Details.
-

Denoting z=(x,p)z = (x,p), we have

+

Denoting z0=(x0,p0)z_0 = (x_0,p_0) the initial state costate couple, we have

φ(t0,z0,tf)=z0+t0tfH(φ(t0,z0,t))dt. \varphi(t_0, z_0, t_f) = z_0 + \int_{t_0}^{t_f} \vec H\big(\varphi(t_0, z_0, t)\big) \,\mathrm dt.