Skip to content

Passivity indices and support for discrete time systems. #750

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

Merged
merged 40 commits into from
Jul 30, 2022

Conversation

Mark-Yeatman
Copy link
Contributor

@Mark-Yeatman Mark-Yeatman commented Jul 18, 2022

This adds support for input and output passivity indices and "is passive or not" for discrete time systems.

@Mark-Yeatman

This comment was marked as resolved.

@bnavigator

This comment was marked as resolved.

@bnavigator

This comment was marked as resolved.

@Mark-Yeatman
Copy link
Contributor Author

@bnavigator I've split get_passivity_index() into get_output_fb_index() and get_input_ff_index(). I've also removed all the weird conditionals in ispassive(), it just has one code path now. I kept all the nu's and rho's in _solve_passivity_LMI() because it's easier to match the syntax from the source paper that way IMO.

@murrayrm
Copy link
Member

murrayrm commented Jul 26, 2022

It looks like the passivity module is not (yet) loaded in __init__.py. You should probably do that, so people don't have to import that passivity module explicitly (which allows ct.ispassive(sys)). Also, we should update the Sphinx documentation to include ispassive in the list of functions that are implemented (in doc/control.rst).

Other than that, looks ready to go?

Copy link
Member

@murrayrm murrayrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More small things to fix (sorry I didn't notice these on my previous pass..).

Add more detailed and clear comments and doc strings.
Fix correctness of _solve_passivity_LMI for inputing values for both
input and output passivity indices. Allow checking of passivity using ispassive given
values for input and ouput passivity indices.
… instead of -inf when infeasible.

(I'm not sure how to trigger this code for unit testing, mostly a just-in-case.
@Mark-Yeatman
Copy link
Contributor Author

You actually need the r""" here or have to use double backslashes below.

Is there a name for what this is?

@bnavigator
Copy link
Contributor

bnavigator commented Jul 30, 2022

Is there a name for what this is?

"longstring stringliteral with raw stringprefix" or "raw triple-quoted strings"

PEP 257:

For consistency, always use """triple double quotes""" around docstrings. Use r"""raw triple double quotes""" if you use any backslashes in your docstrings. For Unicode docstrings, use u"""Unicode triple-quoted strings""".

@Mark-Yeatman
Copy link
Contributor Author

Is there a name for what this is?

"longstring stringliteral with raw stringprefix" or "raw triple-quoted strings"

PEP 257:

For consistency, always use """triple double quotes""" around docstrings. Use r"""raw triple double quotes""" if you use any backslashes in your docstrings. For Unicode docstrings, use u"""Unicode triple-quoted strings""".

Noice

@murrayrm
Copy link
Member

@Mark-Yeatman @bnavigator This looks like it is ready to merge? Anything else planned?

@bnavigator
Copy link
Contributor

Thanks @Mark-Yeatman! Looking forward to future pull request with further enhancements of this module.

@bnavigator bnavigator merged commit a19c501 into python-control:main Jul 30, 2022
@murrayrm murrayrm added this to the 0.9.3 milestone Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants