You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The solver constraints that encode the time-stepping used by the solver
35
50
"""
36
51
function MTK.JuMPControlProblem(sys::ODESystem, u0map, tspan, pmap; dt =error("dt must be provided for JuMPControlProblem."), guesses =Dict(), kwargs...)
@warn"The JuMPControlProblem is overdetermined. The total number of conditions (# constraints + # fixed initial values given by u0map) exceeds the total number of states. The solvers will default to doing a nonlinear least-squares optimization."
55
+
@warn"The control problem is overdetermined. The total number of conditions (# constraints + # fixed initial values given by u0map) exceeds the total number of states. The solvers will default to doing a nonlinear least-squares optimization."
Convert an ODESystem representing an optimal control system into a InfiniteOpt model
70
+
for solving using optimization. Must provide `dt` for determining the length
71
+
of the interpolation arrays.
72
+
73
+
Related to `JuMPControlProblem`, but directly adds the differential equations
74
+
of the system as derivative constraints, rather than using a solver tableau.
75
+
"""
76
+
function MTK.InfiniteOptControlProblem(sys::ODESystem, u0map, tspan, pmap; dt =error("dt must be provided for InfiniteOptControlProblem."), guesses =Dict(), kwargs...)
@warn"The control problem is overdetermined. The total number of conditions (# constraints + # fixed initial values given by u0map) exceeds the total number of states. The solvers will default to doing a nonlinear least-squares optimization."
@@ -202,7 +265,6 @@ function DiffEqBase.solve(prob::JuMPControlProblem, jump_solver, ode_solver::Sym
202
265
model = prob.model
203
266
tableau_getter =Symbol(:construct, ode_solver)
204
267
@eval tableau =$tableau_getter()
205
-
ts =supports(model[:t])
206
268
207
269
# Unregister current solver constraints
208
270
for con inall_constraints(model)
@@ -218,23 +280,36 @@ function DiffEqBase.solve(prob::JuMPControlProblem, jump_solver, ode_solver::Sym
218
280
end
219
281
end
220
282
add_solve_constraints!(prob, tableau)
283
+
_solve(prob, jump_solver, ode_solver)
284
+
end
221
285
286
+
"""
287
+
`derivative_method` kwarg refers to the method used by InfiniteOpt to compute derivatives. The list of possible options can be found at https://infiniteopt.github.io/InfiniteOpt.jl/stable/guide/derivative/. Defaults to FiniteDifference(Backward()).
288
+
"""
289
+
function DiffEqBase.solve(prob::InfiniteOptControlProblem, jump_solver; derivative_method = InfiniteOpt.FiniteDifference(Backward()))
0 commit comments