NLOptControl.jl icon indicating copy to clipboard operation
NLOptControl.jl copied to clipboard

A macro-based API

Open ChrisRackauckas opened this issue 7 years ago • 3 comments

Hey, Following up from some JuliaCon comments. The expression-based API is interesting, but I was thinking you should add a macro-based API on top of it. Essentially:

de = @ode_system begin
  x2
  u1 - 1.625
end

can create de=[:(x2[j]),:(u1[j]-1.625)] and it would be more natural than the user defining these themselves. It would also hide the implementation detail of the [j]. The lower level API using arrays of expressions would still exist for more advanced users to programmatically create expressions.

ChrisRackauckas avatar Aug 01 '17 04:08 ChrisRackauckas

@ChrisRackauckas I have been thinking more about this and was wondering how to go about doing this. Do you have any suggestions? I was looking at your odedef macro here and here and it looks pretty complicated, so I was wondering do you know how to do this easily or if I am starting with the wrong thing?

huckl3b3rry87 avatar Mar 06 '18 17:03 huckl3b3rry87

ParameterizedFunctions.jl gets hairy since there's so much other stuff involved, like inverse Jacobian calculations. We plan to cover optimal control in SciCompDSL.jl, which is the next DSL in construction and is designed to be cross platform. If you can take a look and weigh in on the things that are needed to do optimal control correctly then I'd be happy to make sure it's a good front-end for your needs.

ChrisRackauckas avatar Mar 06 '18 18:03 ChrisRackauckas

@ChrisRackauckas very cool! That would be great, thanks!

huckl3b3rry87 avatar Mar 06 '18 18:03 huckl3b3rry87