Skip to content

Commit 6b33148

Browse files
authored
Merge pull request #168 from control-toolbox/167-bug-max-objective-with-exa
[Bug] Max objective for exa
2 parents 8fc341c + e9cbea8 commit 6b33148

35 files changed

+27
-41
lines changed

docs/problems.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function generate_documentation(
116116
nlp_oc_sol = NLPModelsIpopt.ipopt(nlp_oc; max_iter=0)
117117
118118
# Build OptimalControl solution
119-
ocp_sol = build_ocp_solution(docp, nlp_oc_sol)
119+
ocp_sol = build_OCP_solution(docp, nlp_oc_sol)
120120
121121
# get dimensions
122122
n = state_dimension(ocp_oc)
@@ -292,7 +292,7 @@ function generate_documentation(
292292
function print_numerical_comparisons(problem, docp, nlp_oc_sol, nlp_jp)
293293
294294
# get relevant data from OptimalControl model
295-
ocp_sol = build_ocp_solution(docp, nlp_oc_sol)
295+
ocp_sol = build_OCP_solution(docp, nlp_oc_sol)
296296
t_oc = time_grid(ocp_sol)
297297
x_oc = state(ocp_sol).(t_oc)
298298
u_oc = control(ocp_sol).(t_oc)
@@ -376,7 +376,7 @@ function generate_documentation(
376376
377377
```@example main
378378
# build an ocp solution to use the plot from OptimalControl package
379-
ocp_sol = build_ocp_solution(docp, nlp_oc_sol)
379+
ocp_sol = build_OCP_solution(docp, nlp_oc_sol)
380380
381381
# dimensions
382382
n = state_dimension(ocp_sol)

docs/src/tutorial-solve.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ nlp_sol.objective
4949
To recover the state, control, and costate, we recommend building an optimal control solution and using the associated getters (you can also retrieve the number of iterations and the objective value from the OCP solution):
5050

5151
```@example main
52-
ocp_sol = build_ocp_solution(docp, nlp_sol)
52+
ocp_sol = build_OCP_solution(docp, nlp_sol)
5353
5454
t = time_grid(ocp_sol) # t0, ..., tN = tf
5555
x = state(ocp_sol) # function of time

src/OptimalControlProblems.jl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,6 @@ using OrderedCollections: OrderedDict
2121
using SolverCore
2222
import ADNLPModels: ADNLPModels, ADNLPModel
2323

24-
# -----------------
25-
# SHOULD NO BE HERE ("triiiiiiiiiiiiiiit !!!" - bruit de sifflet)
26-
function build_ocp_solution(
27-
docp::CTDirect.DOCP, nlp_solution::SolverCore.AbstractExecutionStats
28-
)
29-
nlp_model_backend = if docp.nlp isa ADNLPModel
30-
CTDirect.ADNLPBackend()
31-
elseif docp.nlp isa ExaModel
32-
CTDirect.ExaBackend()
33-
else
34-
throw(CTBase.IncorrectArgument("The NLP model is of unknown type."))
35-
end
36-
return CTDirect.build_OCP_solution(docp, nlp_solution; nlp_model=nlp_model_backend)
37-
end
38-
39-
export build_ocp_solution
40-
#
41-
4224
"""
4325
$(TYPEDEF)
4426

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Ipopt = "1"
2222
JuMP = "1"
2323
MadNLPMumps = "0.5"
2424
NLPModels = "0.21"
25-
NLPModelsIpopt = "0.10"
25+
NLPModelsIpopt = "0.11"
2626
OptimalControl = "1"
2727
Plots = "1"
2828
Printf = "1"

test/figures/init/beam.pdf

0 Bytes
Binary file not shown.

test/figures/init/chain.pdf

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

test/figures/init/ducted_fan.pdf

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

test/figures/init/glider.pdf

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)