JuliaControl / ControlSystems.jl

A Control Systems Toolbox for Julia
https://juliacontrol.github.io/ControlSystems.jl/stable/
Other
503 stars 85 forks source link

named transfer functions #885

Closed mzaffalon closed 9 months ago

mzaffalon commented 9 months ago

Would you consider having named transfer functions and perhaps even moving named_ss from RobustAndOptimalControl.jl to ControlSystems.jl?

I am asking because the bodeplot gives generic names to the outputs and because for LTISystems, the default name is empty

baggepinnen commented 9 months ago

I have considered implementing a new StateSpace type that includes a lot of the functionality that is currently scattered across multiple different statespace types, such as

Unfortunately, moving the implementation of a function from ROC to CS cannot be done in a non-breaking way if we want to export the function from CS. I'm also hesitant bringing all that code into ControlSystems, the NamedStateSpace type is still quite immature with lots of problems in how it interacts with other system types and functions not handling it properly etc. I'm thus not yet ready to bring it here and signal that it's ready and stabe. RobustAndOptimalControl is still at version 0.x, which accurately signals that it's not quite as mature as ContorlSystems is.

What exactly is the problem with bodeplot, you should be able to set the names yourself using the regular Plots keywords?

As for named transfer functions, implementing such a type would be a ton of effort, the incomplete implementation of NamedStateSpace is already very long, and it still has a lot of gaps. Do you have a use case for which converting your transfer function to a statespace system wouldn't work?

mzaffalon commented 9 months ago

I understand.

No particular application in mind except for having the plots automatically add the label.

I also liked the ease with which one can build complicated connections used named_ss and wondered why one has to import an extra package for something that would ideally belong to ControlSystems.jl or even ControlSystemsBase.jl.

baggepinnen commented 9 months ago

Yeah, the reason there is simply that I don't want to put experimental and immature features in a package that aims at being stable and mature :)

Control engineers are often risk averse (for good reasons, we don't want planes falling out of the sky), so trying hard to signal stability and maturity is especially important for CS.jl.

baggepinnen commented 9 months ago

I should mention that there is nothing preventing you from implementing a package NamedTransferFuncitons.jl, as long as you extend the appropriate functions

The bodeplot will work as you want

mzaffalon commented 9 months ago

Ah, and the other reason was that RobustAndOptimalControl requires anyway ControlSystems. That said, you are the best person with an overview of the packages development.

As for you other comment: one should also extend TransferFunction to have entries for system, inputs and outputs names.