From 459cb07884078abde6fb0f389eff3a6254c63690 Mon Sep 17 00:00:00 2001 From: Olivier Cots Date: Sat, 19 Apr 2025 13:13:57 +0200 Subject: [PATCH] OptimalControl 1.0 --- Project.toml | 2 +- docs/Project.toml | 4 +- docs/make.jl | 4 +- docs/src/application-surface-revolution.md | 24 ++++---- docs/src/index.md | 65 ++++++++++++++++++++-- 5 files changed, 77 insertions(+), 22 deletions(-) diff --git a/Project.toml b/Project.toml index 169a28a..3e0da52 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CalculusOfVariations" uuid = "33922b39-d0c9-4121-8f1f-33c1dad529cf" authors = ["Olivier Cots "] -version = "0.1.3" +version = "0.2.0" [compat] julia = "1.10" diff --git a/docs/Project.toml b/docs/Project.toml index 910039b..ebfbb4a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -10,8 +10,8 @@ Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" [compat] Documenter = "1.6" ForwardDiff = "0.10" -OptimalControl = "0.12" -OrdinaryDiffEq = "6.88" +OptimalControl = "1.0" +OrdinaryDiffEq = "6.93" Plots = "1.40" Roots = "2.1" Suppressor = "0.2" diff --git a/docs/make.jl b/docs/make.jl index 5b395fc..a8f6c38 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -9,7 +9,7 @@ makedocs(; format=Documenter.HTML(; repolink="https://" * repo_url, prettyurls=false, - size_threshold_ignore=["index.md"], + size_threshold_ignore=["index.md", "application-surface-revolution.md"], assets=[ asset("https://control-toolbox.org/assets/css/documentation.css"), asset("https://control-toolbox.org/assets/js/documentation.js"), @@ -17,7 +17,7 @@ makedocs(; ), pages=[ "Introduction" => "index.md", - "Catenoid solution" => "application-surface-revolution.md", + "Surface of revolution" => "application-surface-revolution.md", ], ) diff --git a/docs/src/application-surface-revolution.md b/docs/src/application-surface-revolution.md index 4c3eac7..5956181 100644 --- a/docs/src/application-surface-revolution.md +++ b/docs/src/application-surface-revolution.md @@ -245,13 +245,13 @@ for p0 ∈ p0s # plot for each pā‚€ in p0s flow_p0 = ocp_flow((t0, tf_), x0, p0; saveat=tspan, callback=cbt) T = tspan - X = flow_p0.state.(T) - P = flow_p0.costate.(T) + X = state(flow_p0).(T) + P = costate(flow_p0).(T) - plot!(plt_x, T, X; color=:blue) - plot!(plt_p, T, P; color=:blue) - plot!(plt_u, T, u.(X, P); color=:blue) - plot!(plt_phase, X, P; color=:blue) + plot!(plt_x, T, X; color=:blue) + plot!(plt_p, T, P; color=:blue) + plot!(plt_u, T, u.(X, P); color=:blue) + plot!(plt_phase, X, P; color=:blue) end @@ -318,13 +318,13 @@ for (p0, label) ∈ zip(p0s, labels) # plot for each pā‚€ in p0s flow_p0 = ocp_flow((t0, tf), x0, p0; saveat=tspan) T = tspan - X = flow_p0.state.(T) - P = flow_p0.costate.(T) + X = state(flow_p0).(T) + P = costate(flow_p0).(T) - plot!(plt2_x, T, X; label=label) - plot!(plt2_p, T, P; label=label) - plot!(plt2_u, T, u.(X, P); label=label) - plot!(plt2_phase, X, P; label=label) + plot!(plt2_x, T, X; label=label) + plot!(plt2_p, T, P; label=label) + plot!(plt2_u, T, u.(X, P); label=label) + plot!(plt2_phase, X, P; label=label) end diff --git a/docs/src/index.md b/docs/src/index.md index 338237b..d9e47a4 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,6 +1,6 @@ # Calculus of variations -## Introduction +## Mathematical formulation Let consider $\mathcal{I}$ an open interval of $\mathbb{R}$, $\Omega$ an open set of $\mathbb{R}^n$ and a continuous application @@ -59,11 +59,66 @@ generally on the state $x$ and the control $u$. You may find an example of such a problem [here](@ref catenoid). -## Dependencies +## Reproducibility -All the numerical simulations to generate this documentation are performed with the following packages. +```@raw html +
The documentation of this package was built using these direct dependencies, +``` + +```@example +using Pkg # hide +Pkg.status() # hide +``` + +```@raw html +
+``` + +```@raw html +
and using this machine and Julia version. +``` ```@example -using Pkg -Pkg.status() +using InteractiveUtils # hide +versioninfo() # hide +``` + +```@raw html +
+``` + +```@raw html +
A more complete overview of all dependencies and their versions is also provided. +``` + +```@example +using Pkg # hide +Pkg.status(; mode = PKGMODE_MANIFEST) # hide +``` + +```@raw html +
+``` + +```@eval +using TOML +using Markdown +version = TOML.parse(read("../../Project.toml", String))["version"] +name = TOML.parse(read("../../Project.toml", String))["name"] +link_manifest = "https://github.com/SciML/" * + name * + ".jl/tree/gh-pages/v" * + version * + "/assets/Manifest.toml" +link_project = "https://github.com/SciML/" * + name * + ".jl/tree/gh-pages/v" * + version * + "/assets/Project.toml" +Markdown.parse("""You can also download the +[manifest]($link_manifest) +file and the +[project]($link_project) +file. +""") ``` \ No newline at end of file