Skip to content

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

Merged
murrayrm merged 4 commits intopython-control:masterfrom
murrayrm:add_tf_s+z
May 31, 2019
Merged

Add 's' and 'z' variable support to tf()#304
murrayrm merged 4 commits intopython-control:masterfrom
murrayrm:add_tf_s+z

Conversation

@murrayrm
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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