Skip to content

add zpk() function #816

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 2 commits into from
Dec 17, 2022
Merged

add zpk() function #816

merged 2 commits into from
Dec 17, 2022

Conversation

murrayrm
Copy link
Member

@murrayrm murrayrm commented Dec 16, 2022

This PR adds the function zpk, which creates a transfer function (as a NamedIOSystem) from a zero, pole, gain representation. This responds to issue #749.

Also added in code to make sure that signal names are copied correctly in various conversions, removing some comments entered in PR #804. In _convert_to_transfer_function this involved removing renaming from the low level function, as documented in the comment string.

Notes:

  • Unlike in MATLAB and SciPy, which have zpk classes, here we just create a transfer function from the zpk data. That seems like the most common use case.

  • In the matlab module there are also functions zpk2ss and zpk2tf that implement lower level behavior (eg, zpk2ss returns A, B, C, D). This is similar to MATLAB. if you want to get a StateSpace system from a zpk representation, use sys = ct.ss(ct.zpk(zeros, poles, gain)).

  • Unit tests and updated documentation are also included.

@coveralls
Copy link

coveralls commented Dec 16, 2022

Coverage Status

Coverage increased (+0.006%) to 94.817% when pulling 7ee0c0e on murrayrm:zpk-13Dec2022 into b4cd96b on python-control:main.

@murrayrm murrayrm linked an issue Dec 16, 2022 that may be closed by this pull request
@murrayrm murrayrm force-pushed the zpk-13Dec2022 branch 2 times, most recently from 7983829 to a123f15 Compare December 17, 2022 15:29
@murrayrm murrayrm merged commit 821bfa9 into python-control:main Dec 17, 2022
@murrayrm murrayrm added this to the 0.9.3 milestone Dec 24, 2022
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.

Include a zpk2tf function
3 participants