MATLAB compatibility module¶
The control.matlab
module contains a number of functions that emulate
some of the functionality of MATLAB. The intent of these functions is to
provide a simple interface to the python control systems library
(python-control) for people who are familiar with the MATLAB Control Systems
Toolbox (tm).
Creating linear models¶
|
Create a transfer function system. |
|
Create a state space system. |
|
Construct a frequency response data model |
|
Create a stable random state space object. |
|
Create a stable, discrete-time, random state space system |
Utility functions and conversions¶
|
Convert a magnitude to decibels (dB) |
|
Convert a gain in decibels (dB) to a magnitude |
|
Convert a continuous time system to discrete time by sampling |
|
Transform a state space system to a transfer function. |
|
Transform a transfer function to a state space system. |
|
Return transfer function data objects for a system |
System interconnections¶
|
Return the series connection (sysn * ... *) sys2 * sys1. |
|
Return the parallel connection sys1 + sys2 (+ ... + sysn). |
|
Feedback interconnection between two I/O systems. |
|
Return the negative of a system. |
|
Index-based interconnection of an LTI system. |
|
Group models by appending their inputs and outputs. |
System gain and dynamics¶
|
Compute the gain of the system in steady state |
|
Compute system poles. |
|
Compute system zeros. |
|
Compute natural frequencies, damping ratios, and poles of a system |
|
Plot a pole/zero map for a linear system. |
Time-domain analysis¶
|
Step response of a linear system |
|
Impulse response of a linear system |
|
Initial condition response of a linear system |
|
Simulate the output of a linear system |
Frequency-domain analysis¶
|
Bode plot of the frequency response |
|
Nyquist plot of the frequency response |
|
Nichols plot for a system |
|
Calculate gain and phase margins and associated crossover frequencies |
|
Frequency response of an LTI system at multiple angular frequencies. |
|
Evaluate the transfer function of an LTI system for complex frequency x. |
Compensator design¶
|
Root locus plot |
|
Sisotool style collection of plots inspired by MATLAB's sisotool. |
|
Place closed loop eigenvalues |
|
Linear quadratic regulator design |
|
Discrete-time linear quadratic regulator design |
|
Linear quadratic estimator design (Kalman filter) for continuous-time systems. |
|
Linear quadratic estimator design (Kalman filter) for discrete-time systems. |
State-space (SS) models¶
|
Create a stable random state space object. |
|
Create a stable, discrete-time, random state space system |
|
Controllabilty matrix |
|
Observability matrix |
|
Gramian (controllability or observability) |
Model simplification¶
|
Eliminates uncontrollable or unobservable states in state-space models or cancelling pole-zero pairs in transfer functions. |
|
Calculate the Hankel singular values. |
|
Balanced reduced order model of sys of a given order. |
|
Model reduction of sys by eliminating the states in ELIM using a given method. |
|
Calculate an ERA model of order r based on the impulse-response data YY. |
|
Calculate the first m Markov parameters [D CB CAB ...] from input U, output Y. |
Matrix equation solvers and linear algebra¶
|
Solves the continuous-time Lyapunov equation |
|
Solves the discrete-time Lyapunov equation |
|
Solves the continuous-time algebraic Riccati equation |
|
Solves the discrete-time algebraic Riccati equation |
Additional functions¶
|
Plot the "Gang of 4" transfer functions for a system |
|
Unwrap a phase angle to give a continuous curve |
Functions imported from other modules¶
|
Return evenly spaced numbers over a specified interval. |
|
Return numbers spaced evenly on a log scale. |
|
State-space representation to zero-pole-gain representation. |
|
Return zero, pole, gain (z, p, k) representation from a numerator, denominator representation of a linear filter. |
|
Zero-pole-gain representation to state-space representation |
|
Return polynomial transfer function representation from zeros and poles |