Enable simulation of MIMO systems #2862

Open
wants to merge 2 commits into
from

5 participants

@pathim

Until now lsim2 was unable to simulate MIMO systems because lti tried to create tf and zpk representations. Those cannot be created for multiple input systems. The transformation is now skipped if there is more than one input.

Additionally the fprime function used a transposed version of the input. This is fixed now.

I added a test to test_ltisys.py testing the simulation of a two-input-two-output system, where the output is simply a copy of the input. All previous tests still pass. Behaviour for single input systems has not changed, so no working existing code should break.

pathim added some commits Sep 13, 2013
@pathim pathim Added failing test for MIMO systems. 8f9483e
@pathim pathim Made MIMO system test pass
MI systems no longer get tf or zpk representations.
Input had to be transposed in the simulation function.
5e36974
@rgommers
SciPy member

Thanks @pathim. Something should be added to the docs about MIMO systems I think. And then it should either work for all functions or for none of them. I'm guessing this patch doesn't address all functions (haven't checked yet), but that's OK if we explicitly list what's not yet working and open a new issue for that.

Related issue: gh-2669.

@Juanlu001

Actually, when I last touched this (#2655) I suggested getting rid altogether of computing the tf and zpk representations of the object and just storing the ss one, which is more general. We could just retrieve tf and zpk when needed.

@rgommers
SciPy member

@Juanlu001 that's still a good idea I think but I'm not sure it should be part of this PR or prevent it from being merged. Since functions like freqs work with tf input only right now, the whole module needs an overhaul to really make recomputing on demand have an effect. I actually put something like this (less conversions) on the 1.0 roadmap for ltisys.

@rgommers
SciPy member

I've pushed a rebase and style cleanup at https://github.com/rgommers/scipy/tree/pr/2862. There's something not quite right with this fix though it looks like after some testing - the two issues at gh-2669 aren't fixed by this. Don't quite understand why so quickly, needs looking into.

@rgommers rgommers self-assigned this Feb 28, 2014
@rgommers rgommers modified the milestone: 0.15.0, 0.14.0 Feb 28, 2014
@pv pv removed the PR label Aug 13, 2014
@pv
SciPy member
pv commented Nov 22, 2014

Apparently this has some unresolved issues, so detaching milestone

@pv pv removed this from the 0.15.0 milestone Nov 22, 2014
@ev-br ev-br referenced this pull request Apr 27, 2015
Merged

Fix lsim #4675

@argriffing

There's something not quite right with this fix though it looks like after some testing - the two issues at gh-2669 aren't fixed by this. Don't quite understand why so quickly, needs looking into.

The issue #2669 has been closed by #3862. Should this PR be closed?

@rgommers
SciPy member

@argriffing not sure if we should close this. There's something useful here, but it's incomplete. Getting MIMO systems to work in ltisys functions would be useful. Maybe the new lti subclasses in gh-4576 will also move this in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment