OptControl.jl is a interface that use symbols to build optimal control problem based on ModelingToolkit.jl, and then transforms optimal control problem to:
- Differential Equations Problems(DEP)
- Optimzation Problems(OP)
DEP can be solved by DifferentialEquations.jl and OP can be solved by JuMP.jl
An example of optimal control problem:
And use OptControl.jl
to transform it to JuMP
code to solve it.
using ModelingToolkit,OptControl
@variables t u x[1:2]
f = [0 1; 0 0] * x + [0, 1] * u
L = 0.5 * u^2
t0 = [1.0, 1.0]
tf = [0.0, 0.0]
tspan = (0.0, 2.0)
N = 100
sol = generateJuMPcodes(L, f, x, u, tspan, t0, tf; N=N)
See document for more information.