Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix issue with multiplying MIMO LTI system by scalar #1078

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 4 commits into from
Dec 11, 2024

Conversation

murrayrm
Copy link
Member

@murrayrm murrayrm commented Dec 7, 2024

This PR addresses #1075 and also fixes a small bug with constant FRD systems with small numbers of frequency points.

Changes:

  • Multiplying (*), adding (+), or subtracting (-) a constant from any (MIMO) LTI object now acts element-wise (same as ndarray's). This fixes a bug where multiplying a MIMO LTI system by a constant was multiplying by a matrix filled with the constant rather than a diagonal matrix (scaled identity).
  • Specifying an FRD system with fewer than 4 frequency points was generating an error because the default settings try to set up a smooth (interpolating) response and the default degree of the fit was 3. The SciPy interpolation function requires k+1 data points for a degree k fit, so an exception was generated.
  • Added unit tests that catch the bug in Multiplying a MIMO TransferFunction by 1.0 multiplies by a matrix of ones, not identity #1075 but also check across all LTI system representations (frd, ss, tf).

@coveralls
Copy link

coveralls commented Dec 7, 2024

Coverage Status

coverage: 94.73% (+0.009%) from 94.721%
when pulling 3165881 on murrayrm:fix_scalar_tfops-06Dec2024
into 12dda4e on python-control:main.

@slivingston slivingston self-requested a review December 8, 2024 17:07
@slivingston slivingston merged commit 8b6d041 into python-control:main Dec 11, 2024
12 checks passed
@murrayrm murrayrm added this to the 0.10.2 milestone Feb 19, 2025
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.

Multiplying a MIMO TransferFunction by 1.0 multiplies by a matrix of ones, not identity
3 participants