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
Convert an System representing an optimal control system into a CasADi model
68
-
for solving using optimization. Must provide either `dt`, the timestep between collocation
69
-
points (which, along with the timespan, determines the number of points), or directly
70
-
provide the number of points as `steps`.
71
-
72
-
The optimization variables:
73
-
- a vector-of-vectors U representing the unknowns as an interpolation array
74
-
- a vector-of-vectors V representing the controls as an interpolation array
75
-
76
-
The constraints are:
77
-
- The set of user constraints passed to the System via `constraints`
78
-
- The solver constraints that encode the time-stepping used by the solver
79
-
"""
80
-
function MTK.CasADiDynamicOptProblem(sys::System, u0map, tspan, pmap;
64
+
function MTK.CasADiDynamicOptProblem(sys::ODESystem, u0map, tspan, pmap;
81
65
dt =nothing,
82
66
steps =nothing,
83
67
guesses =Dict(), kwargs...)
@@ -212,15 +196,11 @@ function add_solve_constraints!(prob::CasADiDynamicOptProblem, tableau)
212
196
solver_opti
213
197
end
214
198
215
-
"""
216
-
CasADi Collocation solver.
217
-
- solver: an optimization solver such as Ipopt. Should be given as a string or symbol in all lowercase, e.g. "ipopt"
218
-
- tableau: An ODE RK tableau. Load a tableau by calling a function like `constructRK4` and may be found at https://docs.sciml.ai/DiffEqDevDocs/stable/internals/tableaus/. If this argument is not passed in, the solver will default to Radau second order.
function MTK.fixed_t_map(model::InfiniteOptModel, x_ops, c_ops, exprs)
138
111
Dict([[x_ops[i] => model.U[i] for i in1:length(model.U)];
139
112
[c_ops[i] => model.V[i] for i in1:length(model.V)]])
@@ -191,22 +164,12 @@ function add_solve_constraints!(prob::JuMPDynamicOptProblem, tableau)
191
164
end
192
165
end
193
166
194
-
"""
195
-
JuMP Collocation solver.
196
-
- solver: a optimization solver such as Ipopt
197
-
- tableau: An ODE RK tableau. Load a tableau by calling a function like `constructRK4` and may be found at https://docs.sciml.ai/DiffEqDevDocs/stable/internals/tableaus/. If this argument is not passed in, the solver will default to Radau second order.
- `derivative_method`: 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()).
0 commit comments