Skip to content

Commit c0bc074

Browse files
committed
Split example blocks to separate solve and output
- Separate solve() call from println statements in example-control-and-variable.md - Separate solve() call from println statements in example-control-free.md - Improves documentation rendering and code block organization
1 parent dc6c0df commit c0bc074

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

docs/src/example-control-and-variable.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ nothing # hide
6262

6363
```@example main-growth-cv
6464
direct_sol = solve(ocp; grid_size=20, display=false)
65+
```
66+
67+
```@example main-growth-cv
6568
println("Estimated growth rate: λ = ", variable(direct_sol))
6669
println("Objective value: ", objective(direct_sol))
6770
nothing # hide

docs/src/example-control-free.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ nothing # hide
226226

227227
```@example main-harmonic
228228
direct_sol = solve(ocp; grid_size=20, display=false)
229+
```
230+
231+
```@example main-harmonic
229232
println("Optimal pulsation: ω = ", variable(direct_sol))
230233
println("Objective value: ω² = ", objective(direct_sol))
231234
println("Expected: ω = π/2 ≈ 1.5708, ω² ≈ 2.4674")

0 commit comments

Comments
 (0)