-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MathematicalSystems #159
Comments
Thanks for the comment, we will take a look at it. This seems effectively a nice idea. |
@blegat Hi Benoît, many thanks for the feedback. Sure, it definitely makes sense to be able to exchange between various high level representations / modelling formats. We were aware of MTK.jl, not of MathematicalSystems.jl which looks very nice and general. Two points here: (i) The plus state constraints,
For instance, how would you describe this example (I hope the description is transparent enough 🤞🏾) with MathematicalSystems.jl? @def ocp begin
tf ∈ R, variable
t ∈ [ 0, tf ], time
x ∈ R², state
u ∈ R, control
tf ≥ 0
-1 ≤ u(t) ≤ 1
q = x₁
v = x₂
q(0) == 1
v(0) == 2
q(tf) == 0
v(tf) == 0
0 ≤ q(t) ≤ 5
-2 ≤ v(t) ≤ 3
(q^2 + v^2 + u^2)(t) ≤ 100
ẋ(t) == [ v(t), u(t) ]
tf → min
end (ii) A strong motivation for us to map OptimalControl.jl models towards other descriptions is the availability of associated optimal control solvers; or, more specifically, of discretisation tools from an abstract optimal control description towards a mathematical program (that can eventually feed an optimisation solver). Are such tools available in MathematicalSystems.jl ecosystem? |
The aim in MathematicalSystems.jl has been to make it as thin or lightweight as possible, yet with expressive power to specialize on system types if the developer needs so (hence the ugly struct names, though there is a macro meant to simplify the process of defining the system). Addressing some of your questions:
|
Hi @mforets ; thanks for the input. I see that there are indeed some discretisation features for affine control systems. Going to general nonlinear systems is key to us (most of our applications are indeed from nonlinear optimal control), plus having a good blend of differential geometric tools to address both direct and indirect methods. There has been very nice progress on top of JuMP with InfiniteOpt.jl, though the description remains a bit far from what a mathematician would write (*). That the DSL is smoothly operating with efficient solvers (optimisation, in particular) is also very important for us. At the moment, this is not completely true for MTK, e.g. Convergence will occur 🤞🏾 (*) Compare, e.g., this example with this: using OptimalControl
ρ = 0.025 # discount rate
k = 100.0 # utility bliss point
T = 10.0 # life horizon
r = 0.05 # interest rate
B₀ = 100.0 # endowment
u(c; k=k) = -(c - k)^2 # utility function
@def ocp begin
t ∈ [ 0, T ], time
B ∈ R, state
c ∈ R, control
B(0) == B₀
B(T) == 0
Ḃ(t) == r * B(t) - c(t)
∫( exp(-ρ * t) * u(c(t)) ) → max
end
sol = solve(ocp; grid_size=1_000)
plot(sol) |
There is a common system representation that is shared by a few control projects such as JuliaReach and Dionysos.jl in https://github.com/JuliaReach/MathematicalSystems.jl/. As discussed after your talk in Paris, it would be useful if OptimalControl.jl was supporting the system to be representing in this form.
cc @adrienbanse @schillic @mforets
The text was updated successfully, but these errors were encountered: