Skip to content

OptimalControl 1.0 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CalculusOfVariations"
uuid = "33922b39-d0c9-4121-8f1f-33c1dad529cf"
authors = ["Olivier Cots <olivier.cots@irit.fr>"]
version = "0.1.3"
version = "0.2.0"

[compat]
julia = "1.10"
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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"),
],
),
pages=[
"Introduction" => "index.md",
"Catenoid solution" => "application-surface-revolution.md",
"Surface of revolution" => "application-surface-revolution.md",
],
)

Expand Down
24 changes: 12 additions & 12 deletions docs/src/application-surface-revolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
65 changes: 60 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
<details><summary>The documentation of this package was built using these direct dependencies,</summary>
```

```@example
using Pkg # hide
Pkg.status() # hide
```

```@raw html
</details>
```

```@raw html
<details><summary>and using this machine and Julia version.</summary>
```

```@example
using Pkg
Pkg.status()
using InteractiveUtils # hide
versioninfo() # hide
```

```@raw html
</details>
```

```@raw html
<details><summary>A more complete overview of all dependencies and their versions is also provided.</summary>
```

```@example
using Pkg # hide
Pkg.status(; mode = PKGMODE_MANIFEST) # hide
```

```@raw html
</details>
```

```@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.
""")
```
Loading