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/tutorial-nlp.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ We describe here some more advanced operations related to the discretized optima
8
8
When calling `solve(ocp)` three steps are performed internally:
9
9
10
10
- first, the OCP is discretized into a DOCP (a nonlinear optimization problem) with [`direct_transcription`](@ref),
11
-
- then, this DOCP is solved,
11
+
- then, this DOCP is solved (with the internal function `solve_docp`),
12
12
- finally, a functional solution of the OCP is rebuilt from the solution of the discretized problem, with [`build_solution`](@ref).
13
13
14
14
These steps can also be done separately, for instance if you want to use your own NLP solver.
@@ -48,16 +48,11 @@ nothing # hide
48
48
We discretize the problem.
49
49
50
50
```@example main
51
-
docp = direct_transcription(ocp)
51
+
docp, nlp = direct_transcription(ocp)
52
52
nothing # hide
53
53
```
54
54
55
-
The DOCP contains a copy of the original OCP, and the resulting discretized problem, in our case an `ADNLPModel`.
56
-
You can extract this raw NLP problem with the [`get_nlp`](@ref) method.
57
-
58
-
```@example main
59
-
nlp = get_nlp(docp)
60
-
```
55
+
The DOCP contains information related to the transcription, including a copy of the original OCP, and the NLP is the resulting discretized problem, in our case an `ADNLPModel`.
61
56
62
57
We can now use the solver of our choice to solve it.
63
58
@@ -67,8 +62,7 @@ For a first example we use the `ipopt` solver from [`NLPModelsIpopt.jl`](https:/
If you prefer to get a more compact figure, you can use the `layout` optional keyword argument with `:group` value. It will group the state, costate and control trajectories in one subplot for each.
0 commit comments