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 — Include a zpk2tf function · Issue #749 · python-control/python-control

Include a zpk2tf function #749

New issue
Copy link
New issue
Copy link
Closed
#816
Closed
Include a zpk2tf function#749
#816
Copy link
Labels
enhancement

Description

@ovega14
ovega14
opened on Jul 7, 2022
Issue body actions

As it stands, a function that takes zeroes, poles, gain into numerator, denominator transfer function coefficient arrays only lives in scipy.signal or can be imported from control.matlab, and used to create a transfer function my_tf as follows:
my_tf= tf(*zpk2tf(...))
Why not instead can python-control have a method that directly takes zeroes, poles, gain into a transfer function, i.e.
my_tf=zpk2tf(..)?

Activity

  1. bnavigator
    added
    enhancement
    on Jul 7, 2022
  2. sawyerbfuller commented on Jul 16, 2022

    @sawyerbfuller
    sawyerbfuller
    on Jul 16, 2022
    Contributor
    More actions

    Hi @ovega14 I agree it would be very nice to have this functionality outside of the matlab module.

    Its not clear to me how we could implement that functionality inside TransferFunction because the three-argument case is already taken by TransferFunction(num, den, dt). Might be possible to include a keyword to make it explicit like TransferFunction(zeros, poles, gain, [dt,] usezpk=True), but implementing that logic seems like it would be awkward.

    Probably most expedient is to just move the import of scipy's zpk2tf (and might as well bring in zpk2ss while you're at it) into the LTI module rather than the matlab module, and then they will be available everywhere, including the matlab module.

    This might be an opportunity to also invent a more pythonic additional long name for them as well, e.g. zeros_poles_gain_to_tf, but they are so apt and convenient I am not sure that is necessary.

    Feel free to contribute a pull request.

    Reacted by Ben Greiner
  3. murrayrm commented on Jul 16, 2022

    @murrayrm
    murrayrm
    on Jul 16, 2022
    Member
    More actions

    Whoever takes on implementing this should make sure that zpk2tf and zpk2ss eventually create a NamedIOSystem, versus a lower level TransferFunction or StateSpace object. That will allow the output system to be compatible with the I/O system functionality (including named input/output signals for connecting things together). A diagram of the dependencies can be found here.

    Reacted by Ben Greiner
  4. ovega14 commented on Jul 21, 2022

    @ovega14
    ovega14
    on Jul 21, 2022
    Author
    More actions

    Should we import zpk2tf and zpk2ss from scipy into the LTI module? If so, then these functions will not directly return a NamedIOSystem, nor a TransferFunction or StateSpace object. As a reminder, these functions return numerator and denominator coefficient arrays of a transfer function given zeroes, poles, and gain. Should we then redefine the two functions (zpk2tf and zpk2ss) to conform to this expected python-control behavior?

  5. bnavigator commented on Jul 21, 2022

    @bnavigator
    bnavigator
    on Jul 21, 2022
    Contributor
    More actions

    Yes functions in the control namespace should return a python-control conforming system. Hence @murrayrm's request to return NamedIOSystem. This requires a wrapper rather than a simple import.

  6. murrayrm
    linked a pull request that will close this issueadd zpk() function #816on Dec 16, 2022
  7. murrayrm
    closed this as completedin #816on Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    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.