diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 01f171f0..bb0d3e79 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 }} diff --git a/.github/workflows/Coverage.yml b/.github/workflows/Coverage.yml index 12a6ddb5..dce4a37a 100644 --- a/.github/workflows/Coverage.yml +++ b/.github/workflows/Coverage.yml @@ -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 }} diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index e8639ed9..17068f75 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -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 }} diff --git a/Project.toml b/Project.toml index 4d2022b9..f613dbd2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "OptimalControlProblems" uuid = "59046045-fb9c-4c23-964f-ff0a25704f96" authors = ["Olivier Cots "] -version = "0.4.0" +version = "0.5.0" [deps] ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" diff --git a/ext/JuMPModels/brachistochrone.jl b/ext/JuMPModels/brachistochrone.jl index 85fa7edc..f0ed3a54 100644 --- a/ext/JuMPModels/brachistochrone.jl +++ b/ext/JuMPModels/brachistochrone.jl @@ -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"] diff --git a/ext/JuMPModels/bryson_denham.jl b/ext/JuMPModels/bryson_denham.jl index 562b327a..875241d5 100644 --- a/ext/JuMPModels/bryson_denham.jl +++ b/ext/JuMPModels/bryson_denham.jl @@ -24,7 +24,6 @@ julia> model = OptimalControlProblems.bryson_denham(JuMPBackend(); N=100) # References """ - function OptimalControlProblems.bryson_denham( ::JuMPBackend, args...; @@ -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"] diff --git a/ext/JuMPModels/dielectrophoretic_particle.jl b/ext/JuMPModels/dielectrophoretic_particle.jl index 69777e33..75ab15ef 100644 --- a/ext/JuMPModels/dielectrophoretic_particle.jl +++ b/ext/JuMPModels/dielectrophoretic_particle.jl @@ -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 ) diff --git a/ext/MetaData/dielectrophoretic_particle.jl b/ext/MetaData/dielectrophoretic_particle.jl index 2a49a6b4..c377506f 100644 --- a/ext/MetaData/dielectrophoretic_particle.jl +++ b/ext/MetaData/dielectrophoretic_particle.jl @@ -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), ) diff --git a/ext/OptimalControlModels/dielectrophoretic_particle.jl b/ext/OptimalControlModels/dielectrophoretic_particle.jl index 9ec759ef..806a6501 100644 --- a/ext/OptimalControlModels/dielectrophoretic_particle.jl +++ b/ext/OptimalControlModels/dielectrophoretic_particle.jl @@ -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( diff --git a/ext/OptimalControlModels_s/dielectrophoretic_particle_s.jl b/ext/OptimalControlModels_s/dielectrophoretic_particle_s.jl index 2074f93a..c5485dcc 100644 --- a/ext/OptimalControlModels_s/dielectrophoretic_particle_s.jl +++ b/ext/OptimalControlModels_s/dielectrophoretic_particle_s.jl @@ -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( diff --git a/src/OptimalControlProblems.jl b/src/OptimalControlProblems.jl index 0ea8a857..03c0ea6f 100644 --- a/src/OptimalControlProblems.jl +++ b/src/OptimalControlProblems.jl @@ -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) diff --git a/test/Project.toml b/test/Project.toml index 945f79b9..4f44ffa5 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -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" diff --git a/test/figures/init/dielectrophoretic_particle.pdf b/test/figures/init/dielectrophoretic_particle.pdf index 5b94cbad..3bb12164 100644 Binary files a/test/figures/init/dielectrophoretic_particle.pdf and b/test/figures/init/dielectrophoretic_particle.pdf differ diff --git a/test/figures/init/ducted_fan.pdf b/test/figures/init/ducted_fan.pdf index 8818e64b..9eeb6874 100644 Binary files a/test/figures/init/ducted_fan.pdf and b/test/figures/init/ducted_fan.pdf differ diff --git a/test/figures/solution/dielectrophoretic_particle.pdf b/test/figures/solution/dielectrophoretic_particle.pdf index 01ab9a66..8575fe1d 100644 Binary files a/test/figures/solution/dielectrophoretic_particle.pdf and b/test/figures/solution/dielectrophoretic_particle.pdf differ diff --git a/test/figures/solution/ducted_fan.pdf b/test/figures/solution/ducted_fan.pdf index 050533f2..22258a0b 100644 Binary files a/test/figures/solution/ducted_fan.pdf and b/test/figures/solution/ducted_fan.pdf differ diff --git a/test/runtests.jl b/test/runtests.jl index e244203f..417eccf4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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) @@ -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