Skip to content

Multiplication of z-domain TF with s-domain TF is wrong #203

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

Closed
vova292 opened this issue May 10, 2018 · 1 comment
Closed

Multiplication of z-domain TF with s-domain TF is wrong #203

vova292 opened this issue May 10, 2018 · 1 comment
Milestone

Comments

@vova292
Copy link

vova292 commented May 10, 2018

It just multiplies the two as rational polynomials without any conversion of sampling times

@murrayrm
Copy link
Member

murrayrm commented Jul 7, 2018

This behavior is actually correct: all LTI systems (including the TransferFunction class) have a timebase dt. The timebase can any of the following (as described here):

  • dt = None: no timebase specified
  • dt = 0: continuous time system
  • dt > 0: discrete time system with sampling period ‘dt’
  • dt = True: discrete time with unspecified sampling period

If you create system without a timebase (the default case) then it will automatically be converted to the appropriate timebase when it is operated upon.

The following code demonstrates the behavior:

tf1 = control.TransferFunction([1,1],[1,2,3])       # unspecified timebase
tf2 = control.TransferFunction([1,1],[1,2,3], 0)    # continuous time
tf3 = control.TransferFunction([1,1],[1,2,3], True) # discrete time, unspecified sampling
tf4 = control.TransferFunction([1,1],[1,2,3], 1)    # discrete time, with sample time

tf1*tf2             # OK; convert tf1 to continuous time
tf1*tf3             # OK; convert tf1 to discrete time
tf1*tf4             # OK; convert tf1 to discrete time time
tf2*tf3             # Error; incompatible timebases
tf2*tf4             # Error; incompatible timebases
tf3*tf4             # OK; convert tf3 to fixed sample time

@murrayrm murrayrm added this to the 0.8.0 milestone Jul 7, 2018
@murrayrm murrayrm closed this as completed Jul 7, 2018
murrayrm added a commit to murrayrm/python-control that referenced this issue Jul 14, 2018
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

No branches or pull requests

2 participants