Skip to content

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

Closed

Description

@vova292

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

Activity

  1. murrayrm commented on Jul 7, 2018

    @murrayrm
    Member

    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
    
  2. added this to the 0.8.0 milestone on Jul 7, 2018
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions