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 — Fix bug in matched transformation + address other issues in #950 by murrayrm · Pull Request #951 · python-control/python-control

Conversation

@murrayrm

@murrayrm murrayrm commented Dec 26, 2023

Copy link
Copy Markdown
Member

This PR fixes the calculation of the DC gain in the 'matched' transformation from continuous time to discrete time. It also fixes some other issues identified in #950. Also adds unit test for sample_system that catches the original error.

Sorry, something went wrong.

Uh oh!

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

All reactions
@murrayrm
fix bug in matched transformation + address other issues in python-co…
3fb1a51
…ntrol#950
@murrayrm murrayrm linked an issue Dec 26, 2023 that may be closed by this pull request
gain offset using control.matlab.c2d using method='matched' ? #950
Closed
@murrayrm murrayrm mentioned this pull request Dec 26, 2023
gain offset using control.matlab.c2d using method='matched' ? #950
Closed
@coveralls

coveralls commented Dec 26, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

coverage: 94.989% (-0.02%) from 95.009%
when pulling e4bcec0 on murrayrm:matched_bug-26Dec2023
into 7a8581c on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

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

sawyerbfuller
sawyerbfuller reviewed Dec 26, 2023
View reviewed changes
Comment thread control/xferfcn.py Resolved

Uh oh!

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

murrayrm and others added 2 commits December 26, 2023 11:11
@murrayrm @sawyerbfuller
Update control/xferfcn.py
d4525a1
Co-authored-by: Sawyer Fuller <[email protected]>
@murrayrm
fixed botched pathc from github
e4bcec0
@murrayrm
murrayrm merged commit 177d8b6 into python-control:main Dec 26, 2023
@murrayrm
murrayrm deleted the matched_bug-26Dec2023 branch December 26, 2023 19:32
@murrayrm murrayrm added this to the 0.10.0 milestone Mar 31, 2024
@binggao1230 binggao1230 mentioned this pull request Jul 21, 2026
Fix matched c2d/sample returning NaN for a pole or zero at the origin #1241
Merged
binggao1230 added a commit to binggao1230/python-control that referenced this pull request Aug 9, 2026
@binggao1230
Fix matched c2d NaN for a pole or zero at the origin
f80d990
TransferFunction.sample(Ts, method='matched') (and c2d) returned an
all-NaN numerator for any system with a pole or zero at s = 0 -
integrators, PI/PID controllers, differentiators and other type-1/2
systems.  The DC-gain match divides the continuous DC gain (inf for an
origin pole, 0 for an origin zero) by a zgain that carries the same
vanishing 1 - z factor, so the gain is 0/0 or inf/inf.

Match the gain from the non-origin factors only and restore the origin
scaling analytically through the z - 1 ~ s*Ts limit, which recovers the
textbook Ts/(z - 1) for 1/s, Ts**2/(z - 1)**2 for 1/s**2, and so on.
Finite-DC systems are byte-for-byte unchanged.  Completes the gain fix
from python-control#950/python-control#951.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sawyerbfuller sawyerbfuller sawyerbfuller 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.10.0

Development

Successfully merging this pull request may close these issues.

gain offset using control.matlab.c2d using method='matched' ?

Uh oh!

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

3 participants

@murrayrm @coveralls @sawyerbfuller
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.