Skip to content

Commit b6182b4

Browse files
committed
proofreading
1 parent a7d858e commit b6182b4

32 files changed

+230
-194
lines changed

CITATION.bib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@software{Caillau_OptimalControl_jl_a_Julia,
1+
@software{OptimalControl_jl_a_Julia,
22
author = {Caillau, Jean-Baptiste and Cots, Olivier and Gergaud, Joseph and Martinon, Pierre},
33
doi = {10.5281/zenodo.17013180},
44
license = {["MIT"]},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ If you use OptimalControlProblems.jl in your work, please cite us:
6363
or in bibtex format:
6464

6565
```bibtex
66-
@software{Caillau_OptimalControlProblems_jl,
66+
@software{OptimalControlProblems_jl,
6767
author = {Caillau, Jean-Baptiste and Cots, Olivier and Gergaud, Joseph and Martinon, Pierre},
6868
doi = {10.5281/zenodo.17013180},
6969
license = {["MIT"]},

docs/make.jl

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ links = InterLinks(
4141
"https://jso.dev/NLPModelsIpopt.jl/stable/objects.inv",
4242
joinpath(@__DIR__, "inventories", "NLPModelsIpopt.toml"),
4343
),
44+
"NLPModelsJuMP" => (
45+
"https://jso.dev/NLPModelsJuMP.jl/stable/",
46+
"https://jso.dev/NLPModelsJuMP.jl/stable/objects.inv",
47+
joinpath(@__DIR__, "inventories", "NLPModelsJuMP.toml"),
48+
),
4449
"OptimalControl" => (
4550
"https://control-toolbox.org/OptimalControl.jl/stable/",
4651
"https://control-toolbox.org/OptimalControl.jl/stable/objects.inv",
@@ -69,22 +74,23 @@ cp(
6974
repo_url = "github.com/control-toolbox/OptimalControlProblems.jl"
7075

7176
#
72-
draft = false
77+
draft = true
7378
exclude_from_draft=Symbol[
7479
# :beam
7580
]
7681
PROBLEMS_PAGES = generate_documentation_problems(;
7782
draft=draft, exclude_from_draft=exclude_from_draft
7883
)
7984

85+
# If draft is true below, then the julia code from .md is not executed.
86+
# To disable the draft mode in a specific markdown file, use the following:
87+
#=
88+
```@meta
89+
Draft = false
90+
```
91+
=#
8092
makedocs(;
81-
draft=draft, # if draft is true, then the julia code from .md is not executed # debug
82-
# to disable the draft mode in a specific markdown file, use the following:
83-
#=
84-
```@meta
85-
Draft = false
86-
```
87-
=#
93+
draft=draft,
8894
#remotes=nothing,
8995
warnonly=:cross_references,
9096
sitename="OptimalControlProblems.jl",
@@ -102,10 +108,10 @@ makedocs(;
102108
"Problems" =>
103109
["problems-introduction.md", "List of the problems" => PROBLEMS_PAGES],
104110
"Tutorials" => [
105-
"How to get a problem" => "tutorial-get.md",
106-
"How to solve a problem" => "tutorial-solve.md",
111+
"Get a problem" => "tutorial-get.md",
112+
"Solve a problem" => "tutorial-solve.md",
107113
],
108-
"Developers" => ["How to add a problem" => "dev-add.md", "API" => "dev-api.md"],
114+
"Developers" => ["Add a problem" => "dev-add.md", "API" => "dev-api.md"],
109115
],
110116
plugins=[links],
111117
)

docs/problems.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function generate_documentation(
5555
nothing # hide
5656
```
5757
58-
## Initial guess
58+
## initial guess
5959
6060
The initial guess (or first iterate) can be visualised by running the solver with `max_iter=0`. Here is the initial guess.
6161

docs/src/assets/Manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ version = "1.1.1"
10451045
deps = ["ADNLPModels", "CTBase", "CTDirect", "CTModels", "DocStringExtensions", "ExaModels", "OrderedCollections", "SolverCore"]
10461046
path = "/Users/ocots/Research/logiciels/dev/control-toolbox/OptimalControlProblems"
10471047
uuid = "59046045-fb9c-4c23-964f-ff0a25704f96"
1048-
version = "0.2.1"
1048+
version = "0.2.2"
10491049
weakdeps = ["JuMP", "OptimalControl"]
10501050

10511051
[deps.OptimalControlProblems.extensions]

docs/src/dev-add.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
# [Add a problem](@id add-problem)
22

3-
To add a new problem to **OptimalControlProblems**, you should follow these steps:
3+
To add a new problem to **OptimalControlProblems**, you must follow these steps:
44

55
**1.** Create a new file in the `ext/MetaData` directory with the name of your problem, containing the required information about the problem in a dictionary. For example, if your problem is called `new_problem`, create a file named `new_problem.jl`. The dictionary should follow the template:
66

77
```julia
88
new_problem_meta = OrderedDict(
9-
:name => "new_problem", # Problem name
10-
:N => 100, # Number of steps
11-
:minimise => true, # Whether the objective is minimised (true) or maximised (false)
12-
:state_name => ["x1", "x2"], # Names of the state components
13-
:costate_name => ["∂x1", "∂x2"], # Names of the costate components (dual variables of the dynamics constraints)
14-
:control_name => ["u"], # Names of the control components
15-
:variable_name => ["v"], # Names of the optimisation variables
16-
:final_time => (:fixed, 1), # Final time information
9+
:name => "new_problem", # Problem name
10+
:N => 100, # Number of steps
11+
:minimise => true, # Whether we minimise (true) or maximise (false)
12+
:state_name => ["x1", "x2"], # Names of the state components
13+
:costate_name => ["∂x1", "∂x2"], # Names of the dynamics constraints (for the costate)
14+
:control_name => ["u"], # Names of the control components
15+
:variable_name => ["v"], # Names of the optimisation variables
16+
:final_time => (:fixed, 1), # Final time information
1717
)
1818
```
1919

2020
!!! note
2121

2222
For more details about the metadata, see the [MetaData](@ref problems-introduction-metadata) section.
2323

24-
**2.** Define the DOCP **OptimalControl** model of the problem in a file named `new_problem.jl` in the `ext/OptimalControlModels` directory.
24+
**2.** Define the **OptimalControl** model of the problem in a file named `new_problem.jl` in the `ext/OptimalControlModels` directory, following the template:
2525

2626
```julia
2727
"""
2828
Documentation of the method
2929
"""
30-
function OptimalControlProblems.new_problem(::OptimalControlBackend, description::Symbol...; N::Int=steps_number_data(:new_problem), kwargs...)
30+
function OptimalControlProblems.new_problem(
31+
::OptimalControlBackend,
32+
description::Symbol...;
33+
N::Int=steps_number_data(:new_problem),
34+
kwargs...,
35+
)
3136

3237
# if tf is fixed
3338
tf = final_time_data(:new_problem)
@@ -41,7 +46,7 @@ function OptimalControlProblems.new_problem(::OptimalControlBackend, description
4146
# initial guess for the problem
4247
init = ()
4348

44-
# DOCP and NLP
49+
# discretise the optimal control problem
4550
docp = direct_transcription(
4651
ocp,
4752
description...;
@@ -57,25 +62,28 @@ function OptimalControlProblems.new_problem(::OptimalControlBackend, description
5762
end
5863
```
5964

60-
**3.** Define the NLP **JuMP** model of the problem in a file named `new_problem.jl` in the `ext/JuMPModels` directory.
65+
**3.** Define the **JuMP** model of the problem in a file named `new_problem.jl` in the `ext/JuMPModels` directory, following the template:
6166

6267
```julia
6368
"""
6469
Documentation of the method
6570
"""
66-
function OptimalControlProblems.new_problem(::JuMPBackend, args...; N::Int=steps_number_data(:new_problem), kwargs...)
71+
function OptimalControlProblems.new_problem(
72+
::JuMPBackend, args...; N::Int=steps_number_data(:new_problem), kwargs...
73+
)
6774

6875
# if tf is fixed
6976
tf = final_time_data(:new_problem)
7077

7178
# model
7279
model = JuMP.Model(args...; kwargs...)
7380

74-
# Define the problem here
75-
# ...
81+
# define the problem
82+
# @variables, @constraints, @objective...
7683

7784
return model
85+
7886
end
7987
```
8088

81-
**4.** Describe the problem in a file named `new_problem.jl` in the `ext/Descriptions` directory.
89+
**4.** Describe the problem in a file named `new_problem.jl` in the `ext/Descriptions` directory. Please get inspiration from the already existing descriptions in [OptimalControlProblems.jl/ext/Descriptions](https://github.com/control-toolbox/OptimalControlProblems.jl/tree/main/ext/Descriptions).

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The **OptimalControlProblems.jl** package is part of the [control-toolbox ecosys
44

55
If you would like to define and solve your own optimal control problem, please refer to the [OptimalControl.jl documentation](https://control-toolbox.org/OptimalControl.jl).
66

7-
In **OptimalControlProblems.jl**, you will find a collection of optimal control problems modelled with JuMP and OptimalControl. These problems can be used for benchmarking.
7+
In **OptimalControlProblems.jl**, you will find a collection of optimal control problems modelled with JuMP and OptimalControl that can be used for benchmarking.
88

99
## Installation
1010

@@ -24,7 +24,7 @@ If you use OptimalControlProblems.jl in your work, please cite us:
2424
or in bibtex format:
2525

2626
```bibtex
27-
@software{Caillau_OptimalControlProblems_jl,
27+
@software{OptimalControlProblems_jl,
2828
author = {Caillau, Jean-Baptiste and Cots, Olivier and Gergaud, Joseph and Martinon, Pierre},
2929
doi = {10.5281/zenodo.17013180},
3030
license = {["MIT"]},

0 commit comments

Comments
 (0)