Function reference¶
The Python Control Systems Library control
provides common functions
for analyzing and designing feedback control systems.
Documentation is available in two forms: docstrings provided with the code, and the python-control users guide, available from the python-control homepage.
The docstring examples assume that the following import commands:
>>> import numpy as np
>>> import control as ct
Available subpackages¶
The main control package includes the most commpon functions used in analysis, design, and simulation of feedback control systems. Several additional subpackages are available that provide more specialized functionality:
System creation¶
|
Create a state space system. |
|
Create a transfer function system. |
|
Construct a frequency response data model |
|
Create a transfer function from zeros, poles, gain. |
|
Create a stable random state space object. |
|
Create a stable, discrete-time, random state space system |
|
Nonlinear I/O system. |
System interconnections¶
|
Group models by appending their inputs and outputs. |
|
Index-based interconnection of an LTI system. |
|
Feedback interconnection between two I/O systems. |
|
Interconnect a set of input/output systems. |
|
Return the negative of a system. |
|
Return the parallel connection sys1 + sys2 (+ ... + sysn). |
|
Return the series connection (sysn * ... *) sys2 * sys1. |
Frequency domain plotting¶
|
Bode plot for a system |
|
Plot a Nyquist plot with a describing function for a nonlinear system. |
|
Nyquist plot for a system |
|
Plot the "Gang of 4" transfer functions for a system |
|
Nichols plot for a system |
|
Nichols chart grid |
Note: For plotting commands that create multiple axes on the same plot, the individual axes can be retrieved using the axes label (retrieved using the get_label method for the matplotliib axes object). The following labels are currently defined:
Bode plots: control-bode-magnitude, control-bode-phase
Gang of 4 plots: control-gangof4-s, control-gangof4-cs, control-gangof4-ps, control-gangof4-t
Time domain simulation¶
|
Compute the output of a linear system given the input. |
|
Compute the impulse response for a linear system. |
|
Compute the initial condition response for a linear system. |
|
Compute the output response of a system to a given input. |
|
Compute the step response for a linear system. |
|
Phase plot for 2D dynamical systems |
Control system analysis¶
|
Return the zero-frequency (or DC) gain of the given system |
|
Numerically compute the describing function of a nonlinear function |
|
Frequency response of an LTI system at multiple angular frequencies. |
|
Return the input feedforward passivity (IFP) index for the system. |
|
Return the output feedback passivity (OFP) index for the system. |
|
Indicate if a linear time invariant (LTI) system is passive. |
|
Calculate gain and phase margins and associated crossover frequencies |
|
Calculate stability margins and associated crossover frequencies. |
|
Step response characteristics (Rise time, Settling Time, Peak and others). |
Compute frequencies and gains at intersections with real axis in Nyquist plot. |
|
|
Compute system poles. |
|
Compute system zeros. |
|
Plot a pole/zero map for a linear system. |
|
Root locus plot |
|
Sisotool style collection of plots inspired by MATLAB's sisotool. |
|
Evaluate system's frequency response at complex frequencies. |
|
Evaluate system's transfer function at complex frequencies. |
Matrix computations¶
|
Solves the continuous-time algebraic Riccati equation |
|
Controllabilty matrix |
|
Solves the discrete-time algebraic Riccati equation |
|
Solves the discrete-time Lyapunov equation |
|
Solves the continuous-time Lyapunov equation |
|
Observability matrix |
|
Gramian (controllability or observability) |
Control system synthesis¶
|
Pole placement using Ackermann method |
|
Create an I/O system using a (full) state feedback controller |
|
Discrete-time linear quadratic regulator design |
|
H_2 control synthesis for plant P. |
|
H_{inf} control synthesis for plant P. |
|
Linear quadratic regulator design |
|
Mixed-sensitivity H-infinity synthesis. |
|
Place closed loop eigenvalues |
|
Manual PID controller design based on root locus using Sisotool |
Model simplification tools¶
|
Eliminates uncontrollable or unobservable states in state-space models or cancelling pole-zero pairs in transfer functions. |
|
Balanced reduced order model of sys of a given order. |
|
Calculate the Hankel singular values. |
|
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. |
Nonlinear system support¶
|
Numerically compute the describing function of a nonlinear function |
|
Find the equilibrium point for an input/output system. |
|
Linearize an input/output system at a given state and input. |
|
Compute the output response of a system to a given input. |
|
Create an I/O system from a state space linear system. |
|
Create a summing junction as an input/output system. |
|
Convert a transfer function into an I/O system |
|
Compute trajectory between an initial and final conditions. |
Stochastic system support¶
|
Compute the correlation of time signals. |
|
Create an I/O system implementing a linear quadratic estimator |
|
Linear quadratic estimator design (Kalman filter) for discrete-time systems. |
|
Linear quadratic estimator design (Kalman filter) for continuous-time systems. |
|
Generate a white noise signal with specified intensity. |
Utility functions and conversions¶
|
Augment plant for mixed sensitivity problem. |
|
Block-diagonal Schur decomposition |
|
Convert a system into canonical form |
|
Compute natural frequencies, damping ratios, and poles of a system |
|
Convert a gain in decibels (dB) to a magnitude |
|
Check to see if a system is a continuous-time system |
|
Check to see if a system is a discrete time system |
|
Check to see if a system is single input, single output |
|
Return True if an object is a Linear Time Invariant (LTI) system, otherwise False |
|
Convert a magnitude to decibels (dB) |
|
Convert a system into modal canonical form |
|
Convert a system into observable canonical form |
|
Create a linear system that approximates a delay. |
|
Convert a system into reachable canonical form |
Reset configuration values to their default (initial) values. |
|
|
Convert a continuous time system to discrete time by sampling |
|
Set default values of parameters for a module. |
|
Perform a similarity transformation, with option time rescaling. |
|
Transform a state space system to a transfer function. |
|
Return state space data objects for a system |
|
Transform a transfer function to a state space system. |
|
Return transfer function data objects for a system |
|
Return the timebase for a system |
|
Check to see if two systems have the same timebase |
|
Unwrap a phase angle to give a continuous curve |
Use Feedback Systems (FBS) compatible settings. |
|
Use MATLAB compatible configuration settings. |
|
|
Turn on/off use of Numpy matrix class for state space operations. |