GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — update model_reduction to allow input/output selection + unstable warning (vs exception) by murrayrm · Pull Request #1074 · python-control/python-control Conversation
Member
This PR updates the
Specific updates:
This PR was motivated by an example from FBS2e (see steering.py), where I wanted to extract the dynamics of a subsystem (and the original system had an eigenvalue at the origin). It is possible to accomplish the same result by using the old implementation (assuming the exception is changed to a warning) and then indexing the system directly to handle the inputs and outputs, but it seemed natural to include in a single function call.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
coverage: 94.756% (+0.07%) from 94.689% |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good improvement! I made several stylistic and misprint-related comments. Else, ready to merge.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| eliminated or those to be kept. | ||
|
|
||
| Two methods of state reduction are possible: 'truncate' removes the | ||
| states marked for elimination, while 'matchdc' replaces the the |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| states marked for elimination, while 'matchdc' replaces the the | |
| states marked for elimination, while 'matchdc' replaces the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| unstable eigenvalues, since in those situations the stability reduced | ||
| order model may be different that the stability of the full model. No | ||
| other checking is done, so users to be careful not to render a system |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| unstable eigenvalues, since in those situations the stability reduced | |
| order model may be different that the stability of the full model. No | |
| other checking is done, so users to be careful not to render a system | |
| unstable eigenvalues, since in those situations the stability of the reduced | |
| order model may be different than the stability of the full model. No | |
| other checking is done, so users must be careful not to render a system |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| dico = 'C' | ||
| else: | ||
| raise NotImplementedError("Function not implemented in discrete time") | ||
| States, inputs, and outputs can be specified using integer offers or |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| States, inputs, and outputs can be specified using integer offers or | |
| States, inputs, and outputs can be specified using integer offsets or |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ({'elim_inputs': [0, 1, 2]}, 5, 3, 0), # no inputs | ||
| ({'elim_outputs': [0, 1, 2]}, 5, 0, 3), # no outputs | ||
| ({'elim_states': [0, 1, 2, 3, 4]}, 0, 3, 3), # no states | ||
| ({'elim_states': [0, 1], 'keep_states': [1, 2]}, None, None, None) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| See Also | ||
| -------- | ||
| balanced_reduction : Eliminate states using Hankel singular values. | ||
| minimal_realization : Eliminate unreachable or unobseravble states. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| minimal_realization : Eliminate unreachable or unobseravble states. | |
| minimal_realization : Eliminate unreachable or unobservable states. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| warnings.warn("System is unstable; reduction may be meaningless") | ||
|
|
||
| # Utility function to process keep/elim keywords | ||
| def _process_elim_or_keep(elim, keep, labels, allow_both=False): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Any reason to keep allow_both? _process_elim_or_keep() is a function defined only in the scope of model_reduction(), and all calls to it have the default allow_both value (allow_both=False).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| method : string | ||
| Method of removing states in `ELIM`: either 'truncate' or | ||
| 'matchdc'. | ||
| Method of removing states in `elim`: either 'truncate' or |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Method of removing states in `elim`: either 'truncate' or | |
| Method of removing inputs, outputs, and/or states: either 'truncate' or |
This is confusing because there is no elim parameter and because inputs and outputs can be removed as well, in addition to states.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will update, but this only applies to the way states are removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| """ | ||
| if not isinstance(sys, StateSpace): | ||
| raise TypeError("system must be a a StateSpace system") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| raise TypeError("system must be a a StateSpace system") | |
| raise TypeError("system must be a StateSpace system") |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.