Skip to content

Commit 06b151c

Browse files
committed
up direct_transcription
1 parent 4a8ae7f commit 06b151c

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

docs/extras/disc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ for adnlp_backend in backends
9090
println("Testing backend: ", adnlp_backend)
9191

9292
# Discretize the problem with a large grid size and Gauss-Legendre method
93-
bt = @btimed direct_transcription(
93+
docp = @btimed direct_transcription(
9494
$ocp; disc_method=:euler, grid_size=1000, adnlp_backend=($adnlp_backend)
9595
)
96-
docp, nlp = bt.value
96+
nlp = model(docp)
9797
prepa_time = bt.time
9898

9999
# Get the number of non-zero elements

docs/src/tutorial-discretisation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ backends = [:optimized, :manual]
147147
for adnlp_backend in backends
148148
149149
# Discretize the problem with a large grid size and Gauss-Legendre method
150-
bt = @btimed direct_transcription($ocp;
150+
docp = @btimed direct_transcription($ocp;
151151
disc_method=:gauss_legendre_3,
152152
grid_size=1000,
153153
adnlp_backend=$adnlp_backend,
154154
)
155-
docp, nlp = bt.value
155+
nlp = model(docp)
156156
prepa_time = bt.time
157157
158158
# Get the number of non-zero elements

docs/src/tutorial-nlp.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ nothing # hide
4545
We discretize the problem.
4646

4747
```@example main-nlp
48-
docp, nlp = direct_transcription(ocp)
48+
docp = direct_transcription(ocp)
49+
nlp = model(docp)
4950
nothing # hide
5051
```
5152

@@ -83,7 +84,8 @@ nlp_sol = madnlp(nlp)
8384
An initial guess, including warm start, can be passed to [`direct_transcription`](https://control-toolbox.org/OptimalControl.jl/stable/dev-ctdirect.html#CTDirect.direct_transcription-Tuple{Model,%20Vararg{Any}}) the same way as for `solve`.
8485

8586
```@example main-nlp
86-
docp, nlp = direct_transcription(ocp; init=sol)
87+
docp = direct_transcription(ocp; init=sol)
88+
nlp = model(nlp)
8789
nothing # hide
8890
```
8991

0 commit comments

Comments
 (0)