Skip to content

Commit

Permalink
docs ok
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMartinon committed Jul 5, 2024
1 parent 7598248 commit cc41414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
6 changes: 2 additions & 4 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Private = false

```@docs
solve
save_OCP_solution
load_OCP_solution
export_OCP_solution
read_OCP_solution
export_ocp_solution
import_ocp_solution
```
28 changes: 0 additions & 28 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,3 @@ nothing # hide
```@example main
plot(sol4)
```

## The discretized problem

Instead of calling **solve** directly on the OCP problem, you can first obtain the discretized problem (DOCP) by calling **directTranscription**, then call **solve** on the DOCP. The resulting solution of the discretized problem can be used to generate the corresponding OCP solution with **OCPSolutionFromDOCP**.
```@example main
docp = directTranscription(ocp, grid_size=100)
dsol = solve(docp, print_level=5)
sol5 = OCPSolutionFromDOCP(docp, dsol)
nothing # hide
```
The initial guess can be passed to **solve** same as before.
```@example main
dsol = solve(docp, print_level=0, init=sol1)
sol6 = OCPSolutionFromDOCP(docp, dsol)
println("Objective ", sol6.objective, " after ", sol6.iterations, " iterations")
```
Another possibility is to set the initial guess associated to the DOCP, using the function **setInitialGuess**.
```@example main
setDOCPInitialGuess(docp, sol1)
dsol = solve(docp, print_level=5)
nothing # hide
```
Finally, the direct transcription also accept an initial guess.
```@example main
docp = directTranscription(ocp, grid_size=100, init=sol1)
dsol = solve(docp, print_level=5)
nothing # hide
```

0 comments on commit cc41414

Please sign in to comment.