GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Passivity indices and support for discrete time systems. by Mark-Yeatman · Pull Request #750 · python-control/python-control

Conversation

@Mark-Yeatman

@Mark-Yeatman Mark-Yeatman commented Jul 18, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mark-Yeatman added 13 commits June 18, 2022 00:50
@Mark-Yeatman
Add support for discrete time system to ispassive.
8e40e0f
@Mark-Yeatman
Save some work on implementing passivity indices,
7d4b5f2
my source for the algorithm only considers square, minimal systems.
@Mark-Yeatman
Catch cases with dimension mismatch between input and outputs.
941b673
@Mark-Yeatman
Add support for input/output passivity indices.
1ef69f6
@Mark-Yeatman
Clean up.
30f859a
@Mark-Yeatman
Run autopep8 formatter.
caa2614
@Mark-Yeatman
Add getPassiveIndex function.
b249ac4
@Mark-Yeatman
Test commit.
439134f
@Mark-Yeatman
Rework passivity indices so that unit tests pass.
b7adf47
@Mark-Yeatman
Remove development print statement.
c5dc526
@Mark-Yeatman
Finally getting correct values for passivity indices, source paper ha…
6db437d
…d a typo.
@Mark-Yeatman
Add passivity indices for discrete system and unit tests.
b331e75
@Mark-Yeatman
Remove commented code.
8d7c75b
@Mark-Yeatman

This comment was marked as resolved.

Sign in to view
@Mark-Yeatman
Actually remove commented code.
f837542
@bnavigator

This comment was marked as resolved.

Sign in to view
@bnavigator bnavigator mentioned this pull request Jul 18, 2022
Slycot source uses setuptools_scm now #751
Merged
bnavigator
bnavigator reviewed Jul 18, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/tests/passivity_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/tests/rlocus_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 18, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
Merge branch 'main' into yeatman-pr750
ef25304
@bnavigator

This comment was marked as resolved.

Sign in to view
Mark-Yeatman added 5 commits July 18, 2022 10:03
@Mark-Yeatman
Code cleanup.
b7a79c1
@Mark-Yeatman
Merge branch 'main' of https://github.com/Mark-Yeatman/python-control
fd04e75
@Mark-Yeatman
Merge branch 'main' into passivity-tools
dc63332
@Mark-Yeatman
Merge branch 'passivity-tools' of https://github.com/Mark-Yeatman/pyt…
a150a90
…hon-control into passivity-tools
@Mark-Yeatman
Use more specific exceptions.
0bf1003
bnavigator
bnavigator reviewed Jul 18, 2022
View reviewed changes
Comment thread control/tests/passivity_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 18, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Mark-Yeatman
Better doc string, use more specific exceptions in pytest.
7132945
murrayrm
murrayrm reviewed Jul 18, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Mark-Yeatman

Mark-Yeatman commented Jul 26, 2022

Copy link
Copy Markdown
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.

bnavigator reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mark-Yeatman
Add that last bit of test coverage.
e5c0f1b
@murrayrm

murrayrm commented Jul 26, 2022 •
edited by bnavigator
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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?

Mark-Yeatman reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 26, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 26, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 26, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Mark-Yeatman added 3 commits July 26, 2022 21:13
@Mark-Yeatman
Clean up some unused function inputs, update doc string.
8bd658f
@Mark-Yeatman
Add passivity module to __init__.py and Sphinx documentation.
ffd0837
@Mark-Yeatman
Fix import name collision.
9234188
murrayrm
murrayrm reviewed Jul 27, 2022
View reviewed changes

@murrayrm murrayrm left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this 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..).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/control.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 27, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Jul 27, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread control/tests/passivity_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Mark-Yeatman added 5 commits July 27, 2022 12:03
@Mark-Yeatman
Improve sphinx docs and function doc strings.
5a3245f
@Mark-Yeatman
Pull some helper functions into _solve_passivity_LMI.
01b5591
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.
@Mark-Yeatman
Add function I/O description to doc string for _solve_passivity_LMI.
d9cb828
@Mark-Yeatman
Change _solve_passivity_LMI to solve_passivity_LMI, include in __all__.
32e9b24
Add even more detail to doc strings.
@Mark-Yeatman
Change functions to compute passivity indices to return RuntimeErrors…
f4809d9
… instead of -inf when infeasible.

(I'm not sure how to trigger this code for unit testing, mostly a just-in-case.
bnavigator
bnavigator reviewed Jul 28, 2022
View reviewed changes
Comment thread control/passivity.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Mark-Yeatman added 3 commits July 28, 2022 14:59
@Mark-Yeatman
Add reminders for future implementation.
4a95fa3
@Mark-Yeatman
Update documentation so that math renders and organization is better.
2c2d25a
@Mark-Yeatman
Fix doc string.
0b0d692
@Mark-Yeatman

Mark-Yeatman commented Jul 30, 2022

Copy link
Copy Markdown
Contributor Author

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

Is there a name for what this is?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mark-Yeatman
Remove test code.
fdaab42
@bnavigator

bnavigator commented Jul 30, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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""".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mark-Yeatman

Mark-Yeatman commented Jul 30, 2022

Copy link
Copy Markdown
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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@murrayrm

murrayrm commented Jul 30, 2022

Copy link
Copy Markdown
Member

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

Mark-Yeatman reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
remove some lint, enforce numpydoc
2f88778
@bnavigator

bnavigator commented Jul 30, 2022

Copy link
Copy Markdown
Contributor

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

Mark-Yeatman reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

Reviewers

@murrayrm murrayrm murrayrm left review comments
@bnavigator bnavigator bnavigator left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.9.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Mark-Yeatman @bnavigator @coveralls @murrayrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.