Dynamic Optimization Solvers

Currently 4 backends are exposed for solving dynamic optimization problems using collocation: JuMP, InfiniteOpt, CasADi, and Pyomo.

Please note that there are differences in how to construct the collocation solver for the different cases. For example, the Python based ones, CasADi and Pyomo, expect the solver to be passed in as a string (CasADi and Pyomo come pre-loaded with Ipopt, but other solvers may need to be manually installed using pip or conda), while JuMP/InfiniteOpt expect the optimizer object to be passed in directly:

JuMPCollocation(Ipopt.Optimizer, constructRK4())
CasADiCollocation("ipopt", constructRK4())

JuMP and CasADi collocation require an ODE tableau to be passed in. These can be constructed by calling the constructX() functions from DiffEqDevTools. The list of tableaus can be found here. If none is passed in, both solvers will default to using Radau second-order with five collocation points.

Pyomo and InfiniteOpt each have their own built-in collocation methods.

  1. InfiniteOpt: The list of InfiniteOpt collocation methods can be found in the table on this page. If none is passed in, the solver defaults to FiniteDifference(Backward()), which is effectively implicit Euler.
  2. Pyomo: The list of Pyomo collocation methods can be found at the bottom of this page. If none is passed in, the solver defaults to a LagrangeRadau(3).

Some examples of the latter two collocations:

PyomoCollocation("ipopt", LagrangeRadau(2))
InfiniteOptCollocation(Ipopt.Optimizer, OrthogonalCollocation(3))
ModelingToolkit.JuMPCollocationFunction

JuMP Collocation solver. Takes two arguments:

  • solver: a optimization solver such as Ipopt
  • 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.
source
ModelingToolkit.InfiniteOptCollocationFunction

InfiniteOpt Collocation solver.

  • solver: an optimization solver such as Ipopt
  • 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()).
source
ModelingToolkit.CasADiCollocationFunction

CasADi Collocation solver.

  • solver: an optimization solver such as Ipopt. Should be given as a string or symbol in all lowercase, e.g. "ipopt"
  • 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.
source
ModelingToolkit.PyomoCollocationFunction

Pyomo Collocation solver.

  • solver: an optimization solver such as Ipopt. Should be given as a string or symbol in all lowercase, e.g. "ipopt"
  • derivative_method: a derivative method from Pyomo. The choices here are ForwardEuler, BackwardEuler, MidpointEuler, LagrangeRadau, or LagrangeLegendre. The last two should additionally have a number indicating the number of collocation points per timestep, e.g. PyomoCollocation("ipopt", LagrangeRadau(3)). Defaults to LagrangeRadau(5).
source
Missing docstring.

Missing docstring for CommonSolve.solve(::AbstractDynamicOptProblem). Check Documenter's build log for details.

Problem constructors

ModelingToolkit.JuMPDynamicOptProblemFunction
JuMPDynamicOptProblem(sys::System, op, tspan; dt, steps, guesses, kwargs...)

Convert an System representing an optimal control system into a JuMP model for solving using optimization. Must provide either dt, the timestep between collocation points (which, along with the timespan, determines the number of points), or directly provide the number of points as steps.

To construct the problem, please load InfiniteOpt along with ModelingToolkit.

source
ModelingToolkit.InfiniteOptDynamicOptProblemFunction
InfiniteOptDynamicOptProblem(sys::System, op, tspan; dt)

Convert an System representing an optimal control system into a InfiniteOpt model for solving using optimization. Must provide dt for determining the length of the interpolation arrays.

Related to JuMPDynamicOptProblem, but directly adds the differential equations of the system as derivative constraints, rather than using a solver tableau.

To construct the problem, please load InfiniteOpt along with ModelingToolkit.

source
ModelingToolkit.CasADiDynamicOptProblemFunction
CasADiDynamicOptProblem(sys::System, op, tspan; dt, steps, guesses, kwargs...)

Convert an System representing an optimal control system into a CasADi model for solving using optimization. Must provide either dt, the timestep between collocation points (which, along with the timespan, determines the number of points), or directly provide the number of points as steps.

To construct the problem, please load CasADi along with ModelingToolkit.

source
ModelingToolkit.PyomoDynamicOptProblemFunction
PyomoDynamicOptProblem(sys::System, op, tspan; dt, steps)

Convert an System representing an optimal control system into a Pyomo model for solving using optimization. Must provide either dt, the timestep between collocation points (which, along with the timespan, determines the number of points), or directly provide the number of points as steps.

To construct the problem, please load Pyomo along with ModelingToolkit.

source