baggepinnen / ControlSystemIdentification.jl

System Identification toolbox, compatible with ControlSystems.jl
https://baggepinnen.github.io/ControlSystemIdentification.jl/dev
MIT License
130 stars 13 forks source link

Generate a model from a known impulse/step response #121

Closed GHE-HS closed 1 year ago

GHE-HS commented 1 year ago

The examples on how to identify a system from data are pretty clear. However, I found nothing on creating a transfer function/state space representation given an impulse/step response.

I understand that it's almost too simple, but certain models are primarily expressed in those terms, and playing with them in this (great) ecosystem requires a way to input them.

Is there a clean way to do it? I looked also quite a lot into ControlSystems.jl, without success either.

Thank you !

baggepinnen commented 1 year ago

Have a look at era

era ("Eigenvalue realization algorithm") is often used together with okid where the latter estimtes the Markov parameters (impulse response) and the former takes those and estimates a statespace model. If you have the Markov parameters already, you call era directly.

The function expects the Markov parameters as a 3D array with the dimensions n_out×n_in×n_time. You might have to fiddle a bit with the r,m,n parameters to get a good model.