ilayn / harold

An open-source systems and controls toolbox for Python3
MIT License
172 stars 19 forks source link

Performance issues for larger state space models #101

Open jamestjat opened 4 months ago

jamestjat commented 4 months ago

Statespace models are too slow in creation and method calls when A matrix order is ~1900. have attached two sets of matrices to reproduce the issue. ssm_a.zip ssm_w.zip

ilayn commented 4 months ago

Oh my, I didn't know I have users for this library. You are right, typically this is not made for large arrays since most operations are O(n**3) or more (I hope you are not using 1900th order Transfer Functions 😃 ) . I am planning to come back to this and perform a rewrite but most of my time is going to SciPy these days.

After we finally finish off https://github.com/scipy/scipy/issues/18566 I am hoping to do the overhaul. In the meantime, you can maybe give python-control a try ?

jamestjat commented 4 months ago

I am working with a large MIMO model that has 26 inputs and 36 outputs. The individual models within this system are at most 4th order. Deadtime in the models is stored as perfectly cancelling poles and zeros.

I tried using the python-control library, and it is working fine for my needs. Initially, I was looking for a way to avoid compiling Slycot, but I am now comfortable proceeding with it using Windows subsystem for Linux.