From a872f0a98f333c90185fe24c5d02f1bda2c2d6da Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 20 Jul 2023 20:47:28 +0000 Subject: [PATCH] build based on 9330c45 --- dev/api.html | 4 ++-- dev/dev-api.html | 2 ++ dev/index.html | 19 ++++++++++++++++++- dev/search.html | 2 +- dev/search_index.js | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 dev/dev-api.html diff --git a/dev/api.html b/dev/api.html index 9c4727fb..f93989f7 100644 --- a/dev/api.html +++ b/dev/api.html @@ -1,5 +1,5 @@ -API · CTDirect.jl

API

This page is a dump of all the docstrings found in the code.

CTDirect.solveMethod
solve(
+API · CTDirect.jl

API

CTDirect.solveMethod
solve(
     ocp::CTBase.OptimalControlModel,
     description...;
     grid_size,
@@ -12,4 +12,4 @@
 

Solve the optimal control problem

Input : ocp : functional description of the optimal control problem (cf. ocp.jl) N : number of time steps for the discretization Int

Output sol : solution of the discretized problem ...

julia> using CTDirect
 julia> using CTProblems
 julia> ocp =  Problem((:integrator, :dim2, :energy)
-julia> solve(ocp)
source
+julia> solve(ocp)
source
diff --git a/dev/dev-api.html b/dev/dev-api.html new file mode 100644 index 00000000..0b366da4 --- /dev/null +++ b/dev/dev-api.html @@ -0,0 +1,2 @@ + +Developers · CTDirect.jl
diff --git a/dev/index.html b/dev/index.html index b0d05e75..07b59501 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,19 @@ -Introduction · CTDirect.jl
+Introduction · CTDirect.jl

CTDirect.jl

The CTDirect.jl package is part of the control-toolbox ecosystem.

Install

To install a package from the control-toolbox ecosystem, please visit the installation page.

An optimal control problem with fixed initial and final times, denoted (OCP), can be described as minimising the cost functional

\[g(x(t_0), x(t_f)) + \int_{t_0}^{t_f} f^{0}(t, x(t), u(t))~\mathrm{d}t\]

where the state $x$ and the control $u$ are functions, subject, for $t \in [t_0, t_f]$, to the differential constraint

\[ \dot{x}(t) = f(t, x(t), u(t)),\]

and other constraints such as

\[\begin{array}{llcll} +\psi_l &\le& \psi(t, x(t), u(t)) &\le& \psi_u, \\ +\phi_l &\le& \phi(x(t_0), x(t_f)) &\le& \phi_u. +\end{array}\]

The so-called direct approach transforms the infinite dimensional optimal control problem (OCP) into a finite dimensional optimization problem (NLP). This is done by a discretization in time applied to the state and control variables, as well as the dynamics equation. These methods are usually less precise than indirect methods based on Pontryagin’s Maximum Principle, but more robust with respect to the initialization. Also, they are more straightforward to apply, hence their wide use in industrial applications. We refer the reader to for instance[1] and [2] for more details on direct transcription methods and NLP algorithms.

Summary of the time discretization:

\[\begin{array}{lcl} +t \in [t_0,t_f] & \to & \{t_0, \ldots, t_N=t_f\}\\[0.2em] +x(\cdot),\, u(\cdot) & \to & X=\{x_0, \ldots, x_N, u_0, \ldots, u_N\} \\[1em] +\hline +\\ +\text{criterion} & \to & \min\ g(x_0, x_N) \\[0.2em] +\text{dynamics} & \to & x_{i+i} = x_i + (t_{i+i} - t_i)\, f(t_i, x_i, u_i) ~~ \text{(Euler)}\\[0.2em] +\text{path constraints} &\to& \psi_l \le \psi(t_i, x_i, u_i) \le \psi_u \\[0.2em] +\text{limit conditions} &\to& \phi_l \le \phi(x_0, x_N) \le \phi_u +\end{array}\]

We therefore obtain a nonlinear programming problem on the discretized state and control variables of the general form:

\[(NLP)\quad \left\{ +\begin{array}{lr} +\min \ F(X) \\ +LB \le C(X) \le UB +\end{array} +\right.\]

We use packages from JuliaSmoothOptimizers to solve the (NLP) problem.

  • 1J. T. Betts. Practical methods for optimal control using nonlinear programming. Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2001.
  • 2J. Nocedal and S.J. Wright. Numerical optimization. Springer-Verlag, New York, 1999.****
diff --git a/dev/search.html b/dev/search.html index 0642ce2d..92321168 100644 --- a/dev/search.html +++ b/dev/search.html @@ -1,2 +1,2 @@ -Search · CTDirect.jl

Loading search...

    +Search · CTDirect.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index 0a36d911..4231bbfa 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"api.html","page":"API","title":"API","text":"CurrentModule = CTDirect ","category":"page"},{"location":"api.html","page":"API","title":"API","text":"Pages = [\"api.md\"]","category":"page"},{"location":"api.html#API","page":"API","title":"API","text":"","category":"section"},{"location":"api.html","page":"API","title":"API","text":"This page is a dump of all the docstrings found in the code. ","category":"page"},{"location":"api.html","page":"API","title":"API","text":"Modules = [CTDirect]\nOrder = [:module, :type, :function, :macro]","category":"page"},{"location":"api.html#CTDirect.solve-Tuple{CTBase.OptimalControlModel, Vararg{Any}}","page":"API","title":"CTDirect.solve","text":"solve(\n ocp::CTBase.OptimalControlModel,\n description...;\n grid_size,\n print_level,\n mu_strategy,\n display,\n init,\n kwargs...\n) -> CTBase.OptimalControlSolution\n\n\nSolve the optimal control problem\n\nInput : ocp : functional description of the optimal control problem (cf. ocp.jl) N : number of time steps for the discretization Int\n\nOutput sol : solution of the discretized problem ...\n\njulia> using CTDirect\njulia> using CTProblems\njulia> ocp = Problem((:integrator, :dim2, :energy)\njulia> solve(ocp)\n\n\n\n\n\n","category":"method"},{"location":"index.html#CTDirect.jl","page":"Introduction","title":"CTDirect.jl","text":"","category":"section"},{"location":"index.html#Overview","page":"Introduction","title":"Overview","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"This package is ...","category":"page"}] +[{"location":"api.html#API","page":"API","title":"API","text":"","category":"section"},{"location":"api.html","page":"API","title":"API","text":"CurrentModule = CTDirect ","category":"page"},{"location":"api.html","page":"API","title":"API","text":"Modules = [CTDirect]\nOrder = [:module, :type, :function, :macro]\nPrivate = false","category":"page"},{"location":"api.html#CTDirect.solve-Tuple{CTBase.OptimalControlModel, Vararg{Any}}","page":"API","title":"CTDirect.solve","text":"solve(\n ocp::CTBase.OptimalControlModel,\n description...;\n grid_size,\n print_level,\n mu_strategy,\n display,\n init,\n kwargs...\n) -> CTBase.OptimalControlSolution\n\n\nSolve the optimal control problem\n\nInput : ocp : functional description of the optimal control problem (cf. ocp.jl) N : number of time steps for the discretization Int\n\nOutput sol : solution of the discretized problem ...\n\njulia> using CTDirect\njulia> using CTProblems\njulia> ocp = Problem((:integrator, :dim2, :energy)\njulia> solve(ocp)\n\n\n\n\n\n","category":"method"},{"location":"dev-api.html#Internal-functions","page":"Developers","title":"Internal functions","text":"","category":"section"},{"location":"dev-api.html","page":"Developers","title":"Developers","text":"CurrentModule = CTDirect ","category":"page"},{"location":"dev-api.html","page":"Developers","title":"Developers","text":"Modules = [CTDirect]\nOrder = [:module, :type, :function, :macro]\nPublic = false","category":"page"},{"location":"index.html#CTDirect.jl","page":"Introduction","title":"CTDirect.jl","text":"","category":"section"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"CurrentModule = CTDirect","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"The CTDirect.jl package is part of the control-toolbox ecosystem.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"note: Install\nTo install a package from the control-toolbox ecosystem, please visit the installation page.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"An optimal control problem with fixed initial and final times, denoted (OCP), can be described as minimising the cost functional","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"g(x(t_0) x(t_f)) + int_t_0^t_f f^0(t x(t) u(t))mathrmdt","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"where the state x and the control u are functions, subject, for t in t_0 t_f, to the differential constraint","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":" dotx(t) = f(t x(t) u(t))","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"and other constraints such as","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"beginarrayllcll\npsi_l le psi(t x(t) u(t)) le psi_u \nphi_l le phi(x(t_0) x(t_f)) le phi_u\nendarray","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"The so-called direct approach transforms the infinite dimensional optimal control problem (OCP) into a finite dimensional optimization problem (NLP). This is done by a discretization in time applied to the state and control variables, as well as the dynamics equation. These methods are usually less precise than indirect methods based on Pontryagin’s Maximum Principle, but more robust with respect to the initialization. Also, they are more straightforward to apply, hence their wide use in industrial applications. We refer the reader to for instance[1] and [2] for more details on direct transcription methods and NLP algorithms.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"[1]: J. T. Betts. Practical methods for optimal control using nonlinear programming. Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA, 2001.","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"[2]: J. Nocedal and S.J. Wright. Numerical optimization. Springer-Verlag, New York, 1999.****","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"Summary of the time discretization:","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"beginarraylcl\nt in t_0t_f to t_0 ldots t_N=t_f02em\nx(cdot) u(cdot) to X=x_0 ldots x_N u_0 ldots u_N 1em\nhline\n\ntextcriterion to min g(x_0 x_N) 02em\ntextdynamics to x_i+i = x_i + (t_i+i - t_i) f(t_i x_i u_i) text(Euler)02em\ntextpath constraints to psi_l le psi(t_i x_i u_i) le psi_u 02em\ntextlimit conditions to phi_l le phi(x_0 x_N) le phi_u\nendarray","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"We therefore obtain a nonlinear programming problem on the discretized state and control variables of the general form:","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"(NLP)quad left\nbeginarraylr\nmin F(X) \nLB le C(X) le UB\nendarray\nright","category":"page"},{"location":"index.html","page":"Introduction","title":"Introduction","text":"We use packages from JuliaSmoothOptimizers to solve the (NLP) problem.","category":"page"}] }