Rory ss static pole by roryyorke · Pull Request #110 · python-control/python-control

@slivingston self-assigned this

Sep 11, 2016

slivingston

This was referenced

Dec 27, 2016
…cts.

Allows StateSpace([],[],[],D), which failed previously.  Static gains
have sizes enforced as follows: A 0-by-0, B 0-by-ninputs, C
noutputs-by-0.

Tests added for instantiation, and sum, product, feedback, and appending,
of 1x1, 2x3, and 3x2 static gains StateSpace objects.
On Python 2.7, the special case "all states useless" in
_remove_useless_states resulted in A=[[0]] (and similarly for B and C).

The special case is no longer needed, since empty A, B, C matrices can
be handled.  numpy.delete does the right thing w.r.t. matrix
sizes (e.g., deleting all columns of a nxm matrix gives an nx0 matrix).

Added test for this.
Do this by only calling Slycot's tb01pd for non-static systems.

@roryyorke

slivingston added a commit that referenced this pull request

Dec 28, 2016

@slivingston

slivingston added a commit that referenced this pull request

Dec 31, 2016
#101

Changes are from branch `master` of
https://github.com/mp4096/python-control.git

There was merge conflict in how a for-loop was refactored into
`map` (here) vs. list comprehension (from PR #110).

I compared the two alternatives using %timeit of Jupyter for matrices
that would correspond to LTI systems with 10 state dimensions, 2
inputs, 2 outputs (so, the A matrix has shape (10, 10), B matrix has
shape (10,2), etc.), and with 100 state dimensions, 20 inputs,
20 outputs, all using matrices from numpy.random.random((r,c)).

The difference in timing performance does not appear
significant. However, the case of `map` was slightly faster
(approximately 500 to 900 ns less in duration), so I decided to use
that one to resolve the merge conflict.