bundles / scipy latest / scipy / signal / _lti_conversion / abcd_normalize
function
scipy.signal._lti_conversion:abcd_normalize
Signature
def abcd_normalize ( A = None , B = None , C = None , D = None ) Summary
Check state-space matrices compatibility and ensure they are 2d arrays.
Extended Summary
Converts input matrices into two-dimensional arrays as needed. Then the dimensions n, q, p are determined by investigating the non-zero entries of the array shapes. If a parameter is None, or has shape (0, 0), it is set to a zero-array of compatible shape. Finally, it is verified that all parameter shapes are compatible to each other. If that fails, a ValueError is raised. Note that the dimensions n, q, p are allowed to be zero.
Parameters
A: array_like, optionalTwo-dimensional array of shape (n, n).
B: array_like, optionalTwo-dimensional array of shape (n, p).
C: array_like, optionalTwo-dimensional array of shape (q, n).
D: array_like, optionalTwo-dimensional array of shape (q, p).
Returns
A, B, C, D: arrayState-space matrices as two-dimensional arrays.
Raises
: ValueErrorIf the dimensions n, q, or p could not be determined or if the shapes are incompatible with each other.
Notes
The tutorial_signal_state_space_representation section of the user_guide presents the corresponding definitions of continuous-time and disrcete time state space systems.
Array API Standard Support
abcd_normalize 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
The following example demonstrates that the passed lists are converted into two-dimensional arrays:from scipy.signal import abcd_normalize AA, BB, CC, DD = abcd_normalize(A=[[1, 2], [3, 4]], B=[[-1], [5]], C=[[4, 5]], D=2.5) AA.shape, BB.shape, CC.shape, DD.shape✓
from scipy.signal import abcd_normalize AA, BB, CC, DD = abcd_normalize(A=[[1, 2], [3, 4]], B=[[-1], [5]], D=2.5) AA.shape, BB.shape, CC.shape, DD.shape CC✓
See also
- StateSpace
Linear Time Invariant system in state-space form.
- cont2discrete
Transform a continuous to a discrete state-space system.
- dlti
Discrete-time linear time invariant system base class.
- ss2tf
State-space to transfer function.
- ss2zpk
State-space representation to zero-pole-gain representation.
- tf2ss
Transfer function to state-space representation.
Aliases
-
scipy.signal.abcd_normalize