Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
ocots committed Aug 27, 2024
1 parent d610259 commit d13147d
Show file tree
Hide file tree
Showing 25 changed files with 146 additions and 44 deletions.
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ makedocs(
pages = [
"Introduction" => "index.md",
"Basic examples" => [
"Energy minimisation" => "tutorial-basic-example.md",
"Time mininimisation" => "tutorial-double-integrator.md",
"Energy minimisation" => "tutorial-double-integrator-energy.md",
"Time mininimisation" => "tutorial-double-integrator-time.md",
],
"Manual" => [
"Abstract syntax" => "tutorial-abstract.md",
Expand Down
7 changes: 4 additions & 3 deletions docs/src/api-ctbase.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ style B fill:#FBF275

You may find in this package:

- [Types](@ref api-ctbase-types): the common types and associated methods if any.
- [Description](@ref api-ctbase-description): tools to manipulate tuples.
- [Differential geometry](@ref api-ctbase-diffgeometry): tools to compute [Lie brackets](https://en.wikipedia.org/w/index.php?title=Lie_bracket_of_vector_fields&oldid=1163591634), [Poisson brackets](https://en.wikipedia.org/w/index.php?title=Poisson_manifold&oldid=1163991099#Formal_definition)...
- [Differential geometry](@ref api-ctbase-differential-geometry): tools to compute [Lie brackets](https://en.wikipedia.org/w/index.php?title=Lie_bracket_of_vector_fields&oldid=1163591634), [Poisson brackets](https://en.wikipedia.org/w/index.php?title=Poisson_manifold&oldid=1163991099#Formal_definition)...
- [Exceptions](@ref api-ctbase-exceptions).
- [Initial guess](@ref api-ctbase-init): tools to define an initial guess.
- [Model](@ref api-ctbase-model): tools to modelise an optimal control problem in a functional manner.
- [Parser](@ref api-ctbase-parser): tools to modelise an optimal control problem in an abstract manner.
- [Plot](@ref api-ctbase-plot): the `plot` function extended from Plots.jl and utils.
- [Print](@ref api-ctbase-print): check how an optimal control problem is displayed.
- [Repl](@ref api-ctbase-repl): control-toolbox repl.
- [Solution](@ref api-ctbase-solution): optimal control solution.
- [Types](@ref api-ctbase-types): the common types and associated methods if any.
- [Utils](@ref api-ctbase-utils): auxiliary methods.

Here is the list of imported packages and exported functions.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/api-ctbase/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ CollapsedDocStrings = true
```@index
Pages = ["description.md"]
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["description.jl"]
Private = false
```
6 changes: 3 additions & 3 deletions docs/src/api-ctbase/diffgeometry.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Differential geometry](@id api-ctbase-diffegeometry)
# [Differential geometry](@id api-ctbase-differential-geometry)

```@meta
CollapsedDocStrings = true
Expand All @@ -9,14 +9,14 @@ CollapsedDocStrings = true
```@index
Pages = ["diffgeometry.md"]
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["differential_geometry.jl"]
Private = false
```
4 changes: 2 additions & 2 deletions docs/src/api-ctbase/exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ CollapsedDocStrings = true
```@index
Pages = ["exceptions.md"]
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["exception.jl"]
Private = false
```
22 changes: 22 additions & 0 deletions docs/src/api-ctbase/init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# [Initial guess](@id api-ctbase-init)

```@meta
CollapsedDocStrings = true
```

## Index

```@index
Pages = ["init.md"]
Modules = [CTBase]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["init.jl"]
Private = false
```
28 changes: 21 additions & 7 deletions docs/src/api-ctbase/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,33 @@
CollapsedDocStrings = true
```

## Index

```@index
```@contents
Pages = ["model.md"]
```

## Optimal control model type

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["optimal_control_model-type.jl"]
Private = false
```

## Documentation
## Getters

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Pages = ["model.jl"]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["optimal_control_model-getters.jl"]
Private = false
```

## Constructors and setters

```@autodocs
Modules = [CTBase]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["optimal_control_model-setters.jl"]
Private = false
```
2 changes: 1 addition & 1 deletion docs/src/api-ctbase/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CollapsedDocStrings = true

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["plot.jl"]
Private = false
```
4 changes: 2 additions & 2 deletions docs/src/api-ctbase/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CollapsedDocStrings = true

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["print.jl"]
Private = false
```
Expand Down Expand Up @@ -70,7 +70,7 @@ You can also define the optimal control problem in an abstract form:
```@example main2
using OptimalControl
@def ocp begin
ocp = @def begin
t ∈ [ 0, 1 ], time
x ∈ R^2, state
u ∈ R, control
Expand Down
4 changes: 2 additions & 2 deletions docs/src/api-ctbase/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ CollapsedDocStrings = true
```@index
Pages = ["repl.md"]
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["repl.jl"]
Private = false
```
36 changes: 36 additions & 0 deletions docs/src/api-ctbase/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# [Solution](@id api-ctbase-solution)

```@meta
CollapsedDocStrings = true
```

```@contents
Pages = ["solution.md"]
```

## Optimal control solution type

```@autodocs
Modules = [CTBase]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["optimal_control_solution-type.jl"]
Private = false
```

## Getters

```@autodocs
Modules = [CTBase]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["optimal_control_solution-getters.jl"]
Private = false
```

## Constructors and setters

```@autodocs
Modules = [CTBase]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["optimal_control_solution-setters.jl"]
Private = false
```
5 changes: 3 additions & 2 deletions docs/src/api-ctbase/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ CollapsedDocStrings = true
```@index
Pages = ["types.md"]
Modules = [CTBase]
Order = [:type]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:type]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["types.jl", "functions.jl"]
Private = false
```
4 changes: 2 additions & 2 deletions docs/src/api-ctbase/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ CollapsedDocStrings = true
```@index
Pages = ["utils.md"]
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :function, :macro]
Order = [:type, :module, :constant, :function, :macro]
Pages = ["utils.jl"]
Private = false
```
4 changes: 2 additions & 2 deletions docs/src/dev-ctbase.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ CollapsedDocStrings = true
```@index
Pages = ["dev-ctbase.md"]
Modules = [CTBase]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTBase]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
Public = false
```
4 changes: 2 additions & 2 deletions docs/src/dev-ctdirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ CollapsedDocStrings = true
```@index
Pages = ["dev-ctdirect.md"]
Modules = [CTDirect]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTDirect]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
Public = false
```
4 changes: 2 additions & 2 deletions docs/src/dev-ctflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ CollapsedDocStrings = true
```@index
Pages = ["dev-ctflows.md"]
Modules = [CTFlows]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
```

## Documentation

```@autodocs
Modules = [CTFlows]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
Public = false
```
4 changes: 2 additions & 2 deletions docs/src/dev-optimalcontrol.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ CollapsedDocStrings = true
```@index
Pages = ["dev-optimalcontrol.md"]
Modules = [OptimalControl]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
```

## Documentation

```@autodocs
Modules = [OptimalControl]
Order = [:module, :constant, :type, :function, :macro]
Order = [:type, :module, :constant, :type, :function, :macro]
Public = false
```
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ nothing # hide

!!! note "Nota bene"

For a comprehensive introduction to the syntax used above to describe the optimal control problem, check [this tutorial](@ref abstract). In particular, there are non-unicode alternatives for derivatives, integrals, *etc.* There is also a non-standard but more classical functional syntax, check [this tutorial](@ref functional).
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.* There is also a non-standard but more classical functional syntax, check [this functional syntax tutorial](@ref functional).

## [Solve and plot](@id basic-solve-plot)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ nothing # hide

!!! note "Nota bene"

For a comprehensive introduction to the syntax used above to describe the optimal control problem, check [this tutorial](@ref abstract). In particular, there are non-unicode alternatives for derivatives, integrals, *etc.* There is also a non-standard but more classical functional syntax, check [this tutorial](@ref functional).
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.* There is also a non-standard but more classical functional syntax, check [this functional syntax tutorial](@ref functional).

## Solve and plot

Expand Down
4 changes: 4 additions & 0 deletions docs/src/tutorial-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ You can notice from the graph of `v` that the integrator has made very few steps
time_grid(sol)
```

!!! Note "Time grid"

The function [`time_grid`](@ref) returns the discretized time grid returned by the solver. In this case, the solution has been computed by numerical integration with an adaptive step-length Runge-Kutta scheme.

To have a better visualisation (the accuracy won't change), you can provide a fine grid.

```@example main
Expand Down
6 changes: 5 additions & 1 deletion docs/src/tutorial-goddard.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ bang arc with maximal control, followed by a singular arc, then by a boundary ar
arc is with zero control. Note that the switching function vanishes along the singular and
boundary arcs.

!!! tip "Interactions with an optimal control solution"

Please check [`state`](@ref), [`costate`](@ref), [`control`](@ref) and [`variable`](@ref) to get data from the solution. The functions `state`, `costate` and `control` return functions of time and `variable` returns a vector. The function [`time_grid`](@ref) returns the discretized time grid returned by the solver.

```@example main
t = time_grid(direct_sol)
x = state(direct_sol)
Expand Down Expand Up @@ -371,7 +375,7 @@ Let us define the problem to solve.
# auxiliary function with aggregated inputs
nle! = ( s, ξ) -> shoot!(s, ξ[1:3], ξ[4], ξ[5], ξ[6], ξ[7])
# Jacobian of the (auxiliary) shooting function
# Jacobian of the (auxiliary) shooting function
jnle! = (js, ξ) -> jacobian!(nle!, similar(ξ), js, backend, ξ)
nothing # hide
```
Expand Down
Loading

0 comments on commit d13147d

Please sign in to comment.