ilayn / harold

An open-source systems and controls toolbox for Python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SISO Behavior when multiplied with a matrix

ilayn opened this issue · comments

When a SISO Transfer() or State() multiplied with a p x m matrix, should it reject due to size mismatch or elementwise multiply with each element of the matrix P as if an overloaded Kronecker Product kron(P,G) ?

Currently rejected if systems are multiplied from the right. But for the left multiplication numpy tries element by element method and each entry of an array is allowed for SISO systems. The result becomes a numpy array with object dtype. Currently I don't know how to prevent this.

Since the api for matrix multiplication requires @ or dot(), and star is elementwise mult, right multiplication is also allowed now.

I've asked about this on SO but so far didn't receive any solution.

Thanks to the fine people of NumPy mailing list, I'll set __array_ufunc__ attribute on the representation classes to override ndarray.__mul__().

Finally...

this will require NumPy 1.13+ though I don't expect any objections anyways