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 — gain offset using control.matlab.c2d using method='matched' ? · Issue #950 · python-control/python-control

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

New issue
Copy link
New issue
Copy link
Closed
#951
Closed
gain offset using control.matlab.c2d using method='matched' ?#950
#951
Copy link
Assignees
murrayrm

Description

@JonHowMIT
JonHowMIT
opened on Dec 24, 2023
Issue body actions

Compared results of
sysc = ct.TransferFunction([1, z], [1, p])
sysd = ct.matlab.c2d(sysc, Ts, method='bilinear')
sysd1 = ct.matlab.c2d(sysc, Ts, method='matched')

yields a sysd1 with a gain that is about 10x that of sysd - is that expected?

Activity

  1. sawyerbfuller commented on Dec 25, 2023

    @sawyerbfuller
    sawyerbfuller
    on Dec 25, 2023
    Contributor
    More actions

    Hi John great to hear from you and happy holidays. Glad to see you are using or at the very least evaluating the library.

    The matched c2d is code I have never used before and it doesn’t look like we have a unit test for it, so there is a decent chance it is just a bug. Thanks for the report!

    One q - when you refer to gain, do you mean the DC gain of the two systems?

  2. murrayrm commented on Dec 26, 2023

    @murrayrm
    murrayrm
    on Dec 26, 2023
    Member
    More actions

    I did a quick check and I agree there is something wrong in the matched transformation:

    import control as ct
    sysc = ct.tf([1, 2], [1, 3], name='sysc')
    sysd_bilinear = ct.sample_system(sysc, 0.1, method='bilinear', name='sysd_bilinear')
    sysd_matched = ct.sample_system(sysc, 0.1, method='matched', name='sysd_matched')
    ct.bode([sysd_bilinear, sysd_matched, sysc])
    

    This produces the following plot:
    Figure_1

    A couple of things to fix:

    • Zero frequency gain for the 'matched' transformation is incorrect.
    • The name of the system is lost when doing the 'matched' transformation.
    • The order of the system names is incorrect in the figure title
  3. murrayrm
    self-assigned this
    on Dec 26, 2023
  4. murrayrm
    added 2 commits that reference this issue on Dec 26, 2023

    fix bug in matched transformation + address other issues in python-co…

    d07072f

    fix bug in matched transformation + address other issues in python-co…

    3fb1a51
  5. murrayrm
    linked a pull request that will close this issueFix bug in matched transformation + address other issues in #950 #951on Dec 26, 2023
  6. murrayrm commented on Dec 26, 2023

    @murrayrm
    murrayrm
    on Dec 26, 2023
    Member
    More actions

    Fixed in #951. New plot:

    Figure_2

  7. murrayrm
    closed this as completedon Dec 26, 2023
  8. murrayrm
    added a commit that references this issue on Dec 26, 2023

    Merge pull request #951 from murrayrm/matched_bug-26Dec2023

    177d8b6
  9. binggao1230
    added a commit that references this issue on Aug 9, 2026

    Fix matched c2d NaN for a pole or zero at the origin

    f80d990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @murrayrm
    murrayrm

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.