You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/dev-optimalcontrol.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
1
# OptimalControl.jl
2
2
3
3
```@meta
4
-
CollapsedDocStrings = true
4
+
CollapsedDocStrings = false
5
5
```
6
6
7
7
The [OptimalControl.jl](https://control-toolbox.org/OptimalControl.jl) package is part of the [control-toolbox ecosystem](https://github.com/control-toolbox).
Copy file name to clipboardExpand all lines: docs/src/index.md
+10-42
Original file line number
Diff line number
Diff line change
@@ -4,44 +4,15 @@
4
4
CurrentModule = OptimalControl
5
5
```
6
6
7
-
The OptimalControl.jl package is the root package of the [control-toolbox ecosystem](https://github.com/control-toolbox).
8
-
The control-toolbox ecosystem gathers Julia packages for mathematical control and applications. It aims to provide tools to model and solve optimal control problems with ordinary differential equations by direct and indirect methods.
7
+
The OptimalControl.jl package is the root package of the [control-toolbox ecosystem](https://github.com/control-toolbox). The control-toolbox ecosystem gathers Julia packages for mathematical control and applications. It aims to provide tools to model and solve optimal control problems with ordinary differential equations by direct and indirect methods.
9
8
10
9
## Installation
11
10
12
-
To install OptimalControl.jl please
13
-
[open Julia's interactive session (known as REPL)](https://docs.julialang.org/en/v1/manual/getting-started)
14
-
and press `]` key in the REPL to use the package mode, then add the package:
11
+
To install OptimalControl.jl, please [open Julia's interactive session (known as REPL)](https://docs.julialang.org/en/v1/manual/getting-started) and use the Julia package manager:
15
12
16
13
```julia
17
-
julia> ]
18
-
pkg> add OptimalControl
19
-
```
20
-
21
-
## Mathematical problem
22
-
23
-
A (nonautonomous) optimal control problem with possibly free initial and final times can be described as minimising the cost functional
For more details about this problem, please check the [basic example tutorial](@ref tutorial-double-integrator-energy).
72
-
For a comprehensive introduction to the syntax used above to describe the optimal control problem, check the [abstract syntax tutorial](@ref tutorial-abstract).
73
-
The solve options are described in the [solve tutorial](@ref tutorial-solve).
42
+
- For more details about this problem, please check the [basic example tutorial](@ref tutorial-double-integrator-energy).
43
+
- For a comprehensive introduction to the syntax used above to describe the optimal control problem, check the [abstract syntax tutorial](@ref tutorial-abstract-syntax).
44
+
- The `solve` function has options, see the [solve tutorial](@ref tutorial-solve).
45
+
- You can customise the plot with the `plot` function, see the [plot tutorial](@ref tutorial-plot).
Before opening a pull request, please start an issue or a discussion on the topic.
67
+
If you think you found a bug or if you have a feature request / suggestion, feel free to open an [issue](https://github.com/control-toolbox/OptimalControl.jl/issues). Before opening a pull request, please start an issue or a discussion on the topic.
98
68
99
-
Contributions are welcomed, check out [how to contribute to a Github project](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
100
-
If it is your first contribution, you can also check [this first contribution tutorial](https://github.com/firstcontributions/first-contributions).
101
-
You can find first good issues (if any 🙂) [here](https://github.com/control-toolbox/OptimalControl.jl/contribute). You may find other packages to contribute to at the [control-toolbox organization](https://github.com/control-toolbox).
69
+
Contributions are welcomed, check out [how to contribute to a Github project](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project). If it is your first contribution, you can also check [this first contribution tutorial](https://github.com/firstcontributions/first-contributions). You can find first good issues (if any 🙂) [here](https://github.com/control-toolbox/OptimalControl.jl/contribute). You may find other packages to contribute to at the [control-toolbox organization](https://github.com/control-toolbox).
102
70
103
71
If you want to ask a question, feel free to start a discussion [here](https://github.com/orgs/control-toolbox/discussions). This forum is for general discussion about this repository and the [control-toolbox organization](https://github.com/control-toolbox).
Copy file name to clipboardExpand all lines: docs/src/tutorial-abstract.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# [The abstract syntax to define an optimal control problem](@id tutorial-abstract)
1
+
# [The syntax to define an optimal control problem](@id tutorial-abstract-syntax)
2
2
3
3
The full grammar of [OptimalControl.jl](https://control-toolbox.org/OptimalControl.jl) small *Domain Specific Language* is given below. The idea is to use a syntax that is
4
4
- pure Julia (and, as such, effortlessly analysed by the standard Julia parser),
Copy file name to clipboardExpand all lines: docs/src/tutorial-double-integrator-energy.md
+30-12
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# [Double integrator: energy min (abstract syntax)](@id tutorial-double-integrator-energy)
1
+
# [Double integrator: energy min](@id tutorial-double-integrator-energy)
2
2
3
3
Let us consider a wagon moving along a rail, whom acceleration can be controlled by a force $u$.
4
4
We denote by $x = (x_1, x_2)$ the state of the wagon, that is its position $x_1$ and its velocity $x_2$.
@@ -51,7 +51,7 @@ nothing # hide
51
51
52
52
!!! note "Nota bene"
53
53
54
-
For a comprehensive introduction to the syntax used above to describe the optimal control problem, check [this abstract syntax tutorial](@ref abstract). In particular, there are non-unicode alternatives for derivatives, integrals, *etc.*
54
+
For a comprehensive introduction to the syntax used above to define the optimal control problem, check [this abstract syntax tutorial](@ref tutorial-abstract-syntax). In particular, there are non-unicode alternatives for derivatives, integrals, *etc.*
55
55
56
56
## [Solve and plot](@id basic-solve-plot)
57
57
@@ -68,6 +68,10 @@ And plot the solution with:
68
68
plot(sol)
69
69
```
70
70
71
+
!!! note "Nota bene"
72
+
73
+
The `solve` function has options, see the [solve tutorial](@ref tutorial-solve). You can customise the plot with the `plot` function, see the [plot tutorial](@ref tutorial-plot).
74
+
71
75
## State constraint
72
76
73
77
We add the path constraint
@@ -76,6 +80,8 @@ We add the path constraint
76
80
x_2(t) \le 1.2.
77
81
```
78
82
83
+
Let us model, solve and plot the optimal control problem with this constraint.
84
+
79
85
```@example main
80
86
ocp = @def begin
81
87
@@ -95,28 +101,40 @@ ocp = @def begin
95
101
end
96
102
97
103
sol = solve(ocp)
104
+
98
105
plot(sol)
99
106
```
100
107
101
-
## Save and load
108
+
## Exporting and importing the solution
109
+
110
+
We can export (or save) the solution in a Julia `.jld2` data file and reload it later, and also export a discretised version of the solution in a more portable [JSON](https://en.wikipedia.org/wiki/JSON) format. Note that the optimal control problem is needed when loading a solution.
102
111
103
-
We can save the solution in a Julia `.jld2` data file and reload it later, and also export a discretised version of the solution in a more portable [JSON](https://en.wikipedia.org/wiki/JSON) format. Note that the OCP is needed when loading a solution.
Copy file name to clipboardExpand all lines: docs/src/tutorial-double-integrator-time.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# [Double integrator: time minimisation (abstract syntax)](@id double-integrator-time)
1
+
# [Double integrator: time minimisation](@id double-integrator-time)
2
2
3
3
The problem consists in minimising the final time $t_f$ for the double integrator system
4
4
@@ -70,7 +70,7 @@ nothing # hide
70
70
71
71
!!! note "Nota bene"
72
72
73
-
For a comprehensive introduction to the syntax used above to describe the optimal control problem, check [this abstract syntax tutorial](@ref abstract). In particular, there are non-unicode alternatives for derivatives, integrals, *etc.*
73
+
For a comprehensive introduction to the syntax used above to define the optimal control problem, check [this abstract syntax tutorial](@ref tutorial-abstract-syntax). In particular, there are non-unicode alternatives for derivatives, integrals, *etc.*
74
74
75
75
## Solve and plot
76
76
@@ -86,3 +86,7 @@ and plot the solution
86
86
```@example main
87
87
plot(sol)
88
88
```
89
+
90
+
!!! note "Nota bene"
91
+
92
+
The `solve` function has options, see the [solve tutorial](@ref tutorial-solve). You can customise the plot with the `plot` function, see the [plot tutorial](@ref tutorial-plot).
0 commit comments