Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using inv when not necessary #85

Closed
cwrowley opened this issue Apr 19, 2016 · 1 comment
Closed

Avoid using inv when not necessary #85

cwrowley opened this issue Apr 19, 2016 · 1 comment
Labels

Comments

@cwrowley
Copy link
Contributor

As pointed out by @pmli in #27, instead of computing matrix inverses, better to use np.linalg.solve when needed.

murrayrm added a commit that referenced this issue May 30, 2016
@murrayrm
Copy link
Member

Addressed in PR #91, now merged into master.

slivingston added a commit that referenced this issue 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants