bundles / scipy latest / scipy / signal / _ltisys / dlsim
function
scipy.signal._ltisys:dlsim
source: /scipy/signal/_ltisys.py :3040
Signature
def dlsim ( system , u , t = None , x0 = None ) Summary
Simulate output of a discrete-time linear system.
Parameters
system: dlti | tupleAn instance of the LTI class dlti or a tuple describing the system. The number of elements in the tuple determine the interpretation. I.e.:
system: Instance of LTI class dlti. Note that derived instances, such as instances of TransferFunction, ZerosPolesGain, or StateSpace, are allowed as well.(num, den, dt): Rational polynomial as described in TransferFunction. The coefficients of the polynomials should be specified in descending exponent order, e.g., z² + 3z + 5 would be represented as[1, 3, 5].(zeros, poles, gain, dt): Zeros, poles, gain form as described in ZerosPolesGain.(A, B, C, D, dt): State-space form as described in StateSpace.
u: array_likeAn input array describing the input at each time
t(interpolation is assumed between given times). If there are multiple inputs, then each column of the rank-2 array represents an input.t: array_like, optionalThe time steps at which the input is defined. If
tis given, it must be the same length asu, and the final value intdetermines the number of steps returned in the output.x0: array_like, optionalThe initial conditions on the state vector (zero by default).
Returns
tout: ndarrayTime values for the output, as a 1-D array.
yout: ndarraySystem response, as a 1-D array.
xout: ndarray, optionalTime-evolution of the state-vector. Only generated if the input is a StateSpace system.
Notes
Array API Standard Support
dlsim has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.
==================== ==================== ==================== Library CPU GPU ==================== ==================== ==================== NumPy ✅ n/a CuPy n/a ⛔ PyTorch ⛔ ⛔ JAX ⛔ ⛔ Dask ⛔ n/a ==================== ==================== ====================
See
dev-arrayapifor more information.
Examples
A simple integrator transfer function with a discrete time step of 1.0 could be implemented as:import numpy as np from scipy import signal tf = ([1.0,], [1.0, -1.0], 1.0) t_in = [0.0, 1.0, 2.0, 3.0] u = np.asarray([0.0, 0.0, 1.0, 1.0]) t_out, y = signal.dlsim(tf, u, t=t_in)✓
y.T
✗See also
Aliases
-
scipy.signal.dlsim