control.sample_system

control.sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None)

Convert a continuous time system to discrete time

Creates a discrete time system from a continuous time system by sampling. Multiple methods of conversion are supported.

Parameters
  • sysc (linsys) – Continuous time system to be converted

  • Ts (real) – Sampling period

  • method (string) – Method to use for conversion: ‘matched’, ‘tustin’, ‘zoh’ (default)

  • prewarp_frequency (float within [0, infinity)) – The frequency [rad/s] at which to match with the input continuous- time system’s magnitude and phase

Returns

sysd – Discrete time system, with sampling rate Ts

Return type

linsys

Notes

See TransferFunction.sample and StateSpace.sample for further details.

Examples

>>> sysc = TransferFunction([1], [1, 2, 1])
>>> sysd = sample_system(sysc, 1, method='matched')