Skip to content
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
7 changes: 6 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ jobs:
call:
uses: control-toolbox/CTActions/.github/workflows/ci.yml@main
with:
runs_on: '["ubuntu-latest", "windows-latest"]'
versions: '["1.10", "1.12"]'
runs_on: '["ubuntu-latest", "macos-latest"]'
runner_type: 'github'
use_ct_registry: false
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}
3 changes: 3 additions & 0 deletions .github/workflows/Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ on:
jobs:
call:
uses: control-toolbox/CTActions/.github/workflows/coverage.yml@main
with:
use_ct_registry: false
secrets:
codecov-secret: ${{ secrets.CODECOV_TOKEN }}
SSH_KEY: ${{ secrets.SSH_KEY }}
4 changes: 4 additions & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ on:
jobs:
call:
uses: control-toolbox/CTActions/.github/workflows/documentation.yml@main
with:
use_ct_registry: false
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OptimalControlProblems"
uuid = "59046045-fb9c-4c23-964f-ff0a25704f96"
authors = ["Olivier Cots <olivier.cots@toulouse-inp.fr>"]
version = "0.4.0"
version = "0.5.0"

[deps]
ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a"
Expand Down
4 changes: 2 additions & 2 deletions ext/JuMPModels/brachistochrone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ function OptimalControlProblems.brachistochrone(
end
)


model[:time_grid] = () -> range(t0, value(tf), N+1)
# metadata: required
model[:time_grid] = () -> range(t0, value(tf), grid_size+1)
model[:state_components] = ["px", "py", "v"]
model[:costate_components] = ["∂px", "∂py", "∂v"]
model[:control_components] = ["u"]
Expand Down
2 changes: 1 addition & 1 deletion ext/JuMPModels/bryson_denham.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ julia> model = OptimalControlProblems.bryson_denham(JuMPBackend(); N=100)
# References

"""

function OptimalControlProblems.bryson_denham(
::JuMPBackend,
args...;
Expand All @@ -40,6 +39,7 @@ function OptimalControlProblems.bryson_denham(

model = JuMP.Model(args...; kwargs...)

# metadata: required
model[:time_grid] = () -> range(t0, tf, grid_size+1)
model[:state_components] = ["x1", "x2"]
model[:control_components] = ["u"]
Expand Down
6 changes: 3 additions & 3 deletions ext/JuMPModels/dielectrophoretic_particle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function OptimalControlProblems.dielectrophoretic_particle(
model,
begin
x[0:N], (start = 1)
y[0:N], (start = 1)
u_l ≤ u[0:N] ≤ u_u, (start = 0.1)
tf ≥ tf_l, (start = 5)
y[0:N], (start = 0.5)
u_l ≤ u[0:N] ≤ u_u, (start = 0.5)
tf ≥ tf_l, (start = 8)
end
)

Expand Down
2 changes: 1 addition & 1 deletion ext/MetaData/dielectrophoretic_particle.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dielectrophoretic_particle_meta = OrderedDict(
:grid_size => 500,
:parameters => (t0=0, x_t0=1, y_t0=0, x_tf=2, α=-0.75, c=1, u_l=-1, u_u=1, tf_l=0),
:parameters => (t0=0, x_t0=1, y_t0=0, x_tf=2, α=-0.75, c=1, u_l=-1, u_u=1, tf_l=0.1),
)
2 changes: 1 addition & 1 deletion ext/OptimalControlModels/dielectrophoretic_particle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function OptimalControlProblems.dielectrophoretic_particle(
end

# initial guess
init = (state=[1, 1], control=0.1, variable=5)
init = (state=[1, 0.5], control=0.5, variable=8)

# discretise the optimal control problem
docp = direct_transcription(
Expand Down
2 changes: 1 addition & 1 deletion ext/OptimalControlModels_s/dielectrophoretic_particle_s.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function OptimalControlProblems.dielectrophoretic_particle_s(
end

# initial guess
init = (state=[1, 1], control=0.1, variable=5)
init = (state=[1, 0.5], control=0.5, variable=8)

# discretise the optimal control problem
docp = direct_transcription(
Expand Down
2 changes: 0 additions & 2 deletions src/OptimalControlProblems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ function make_list_of_problems()
problems_to_exclude = [
:bioreactor,
:cart_pendulum,
:dielectrophoretic_particle,
:moonlander,
:ducted_fan,
]
list_of_problems = setdiff(list_of_problems, problems_to_exclude)

Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ JuMP = "1"
MadNLPMumps = "0.5"
NLPModels = "0.21"
NLPModelsIpopt = "0.11"
OptimalControl = "1"
OptimalControl = "1.1"
Plots = "1"
Printf = "1"
Test = "1"
Binary file modified test/figures/init/dielectrophoretic_particle.pdf
Binary file not shown.
Binary file modified test/figures/init/ducted_fan.pdf
Binary file not shown.
Binary file modified test/figures/solution/dielectrophoretic_particle.pdf
Binary file not shown.
Binary file modified test/figures/solution/ducted_fan.pdf
Binary file not shown.
35 changes: 16 additions & 19 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,22 @@ const MAX_ITER = 1000
const MAX_WALL_TIME = 500.0

# Collect all the problems from OptimalControlProblems
list_of_problems = OptimalControlProblems.problems()
override_list_of_problems = false

# Remove from the tests the following problems
problems_to_exclude = [
# :bioreactor, # no need to remove here since already removed in OptimalControlProblems.jl
# :cart_pendulum, # no need to remove here since already removed in OptimalControlProblems.jl
# :dielectrophoretic_particle, # no need to remove here since already removed in OptimalControlProblems.jl
# :moonlander, # no need to remove here since already removed in OptimalControlProblems.jl
# :ducted_fan,
# :insurance,
# :robot,
# :space_shuttle,
# :steering,
]
list_of_problems = setdiff(list_of_problems, problems_to_exclude)
list_of_problems = if override_list_of_problems
[
# put here the problems to test
]
else
# Get all problems
all_problems = OptimalControlProblems.problems()

# list_of_problems = [
# :jackson,
# ]
# Remove from the tests the following problems
problems_to_exclude = [
# put here problems to exclude from the tests
]
setdiff(all_problems, problems_to_exclude)
end

# The list of all the problems to test
const LIST_OF_PROBLEMS = deepcopy(list_of_problems)
Expand Down Expand Up @@ -76,10 +73,10 @@ const VERBOSE = true # print or not details during tests
println("\nProblems that passed the tests: ");
display(LIST_OF_PROBLEMS_FINAL)
println("\nList of available problems: ");
display(problems());
display(OptimalControlProblems.problems());
println()

# @testset "available_problems" verbose=VERBOSE begin
# @test LIST_OF_PROBLEMS_FINAL == problems()
# @test LIST_OF_PROBLEMS_FINAL == OptimalControlProblems.problems()
# end
end
Loading