Description
I typically use many different loss functions for the same control system / model. Defining the loss function once for each ControlSystem
is a bit limiting, because I can't define one common System
(model) for a bunch of analysis cases.
For reference, I've extended ModelingToolkit
to PolynomialGTM
. Right now, I'm representing the model aircraft dynamics as an ODESystem
. It would be great to instead represent this model as a ControlSystem
because I could then separate states and controls. But I have no common loss function I'd want to use as a default. I'd prefer not to make a factory function, since lots of controls analysis is not optimal control analysis.
Would changing ControlSystem
to OptimalControlSystem
, and then introducing a new struct ControlSystem <: AbstractControlSystem
be appropriate here? The new ControlSystem
type would have all of the same fields, except for the loss function. The generate_jacobian
and calculate_jacobian
functions would essentially produce the symbolic "A" matrix (the homogeneous dynamics), and we could add functions to generate the full symbolic state space model pretty easily.
This is a breaking change, obviously feel free to throw this out. I do think that non-optimal control problem modeling would be a valuable addition to ModelingToolkit.jl
, and I'm definitely interested in helping out with that.