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 — Improve lft functions and lft documentation by tomaantjes · Pull Request #1249 · python-control/python-control

Conversation

@tomaantjes

@tomaantjes tomaantjes commented Sep 14, 2026

Copy link
Copy Markdown

This PR aims to solve #1156 by updating the current ss.lft function, adding a general lft function and adding more documentation.

Summary of main changes:

  • Addition of new lft function with signature lft(sys1, sys2, [nu, ny], **kwargs) which can be used for any InputOutputSystem due to the use of interconnect if no statespace conversion is possible.
  • Addition of preserving input and output signal names of the transformed system when using both the statespace and new lft function.
  • Made docstring of ss.lft() self-contained. Here I added a new reference to a paper as the old one refers to a chapter (A.7) in the second edition of Skogestad which in mine does not discuss LFT's (chapter A.8 is about LFT's but does not contain an explanation of the star product). A reference to the star product does exist in the first edition but I thought this paper was more focused on the topic and also easier to find.
  • Added narrative documentation for lft function.
  • Added references to lft function in appropriate places.

AI Disclosure:
Claude was used to proofread and suggest corrections for documentation and verify the documentation and code compliance with the developer standards. Additionally, it was used to assess test coverage and draft some unittests after implementation of the test scaffolding. All suggestions were reviewed, understood and manually tested.

Sorry, something went wrong.

Uh oh!

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

All reactions
tomaantjes added 19 commits September 13, 2026 19:54
@tomaantjes
propagate and allow overriding of signal labels in StateSpace lft fun…
23dc966
…ction
@tomaantjes
add a check for validity of given nu and ny variables to statespace l…
e6a3e1b
…ft function
@tomaantjes
update Statespace lft function docstring to directly reflect its func…
37153cf
…tionality and update reference
@tomaantjes
add general lft function that can be used with any InputOutputSystem
6007d4d
@tomaantjes
add lft function to kwarg tests
47205b1
@tomaantjes
add unittests for lft function with LTI systems
6776e2d
@tomaantjes
add unittest for lft function with general InputOutputSystem input
bb06493
update iosys_test test_lft docstring
@tomaantjes
add lft to function reference
d74973d
@tomaantjes
add narrative documentation for lft function
1694287
@tomaantjes
make lft be able to use scalar, array and tf inputs
3c9752f
@tomaantjes
add lft to see also of other bdalg functions
351ba99
@tomaantjes
reorder checks to be more logical in lft function
b72c3e0
@tomaantjes
compute maximal values before dimension check in ss.lft
3262a35
@tomaantjes
reorder bdalg lft tests
2f65871
@tomaantjes
add examples to lft functions
4cc8e24
@tomaantjes
fallback to default names if duplicate input or output names occur af…
842a10c
…ter performing lft
@tomaantjes
make definition of ny and nu more general in lft docstrings
7522036
@tomaantjes
align FRD and non-LTI system input error test for lft function
66d1f20
@tomaantjes
remove unnecessary blank line
d2264c6
@slivingston
slivingston self-requested a review September 15, 2026 00:32
@coveralls

coveralls commented Sep 15, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

coverage: 94.782% (+0.03%) from 94.757% — tomaantjes:improve-lft-functions into python-control:main

All reactions

Sorry, something went wrong.

Uh oh!

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

slivingston
slivingston requested changes Sep 15, 2026
View reviewed changes

@slivingston slivingston 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.

Thanks for proposing this. Some tests fail when Slycot is not installed, e.g.,

FAILED control/tests/bdalg_test.py::TestLft::test_lft_tf_inputs[-1--1] - control.exception.ControlMIMONotImplemented: MIMO system conversion not supported without Slycot
FAILED control/tests/bdalg_test.py::TestLft::test_lft_tf_inputs[1-1] - control.exception.ControlMIMONotImplemented: MIMO system conversion not supported without Slycot

Can you fix that? After you do, I will review this pull request.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tomaantjes
mark lft test that requires slycot
5a59926
@tomaantjes

tomaantjes commented Sep 15, 2026

Copy link
Copy Markdown
Author

Thanks for proposing this. Some tests fail when Slycot is not installed, e.g.,

FAILED control/tests/bdalg_test.py::TestLft::test_lft_tf_inputs[-1--1] - control.exception.ControlMIMONotImplemented: MIMO system conversion not supported without Slycot
FAILED control/tests/bdalg_test.py::TestLft::test_lft_tf_inputs[1-1] - control.exception.ControlMIMONotImplemented: MIMO system conversion not supported without Slycot

Can you fix that? After you do, I will review this pull request.

Of course, I marked it in the newest commit.

All reactions

Sorry, something went wrong.

Uh oh!

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

slivingston
slivingston reviewed Sep 22, 2026
View reviewed changes
Comment thread control/statesp.py
edition, 2005.
.. [1] J. Doyle, A. Packard, and K. Zhou, "Review of LFTs,
LMIs, and mu," Proceedings of the 30th IEEE Conference on
Decision and Control, Brighton, England, 1991, pp. 1227-1232.

@slivingston slivingston Sep 20, 2026

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.

Suggested change
Decision and Control, Brighton, England, 1991, pp. 1227-1232.
Decision and Control, Brighton, England, 1991, pp. 1227-1232.
https://authors.library.caltech.edu/records/8t2hq-w7318

Add a URL to help readers find it quickly. (This can also be https://doi.org/10.1109/CDC.1991.261572 or https://doyle.caltech.edu/images/doyle/7/70/CDC1991.pdf, but the Caltech library open access is most helpful, in my opinion.) This is not done universally in the documentation of control, but there are examples with arXiv and DOI URLs.

Sorry, something went wrong.

Uh oh!

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

tomaantjes reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread control/statesp.py
def lft(self, other, nu=-1, ny=-1, **kwargs):
"""Return the linear fractional transformation.

A definition of the LFT operator can be found in Appendix A.7,

@slivingston slivingston Sep 20, 2026

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.

I do not have a copy of this book and could not find a reliable free source on the Internet, so I agree that the CDC paper is easier to find.

We should keep a link to the Matlab lft definition because it shows some compatibility between that and this implementation. https://www.mathworks.com/help/control/ref/lft.html is broken. The up-to-date URL seems to be https://www.mathworks.com/help/control/ref/inputoutputmodel.lft.html

Sorry, something went wrong.

Uh oh!

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

All reactions

@tomaantjes tomaantjes Sep 23, 2026

Copy link
Copy Markdown
Author

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.

Thanks, I agree adding a link to the Caltech library would be most helpful and I added it in addition to a link to the Matlab documentation.
I also noticed the docstring missed some information regarding the way I currently implemented the fallback with duplicate signal names and added that as well.

Sorry, something went wrong.

Uh oh!

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

All reactions

@slivingston slivingston Sep 23, 2026

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.

Thanks. I will need another 2 or 3 days to complete my review.

Sorry, something went wrong.

Uh oh!

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

All reactions
tomaantjes added 5 commits September 23, 2026 08:47
@tomaantjes
add link to CDC article in lft functions
7502973
@tomaantjes
add link to MATLAB lft function documentation in lft functions
b2a59e0
@tomaantjes
add fallback behavior for duplicate input and output labels to docstring
76016cd
@tomaantjes
remove extra spaces
17d4262
@tomaantjes
use single backticks for Matlab lft function reference
c0c778e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slivingston slivingston slivingston requested changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@tomaantjes @coveralls @slivingston
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.