Skip to content

Commit 7d40d14

Browse files
committed
Update tutorials: MAM continuation improvements, other tutorial adjustments
1 parent 819dab7 commit 7d40d14

4 files changed

Lines changed: 6 additions & 17 deletions

File tree

docs/src/assets/Manifest.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,9 +1251,9 @@ version = "2.13.0"
12511251

12521252
[[deps.LinearSolve]]
12531253
deps = ["ArrayInterface", "ConcreteStructs", "DocStringExtensions", "EnumX", "GPUArraysCore", "InteractiveUtils", "Krylov", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "OpenBLAS_jll", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLLogging", "SciMLOperators", "Setfield", "StaticArraysCore"]
1254-
git-tree-sha1 = "06aa84654f44350d5cf3c678702ca48795c12e54"
1254+
git-tree-sha1 = "42b5cb44317e89ef75dd841c9c8eba9045bf9ff0"
12551255
uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
1256-
version = "3.74.0"
1256+
version = "3.75.0"
12571257

12581258
[deps.LinearSolve.extensions]
12591259
LinearSolveAMDGPUExt = "AMDGPU"

docs/src/tutorial-discretisation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ sol = solve(ocp; scheme=:midpoint, display=false)
7878
plot(sol; size=(800, 800))
7979
```
8080

81-
Let us now compare different discretization schemes to evaluate their accuracy and performance. See the [Strategy options](@id manual-solve-strategy-options) for information on default values for parameters like `tol`.
81+
Let us now compare different discretization schemes to evaluate their accuracy and performance. See the [Strategy options](@extref OptimalControl manual-solve-strategy-options) for information on default values for parameters like `tol`.
8282

8383
```@example main-disc
8484
# Solve the problem with different discretization methods

docs/src/tutorial-lqr.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# A simple Linear–quadratic regulator example
22

3-
```@meta
4-
Draft = false
5-
```
6-
73
## Problem statement
84

95
We consider the following Linear Quadratic Regulator (LQR) problem, which consists in minimizing

docs/src/tutorial-mam.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ function continuation_mam(Ts; init_guess=init)
145145
iterations_list = Int[]
146146
current_sol = init_guess
147147
148+
opts = (display=false, grid_size=1000, tol=1e-8, print_level=0)
148149
for T in Ts
149-
current_sol = solve(ocp(T); display=false, init=current_sol, grid_size=1000, tol=1e-8)
150+
current_sol = solve(ocp(T); init=current_sol, opts...)
150151
push!(objectives, objective(current_sol))
151152
push!(iterations_list, iterations(current_sol))
152153
end
@@ -155,7 +156,7 @@ function continuation_mam(Ts; init_guess=init)
155156
end
156157
157158
# Perform continuation
158-
Ts = range(1, 100, 100)
159+
Ts = range(50, 100, 101)
159160
objectives, iters, final_sol = continuation_mam(Ts)
160161
161162
# Display results
@@ -186,14 +187,6 @@ vline!(plt1, [T_min], label="Minimum at T=$(round(T_min, digits=1))", z_order=:b
186187
plot(plt1, size=(800,400))
187188
```
188189

189-
We now focus on the region around the minimum for a clearer view:
190-
191-
```@example main-mam
192-
plt2 = scatter(Ts[40:100], log10.(objectives[40:100]), xlabel="Time", label="Objective (log10)")
193-
vline!(plt2, [T_min], label="Minimum", z_order=:back)
194-
plot(plt2, size=(800,400))
195-
```
196-
197190
!!! note "Interpretation"
198191

199192
The optimal transition time $T^*$ balances two competing effects: shorter times require larger deviations from the deterministic flow (higher action), while longer times allow the system to follow the flow more closely. The minimum represents the most probable transition time in the small noise limit.

0 commit comments

Comments
 (0)