[ANN] New release of OptimalControl.jl

It is a pleasure to announce the new release of OptimalControl.jl (v1.1). Intended to solve optimal control problems on ODEs, the package features:

Give it a try, and if ever the syntax below does not look familiar enough :slightly_smiling_face:…

ocp = @def begin
    t ∈ [0, 1], time
    x ∈ R², state
    u ∈ R, control
    x(0) == [-1, 0]
    x(1) == [0, 0]
    xβ‚‚(t) ≀ 1.2
    ẋ(t) == [x₂(t), u(t)]
    0.5∫(u(t)^2) β†’ min
end

… ask your favorite AI to translate the math for you!

We welcome contributions and will be glad to get in touch at JuliaCon local in Paris next week :france:

15 Likes

Very nice! One comment I will make is that at a glance @def seems like an awfully generic macro. @optcontrol, @controlproblem or even just @problem would seem more appropriate to me.

4 Likes

Or perhaps @ocp, as the OCP is fairly common short for optimal control problem.

3 Likes

It is :smiling_face_with_tear:! Actually, we intended it to be generic, exactly as solve (generic name to call the solver using dispatch) of model (generic type name in other modellers)… or even @problem. This seems to be common practice in such a case, but that is of course debatable.

Thanks for the feedback

Actually, one can always prefix the (generic) macro name by the package (module): OptimalControl.@def. And then, I agree that OCP would be shorter. (Of course an alias can be defined after importing the package, so OCP = OptimalControl then OCP.@def works.)

@jbcaillau I agree with @zdenek_hurak.
A macro @ocp instead of @def is more explicit to define an optimal control problem.
Do you already use this macro for something else?

Otherwise I suggest to add this macro as an alias to @def. You keep backward compatibility (old macro @def still defined) but you have another macro more β€œexplicit” for new users.