Skip to content

Add 's' and 'z' variable support to tf() #304

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
May 31, 2019

Conversation

murrayrm
Copy link
Member

This PR adds the ability to define variables 's' and 'z' that can be used to construct transfer functions using formulas. The matlab version of this matches MATLAB:

from control.matlab import tf
s = tf('s')
G = (s + 1) / (s**2 + 2*s + s)

The Python version uses the special variables TransferFunction.s and TransferFunction.z:

import control as ct
s = ct.TransferFunction.s
G = (s + 1) / (s**2 + 2*s + s)

The constants TransferFunction.s and TransferFunction.z are defined to be transfer functions corresponding to 's' and 'z'. The rest is taken care of by the existing operator overloading functions for transfer functions.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 78.244% when pulling 8e01958 on murrayrm:add_tf_s+z into 7188a9c on python-control:master.

@coveralls
Copy link

coveralls commented May 25, 2019

Coverage Status

Coverage increased (+0.03%) to 80.936% when pulling 1072dea on murrayrm:add_tf_s+z into c596a12 on python-control:master.

@murrayrm murrayrm merged commit 8a11cd3 into python-control:master May 31, 2019
@murrayrm murrayrm deleted the add_tf_s+z branch May 31, 2019 17:11
@murrayrm murrayrm added this to the 0.8.3 milestone Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants