You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scalar / Array mismatches in iosys not compatible with NumPy 1.24 #853
When I run the code of the prey example, in particular the linearization, lin_predprey = ct.linearize(io_predprey, xeq, 0)
I get the following error ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
After analyzing the code, I think the origin of the error is that in predprey_rhs() dH is of type numpy arrary, while dL is not.
I think others ones are much deeper in the code than me. That is why I post this topic instead of a pull request.
Maybe a type check with dummy input/output data already solves these kind of issues when initializing the constructor. I think such a feature could save people some time.
Best,
codeFighter2022
Python: 3.810
Control: 0.9.3.post2
I installed the toolbox via pip
changed the title [-]Avoid ragged shapes in linearize() / iosys[/-][+]Scalar / Array mismatches in iosys not compatible with NumPy 1.24[/+]on Jan 26, 2023
Activity
bnavigator commentedon Jan 26, 2023
When executing the example:
[-]Avoid ragged shapes in linearize()[/-][+]Avoid ragged shapes in linearize() / iosys[/+]bnavigator commentedon Jan 26, 2023
This would fix the error:
Documentation says, that the update function's
umust be an array. As well as theueqfor linearize:python-control/control/iosys.py
Lines 2198 to 2214 in 55730b6
Strictly speaking, the zero
us from the example would not be allowed:But we have this:
python-control/control/iosys.py
Lines 547 to 551 in 55730b6
[-]Avoid ragged shapes in linearize() / iosys[/-][+]Scalar / Array mismatches in iosys not compatible with NumPy 1.24[/+]bnavigator commentedon Jan 26, 2023
The test suite has a different predprey model:
python-control/control/tests/iosys_test.py
Lines 1558 to 1571 in c3488cd