Skip to content

Commit 8684465

Browse files
authored
Merge pull request #142 from control-toolbox/doc
Doc
2 parents 79f6d15 + 6e2d6fd commit 8684465

27 files changed

+592
-205
lines changed

docs/Project.toml

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
[deps]
2+
CTBase = "54762871-cc72-4466-b8e8-f6c8b58076cd"
3+
CTDirect = "790bbbee-bee9-49ee-8912-a9de031322d5"
4+
CTFlows = "1c39547c-7794-42f7-af83-d98194f657c2"
25
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
7+
MINPACK = "4854310b-de5a-5eb6-a2a5-c1dee2bd17f9"
38
OptimalControl = "5f98b655-cc9a-415a-b60e-744165666948"
9+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"

docs/make.jl

+22-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
using Documenter
22
using OptimalControl
3+
using CTBase
4+
using CTFlows
5+
using CTDirect
6+
7+
# https://stackoverflow.com/questions/70137119/how-to-include-the-docstring-for-a-function-from-another-package-in-my-julia-doc
8+
DocMeta.setdocmeta!(CTBase, :DocTestSetup, :(using CTBase); recursive = true)
9+
DocMeta.setdocmeta!(CTFlows, :DocTestSetup, :(using CTFlows); recursive = true)
10+
DocMeta.setdocmeta!(CTDirect, :DocTestSetup, :(using CTDirect); recursive = true)
11+
DocMeta.setdocmeta!(OptimalControl, :DocTestSetup, :(using OptimalControl); recursive = true)
312

413
makedocs(
514
sitename = "OptimalControl.jl",
615
format = Documenter.HTML(prettyurls = false),
716
pages = [
8-
"Introduction" => "index.md",
9-
"Tutorials" => ["basic-example.md", "goddard.md"],
10-
"API" => "api.md",
11-
"Developpers" => "dev-api.md"
17+
"Introduction" => "index.md",
18+
"Tutorials" => ["tutorial-basic-example.md",
19+
"tutorial-goddard.md",
20+
"tutorial-model.md",
21+
"tutorial-solvers.md",
22+
"tutorial-init.md",
23+
"tutorial-plot.md",
24+
"tutorial-iss.md",
25+
"tutorial-ctrepl.md"],
26+
"API" => ["api.md",
27+
"api-ctbase.md",
28+
"api-ctflows.md",
29+
"api-ctdirect.md"],
1230
]
1331
)
1432

docs/src/api-ctbase.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CTBase API
2+
3+
This is just a dump of CTBase API documentation.
4+
For more details about `CTBase.jl` package, see the [documentation](https://control-toolbox.org/CTDocs.jl/ctbase).
5+
6+
## Index
7+
8+
```@index
9+
Pages = ["api-ctbase.md"]
10+
Modules = [CTBase]
11+
Order = [:module, :constant, :type, :function, :macro]
12+
Private = false
13+
```
14+
15+
## Documentation
16+
17+
```@autodocs
18+
Modules = [CTBase]
19+
Order = [:module, :constant, :type, :function, :macro]
20+
Private = false
21+
```

docs/src/api-ctdirect.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CTDirect API
2+
3+
This is just a dump of CTDirect API documentation.
4+
For more details about `CTDirect.jl` package, see the [documentation](https://control-toolbox.org/CTDocs.jl/ctdirect).
5+
6+
## Index
7+
8+
```@index
9+
Pages = ["api-ctdirect.md"]
10+
Modules = [CTDirect]
11+
Order = [:module, :constant, :type, :function, :macro]
12+
Private = false
13+
```
14+
15+
## Documentation
16+
17+
```@autodocs
18+
Modules = [CTDirect]
19+
Order = [:module, :constant, :type, :function, :macro]
20+
Private = false
21+
```

docs/src/api-ctflows.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# CTFlows API
2+
3+
This is just a dump of CTFlows API documentation.
4+
For more details about `CTFlows.jl` package, see the [documentation](https://control-toolbox.org/CTDocs.jl/ctflows).
5+
6+
## Index
7+
8+
```@index
9+
Pages = ["api-ctflows.md"]
10+
Modules = [CTFlows]
11+
Order = [:module, :constant, :type, :function, :macro]
12+
Private = false
13+
```
14+
15+
## Documentation
16+
17+
```@autodocs
18+
Modules = [CTFlows]
19+
Order = [:module, :constant, :type, :function, :macro]
20+
Private = false
21+
```

docs/src/api.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
# API
1+
# OptimalControl API
22

3-
```@meta
4-
CurrentModule = OptimalControl
3+
## Index
4+
5+
```@index
6+
Pages = ["api.md"]
7+
Modules = [OptimalControl]
8+
Order = [:module, :constant, :type, :function, :macro]
9+
Private = false
10+
```
11+
12+
## Available methods
13+
14+
```@example
15+
using OptimalControl
16+
Methods()
517
```
618

19+
## Documentation
20+
721
```@autodocs
822
Modules = [OptimalControl]
9-
Order = [:module, :type, :function, :macro]
23+
Order = [:module, :constant, :type, :function, :macro]
24+
Private = false
1025
```
491 KB
Loading

docs/src/assets/chariot.png

20 KB
Loading

docs/src/assets/diagram.png

147 KB
Loading

docs/src/basic-example.md

-60
This file was deleted.

docs/src/dev-api.md

-11
This file was deleted.

docs/src/goddard.md

-105
This file was deleted.

docs/src/index.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
CurrentModule = OptimalControl
55
```
66

7-
The `OptimalControl.jl` package is part of the [control-toolbox ecosystem](https://github.com/control-toolbox).
7+
The `OptimalControl.jl` package aims to provide tools to solve optimal control problems by direct and indirect methods.
8+
It is part of the [control-toolbox ecosystem](https://github.com/control-toolbox):
89

9-
!!! note "Install"
10+
```@raw html
11+
<img src="./assets/diagram.png" style="display: block; margin: 0 auto 20px auto;" width="320px">
12+
```
13+
14+
!!! note "Install and documentation"
1015

1116
To install a package from the control-toolbox ecosystem,
1217
please visit the [installation page](https://github.com/control-toolbox#installation).
18+
The documentation is accessible from the main menu.
1319

14-
This package aims to provide tools to solve optimal control problems by direct and indirect methods. An optimal control problem can be described as minimising the cost functional
20+
An optimal control problem with fixed initial and final times can be described as minimising the cost functional
1521

1622
```math
17-
g(t_0, x(t_0), t_f, x(t_f)) + \int_{t_0}^{t_f} f^{0}(t, x(t), u(t))~\mathrm{d}t
23+
g(x(t_0), x(t_f)) + \int_{t_0}^{t_f} f^{0}(t, x(t), u(t))~\mathrm{d}t
1824
```
1925

2026
where the state $x$ and the control $u$ are functions subject, for $t \in [t_0, t_f]$,
@@ -34,3 +40,9 @@ and other constraints such as
3440
\phi_l &\le& \phi(t_0, x(t_0), t_f, x(t_f)) &\le& \phi_u.
3541
\end{array}
3642
```
43+
44+
See our tutorials to get started solving optimal control problems:
45+
46+
- [Basic example](@ref): a simple smooth optimal control problem solved by the direct method.
47+
- [Advanced example](@ref): the [Goddard problem](https://en.wikipedia.org/w/index.php?title=Goddard_problem&oldid=1091155283) solved by direct and indirect methods.
48+

0 commit comments

Comments
 (0)