Skip to content

Commit da105d0

Browse files
authored
Merge pull request #508 from control-toolbox/507-doc-solve-function
tuto solve: arguments details
2 parents 65796ce + 18db78a commit da105d0

File tree

2 files changed

+71
-5
lines changed

2 files changed

+71
-5
lines changed

docs/src/index.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,67 @@ If you want to ask a question, feel free to start a discussion [here](https://gi
7373
!!! note
7474

7575
If you want to add an application or a package to the control-toolbox ecosystem, please follow this [set up tutorial](https://github.com/control-toolbox/CTApp.jl/discussions/9).
76+
77+
## Reproducibility
78+
79+
```@raw html
80+
<details><summary>The documentation of this package was built using these direct dependencies,</summary>
81+
```
82+
83+
```@example
84+
using Pkg # hide
85+
Pkg.status() # hide
86+
```
87+
88+
```@raw html
89+
</details>
90+
```
91+
92+
```@raw html
93+
<details><summary>and using this machine and Julia version.</summary>
94+
```
95+
96+
```@example
97+
using InteractiveUtils # hide
98+
versioninfo() # hide
99+
```
100+
101+
```@raw html
102+
</details>
103+
```
104+
105+
```@raw html
106+
<details><summary>A more complete overview of all dependencies and their versions is also provided.</summary>
107+
```
108+
109+
```@example
110+
using Pkg # hide
111+
Pkg.status(; mode = PKGMODE_MANIFEST) # hide
112+
```
113+
114+
```@raw html
115+
</details>
116+
```
117+
118+
```@eval
119+
using TOML
120+
using Markdown
121+
version = TOML.parse(read("../../Project.toml", String))["version"]
122+
name = TOML.parse(read("../../Project.toml", String))["name"]
123+
link_manifest = "https://github.com/SciML/" *
124+
name *
125+
".jl/tree/gh-pages/v" *
126+
version *
127+
"/assets/Manifest.toml"
128+
link_project = "https://github.com/SciML/" *
129+
name *
130+
".jl/tree/gh-pages/v" *
131+
version *
132+
"/assets/Project.toml"
133+
Markdown.parse("""You can also download the
134+
[manifest]($link_manifest)
135+
file and the
136+
[project]($link_project)
137+
file.
138+
""")
139+
```

docs/src/tutorial-solve.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ solve(ocp, :direct, :adnlp, :ipopt)
9999

100100
The options for the direct method are listed [here](https://control-toolbox.org/OptimalControl.jl/stable/dev-ctdirect.html#CTDirect.solve-Tuple{Model,%20Vararg{Symbol}}). The main options, with their [default values], are:
101101
- `display` ([true], false): setting `display` to false will disable output.
102+
- `init`: info for the starting guess, which can be provided as numerical values, functions, or an existing solution. See [initial guess tutorial](@ref tutorial-initial-guess).
102103
- `grid_size` ([250]): size of the (uniform) time discretization grid. More precisely, it is the number of time steps, that is if `N = grid_size` and if the initial and final times are denoted respectively `t0` and `tf`, then we have `Δt = (tf - t0) / N`.
104+
- `time_grid` ([`nothing`]): explicit time grid (can be non uniform). If `time_grid` is nothing then, a uniform grid is built of length `grid_size`.
103105
- `disc_method` ([`:trapeze`], `:midpoint`, `:euler`, `:euler_implicit`, `:gauss_legendre_2`, `:gauss_legendre_3`): see [discretisation methods](https://control-toolbox.org/Tutorials.jl/stable/tutorial-discretisation.html).
104-
- `init`: info for the starting guess, which can be provided as numerical values, functions, or an existing solution. See [initial guess tutorial](@ref tutorial-initial-guess).
106+
- `adnlp_backend`: backend for automatic differentiation in ADNLPModels ([`:optimized`], `:manual`, `:default`).
105107

106108
For examples of more advanced use, see
107109
- [discrete continuation](https://control-toolbox.org/Tutorials.jl/stable/tutorial-continuation.html),
@@ -114,12 +116,12 @@ In addition to these options, all remaining keyword arguments passed to `solve`
114116

115117
Please check the list of [Ipopt options](https://coin-or.github.io/Ipopt/OPTIONS.html) and the [NLPModelsIpopt.jl documentation](https://jso.dev/NLPModelsIpopt.jl).
116118
```@example main
117-
solve(ocp; max_iter=0)
118-
nothing # hide
119+
sol = solve(ocp; max_iter=0, display=false)
120+
iterations(sol)
119121
```
120122

121123
Similarly, please check the [MadNLP.jl documentation](https://madnlp.github.io/MadNLP.jl) and the list of [MadNLP.jl options](https://madnlp.github.io/MadNLP.jl/stable/options/).
122124
```@example main
123-
solve(ocp, :madnlp; max_iter=0)
124-
nothing # hide
125+
sol = solve(ocp, :madnlp; max_iter=0, display=false)
126+
iterations(sol)
125127
```

0 commit comments

Comments
 (0)