Skip to content

Improve lft functions and lft documentation - #1249

Open
tomaantjes wants to merge 25 commits into
python-control:mainfrom
tomaantjes:improve-lft-functions
Open

tomaantjes wants to merge 25 commits into
python-control:mainfrom
tomaantjes:improve-lft-functions

Conversation

@tomaantjes

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.

@slivingston
slivingston self-requested a review September 15, 2026 00:32
@coveralls

coveralls commented Sep 15, 2026 •

Copy link
Copy Markdown

Coverage Status

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

@slivingston slivingston left a comment

Copy link
Copy Markdown
Member

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.

@tomaantjes

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.

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.

Copy link
Copy Markdown
Member

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.

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,

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown
Member

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.

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.

3 participants