:py:mod:`dysys` =============== .. py:module:: dysys Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 controltf/index.rst statespacesymbolic/index.rst sysdyn/index.rst transferfunctions/index.rst transferfunctionsymbolic/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: dysys.StateSpace dysys.StateSpaceSymbolic dysys.TransferFunctionSymbolic dysys.TransferFunction Functions ~~~~~~~~~ .. autoapisummary:: dysys.eigenvalue_matrix_np2sp dysys.modal_matrix_np2sp dysys.stability_from_eigenvalues dysys.sss dysys.tfs dysys.tf Attributes ~~~~~~~~~~ .. autoapisummary:: dysys.s .. py:function:: eigenvalue_matrix_np2sp(eval_list) Returns the symbolic eigenvalue matrix from a list of eigenvalues from numpy .. py:function:: modal_matrix_np2sp(evec_array) Returns the symbolic modal matrix from a numpy array of eigenvectors .. py:function:: stability_from_eigenvalues(eval_list) Returns the stability as str of from a list of eigenvalues .. py:class:: StateSpace Bases: :py:obj:`control.StateSpace` Subclass of control.StateSpace with extra methods .. py:method:: eig() Returns the eigenvalue matrix Lambda .. py:class:: StateSpaceSymbolic(A, B, C, D, E=None, F=None) Represents a continuous LTI state-space model in symbolic form .. py:method:: eig() Returns L, M: the eigenvalue and eigenvector matrices of A .. py:method:: diag_transformation(reals_only=False, sort=True, normalize=False) Return (P, D), where D is diagonal and D = P^-1 * self.A * P This returns self.A.diagonalize() from SymPy. :param reals_only: bool. Whether to throw an error if complex numbers are need to diagonalize. (Default: False) :param sort: bool. Sort the eigenvalues along the diagonal. (Default: True) :param normalize: bool. If True, normalize the columns of P. (Default: False) .. py:method:: is_diagonalizable(reals_only=False, **kwargs) Returns ``True`` if self.A is diagonalizable. This returns self.A.is_diagonalizable() from SymPy. :param - reals_only: bool, optional If ``True``, it tests whether the matrix can be diagonalized to contain only real numbers on the diagonal. If ``False``, it tests whether the matrix can be diagonalized at all, even with numbers that may not be real. .. py:method:: state_transition_matrix(t) Returns the state transition matrix .. py:method:: state_free_response(t, x0) Returns the free response of the state vector .. py:method:: output_free_response(t, x0) Returns the free response of the output vector .. py:method:: state_forced_response(t, u) Returns the forced response of the state vector .. py:method:: output_forced_response(t, u) Returns the forced response of the output vector .. py:method:: state_response(t, x0=None, u=None) Returns the state response for initial condition x0 and input u .. py:method:: output_response(t, x0=None, u=None) Returns the output response for initial condition x0 and input u .. py:method:: to_numpy(params = {}) Returns A, B, C, D as NumPy arrays .. py:method:: to_control(params = {}) Returns an equivalent Control Systems package control.StateSpace object .. py:function:: sss(A, B, C, D, E=None, F=None) Create a StateSpaceSymbolic object .. py:class:: TransferFunctionSymbolic(H, s=None) Represents a SISO continuous LTI transfer function model in symbolic form .. py:method:: __call__(s) Evaluate the transfer function at a complex frequency s .. py:method:: __str__() Return str(self). .. py:method:: __factor_p(p, poles=True) .. py:method:: factor() Returns an overall gain and a list of standard-form terms .. py:method:: __num_den_lists(params = {}) Returns num and den coefficients as lists .. py:method:: to_control(params = {}) Returns an equivalent Control Systems package control.TransferFunction object .. py:method:: poles() Returns a dict of the symbolic poles as keys and multiplicity as values .. py:method:: zeros() Returns a dict of the symbolic zeros as keys and multiplicity as values .. py:method:: dc_gain() Returns the DC gain of the transfer function .. py:method:: frequency_response_function(w = sp.symbols('w', real=True)) Returns the symbolic frequency response function (FRF) Evaluates H(jw). Assumes the region of convergence for the corresponding Fourier transform is congruent with that of the Laplace transform. :param w: The frequency symbol .. py:method:: forced_response(t, u = None, U = None, laplace = False) Returns the forced response of a SISO system The inverse Laplace transform is used to compute the forced response. Exactly one of arguments u or U may be provided. :param t: The time symbol :param u: The input as a time-dependent expression :param U: The input as a Laplace transform (must use symbolic sp.symbols("s") if using this option) :param laplace: If True, returns Laplace transform Y(s) of the output .. py:function:: tfs(H, s=None) Create a TransferFunctionSymbolic object .. py:data:: s .. py:class:: TransferFunction Bases: :py:obj:`control.TransferFunction` Subclass of control.TransferFunction with extra methods .. py:method:: pop_conjugate(root, roots) Pop the conjugate of a root in roots list Finds the closest root in roots to the complex conjugate of root. Uses the "closest" metric of the Euclidean distance. .. py:method:: poly_factors_canonical(p) Returns polynomial factors in canonical form .. py:method:: factor_canonical(check=False) Returns a list of transfer functions in canonical form, the product of which equals self. .. py:function:: tf(*args, **kwargs) Create a TransferFunction object