Sei sulla pagina 1di 51

FUNCTII DIN PACHETUL CONTROL

Creation of LTI models.


ss - Create a state-space model.
zpk - Create a zero/pole/gain model.
tf - Create a transfer function model.
dss - Specify a descriptor state-space model.
filt - Specify a digital filter.
set - Set/modify properties of LTI models.
ltiprops - Detailed help for available LTI properties.

Data extraction.
ssdata - Extract state-space matrices.
zpkdata - Extract zero/pole/gain data.
tfdata - Extract numerator(s) and denominator(s).
dssdata - Descriptor version of SSDATA.
get - Access values of LTI model properties.

Model characteristics.
class - Model type ('ss', 'zpk', or 'tf').
size - Input/output dimensions.
isempty - True for empty LTI models.
isct - True for continuous-time models.
isdt - True for discrete-time models.
isproper - True for proper LTI models.
issiso - True for single-input/single-output systems.
isa - Test if LTI model is of given type.

Conversions.
ss - Conversion to state space.
zpk - Conversion to zero/pole/gain.
tf - Conversion to transfer function.
c2d - Continuous to discrete conversion.
d2c - Discrete to continuous conversion.
d2d - Resample discrete system or add input delay(s).

Overloaded arithmetic operations.


+ and - - Add and subtract LTI systems (parallel connection).
* - Multiplication of LTI systems (series connection).
\ - Left divide -- sys1\sys2 means inv(sys1)*sys2.
/ - Right divide -- sys1/sys2 means sys1*inv(sys2).
' - Pertransposition.
.' - Transposition of input/output map.
[..] - Horizontal/vertical concatenation of LTI systems.
inv - Inverse of an LTI system.

Model dynamics.
pole, eig - System poles.
tzero - System transmission zeros.
pzmap - Pole-zero map.
dcgain - D.C. (low frequency) gain.
norm - Norms of LTI systems.
covar - Covariance of response to white noise.
damp - Natural frequency and damping of system poles.
esort - Sort continuous poles by real part.
dsort - Sort discrete poles by magnitude.
pade - Pade approximation of time delays.

State-space models.
rss,drss - Random stable state-space models.
ss2ss - State coordinate transformation.
canon - State-space canonical forms.
ctrb, obsv - Controllability and observability matrices.
gram - Controllability and observability gramians.
ssbal - Diagonal balancing of state-space realizations.
balreal - Gramian-based input/output balancing.
modred - Model state reduction.
minreal - Minimal realization and pole/zero cancellation.
augstate - Augment output by appending states.

Time response.
step - Step response.
impulse - Impulse response.
initial - Response of state-space system with given initial state.
lsim - Response to arbitrary inputs.
ltiview - Response analysis GUI.
gensig - Generate input signal for LSIM.
stepfun - Generate unit-step input.

Frequency response.
bode - Bode plot of the frequency response.
sigma - Singular value frequency plot.
nyquist - Nyquist plot.
nichols - Nichols chart.
ltiview - Response analysis GUI.
evalfr - Evaluate frequency response at given frequency.
freqresp - Frequency response over a frequency grid.
margin - Gain and phase margins.

System interconnections.
append - Group LTI systems by appending inputs and outputs.
parallel - Generalized parallel connection (see also overloaded +).
series - Generalized series connection (see also overloaded *).
feedback - Feedback connection of two systems.
star - Redheffer star product (LFT interconnections).
connect - Derive state-space model from block diagram description.

Classical design tools.


rlocus - Evans root locus.
rlocfind - Interactive root locus gain determination.
acker - SISO pole placement.
place - MIMO pole placement.
estim - Form estimator given estimator gain.
reg - Form regulator given state-feedback and estimator gains.

LQG design tools.


lqr,dlqr - Linear-quadratic (LQ) state-feedback regulator.
lqry - LQ regulator with output weighting.
lqrd - Discrete LQ regulator for continuous plant.
kalman - Kalman estimator.
kalmd - Discrete Kalman estimator for continuous plant.
lqgreg - Form LQG regulator given LQ gain and Kalman estimator.

Matrix equation solvers.


lyap - Solve continuous Lyapunov equations.
dlyap - Solve discrete Lyapunov equations.
care - Solve continuous algebraic Riccati equations.
dare - Solve discrete algebraic Riccati equations.

Demonstrations.
ctrldemo - Introduction to the Control System Toolbox.
jetdemo - Classical design of jet transport yaw damper.
diskdemo - Digital design of hard-disk-drive controller.
milldemo - SISO and MIMO LQG control of steel rolling mill.
kalmdemo - Kalman filter design and simulation.
help ss

SS Create state-space models or convert LTI model to state space.

You can create a state-space model by:


SYS = SS(A,B,C,D) Continuous-time model
SYS = SS(A,B,C,D,T) Discrete-time model with sampling time T
(Set T=-1 if undetermined)
SYS = SS Default empty SS object
SYS = SS(D) Static gain matrix
SYS = SS(A,B,C,D,LTI) State-space model with LTI properties
inherited from the system LTI (can be
SS, TF, or ZPK)
All the above syntaxes may be followed by Property/Value pairs.
(Type "help ltiprops" for details on assignable properties).
Setting D=0 is interpreted as the zero matrix of adequate
dimensions. The output SYS is an SS object.

SYS_SS = SS(SYS) converts an arbitrary LTI model SYS to state space,


i.e., computes a state-space realization SYS_SS of SYS.

See also SET, SSDATA, DSS, TF, ZPK.

help zpk

ZPK Specify zero-pole-gain models or convert to zero-pole-gain form.

ZSYS = ZPK(SYS) converts an arbitrary LTI model SYS to


zero-pole-gain form. The output ZSYS is a ZPK object.

ZSYS = ZPK(SYS,'inv') uses a fast algorithm for state-space SYS,


but is typically less accurate for high-order systems with low
gain at s=0.

You can create SISO or MIMO zero-pole-gain (ZPK) models by:


SYS = ZPK(Z,P,K) Continuous-time system.
SYS = ZPK(Z,P,K,T) Discrete-time system with sample time T
(Set T=-1 if undetermined)
SYS = ZPK Default empty zero-pole-gain object
SYS = ZPK(M) Static gain matrix
SYS = ZPK(Z,P,K,LTI) ZPK model with LTI properties inherited
from system LTI (can be SS, TF, or ZPK).
All the above syntaxes may be followed by Property/Value pairs
(Type "help ltiprops" for details on assignable properties).
The output SYS is a ZPK object.
For SISO systems, Z and P are the vectors of zeros and poles
(set to [] if none) and K is the scalar gain.

For MIMO systems with NU inputs and NY outputs,


* Z and P are NY-by-NU cellarrays where Z{i,j} and P{i,j} are
the vectors of zeros and poles of the transfer function
from input j to output i
* K is the 2-D matrix of gains for each I/O channel.
For example,
zpk( {[];[2 3]} , {1;[0 -1]} , [-5;1] )
specifies the one-input/two-output system
[ -5 /(s-1) ]
[ (s-2)(s-3)/s(s+1) ]

See also ZPKDATA, GET, SET, LTIPROPS, TF, SS.

help tf

TF Specify transfer functions or convert LTI model to transfer function.

TFSYS = TF(SYS) converts an arbitrary LTI model SYS to transfer


function format. The output TFSYS is a TF object.

TFSYS = TF(SYS,'inv') uses a fast algorithm for state-space SYS,


but is typically less accurate for high-order systems.

You can create SISO or MIMO transfer functions (TF) by


SYS = TF(NUM,DEN) Continuous-time system NUM(s)./DEN(s)
SYS = TF(NUM,DEN,T) Discrete-time system NUM(z)./DEN(z) with
sampling time T (Set T=-1 if undetermined)
SYS = TF Default empty TF object
SYS = TF(M) Static gain matrix
SYS = TF(NUM,DEN,LTI) Transfer function with LTI properties inherited
from system LTI (can be SS, TF, or ZPK).
All the above syntaxes may be followed by Property/Value pairs.
(Type "help ltiprops" for details on assignable properties).
The output SYS is a TF object.

The default TF variables 's' and 'z' can be altered by resetting


the 'Variable' property. Alternatives include 'p' for continuous TF
and 'z^-1' or 'q' for discrete TF.

For SISO systems, NUM and DEN are row vectors listing the numerator and
denominator coefficients in
* descending powers of s or z by default
* ascending powers of q = z^-1 if 'Variable' is set to 'z^-1' or 'q'
(DSP convention).

For MIMO systems with NU inputs and NY outputs, NUM and DEN are
NY-by-NU cell arrays of row vectors where NUM{i,j} and DEN{i,j} specify
the transfer function from input j to output i. For example,
tf( {-5 ; [1 -5 6]} , {[1 -1] ; [1 1 0]})
specifies the two-output/one-input system

[ -5 /(s-1) ]
[ (s^2-5s+6)/(s^2+s) ]

See also FILT, TFDATA, GET, SET, LTIPROPS, ZPK, SS.

help dss

DSS Specify DESCRIPTOR state-space models


.
E x=Ax+Bu E x[n+1] = A x[n] + B u[n]
or
y=Cx+Du y[n] = C x[n] + D u[n]

SYS = DSS(A,B,C,D,E) Continuous-time descriptor model


SYS = DSS(A,B,C,D,E,T) Discrete-time descriptor model with sample
time T (Set T = -1 if undetermined).
SYS = DSS(A,B,C,D,E,LTI) Descriptor model with LTI properties
inherited from the system LTI (can be
SS, TF, or ZPK).

All the above syntaxes may be followed by Property/Value pairs.


Setting D=0 is interpreted as the zero matrix of adequate
dimensions. The output SYS is an SS object.

See also SET, DSSDATA, GET, SS.

help filt

FILT DSP-oriented specification of discrete transfer functions.

SYS = FILT(NUM,DEN) Digital filter H(z^-1)=NUM(z^-1)./DEN(z^-1)


with unspecified sampling time.
SYS = FILT(NUM,DEN,Ts) Digital filter H(z^-1)=NUM(z^-1)./DEN(z^-1)
with sample time Ts.
SYS = FILT(M) Gain matrix.

All the above calling syntaxes may be followed by Property/Value pairs.

In the SISO case, NUM and DEN are row vectors listing the numerator and
denominator coefficients in ascending powers of z^-1. In the MIMO case,
NUM and DEN are cell arrays of row vectors such that NUM{i,j} and
DEN{i,j} specify the transfer function from input j to output i.

See also TF

help set
SET Set object properties.
SET(H,'PropertyName',PropertyValue) sets the value of the
specified property for the graphics object with handle H.
H can be a vector of handles, in which case SET sets the
properties' values for all the objects.

SET(H,a) where a is a structure whose field names are object


property names, sets the properties named in each field name
with the values contained in the structure.

SET(H,pn,pv) sets the named properties specified in the cell array


of strings pn to the corresponding values in the cell array pv for
all objects specified in H. The cell array pn must be 1-by-N, but
the cell array pv can be M-by-N where M is equal to length(H) so
that each object will be updated with a different set of values
for the list of property names contained in pn.

SET(H,'PropertyName1',PropertyValue1,'PropertyName2',PropertyValue2,...)
sets multiple property values with a single statement. Note that it
is permissible to use property/value string pairs, structures, and
property/value cell array pairs in the same call to SET.

A = SET(H, 'PropertyName')
SET(H,'PropertyName')
returns or displays the possible values for the specified
property of the object with handle H. The returned array is
a cell array of possible value strings or an empty cell array
if the property does not have a finite set of possible string
values.

A = SET(H)
SET(H)
returns or displays all property names and their possible values for
the object with handle H. The return value is a structure whose
field names are the property names of H, and whose values are
cell arrays of possible property values or empty cell arrays.

The default value for an object property can be set on any of an


object's ancestors by setting the PropertyName formed by
concatenating the string 'Default', the object type, and the
property name. For example, to set the default color of text objects
to red in the current figure window:

set(gcf,'DefaultTextColor','red')

Defaults can not be set on a descendant of the object, or on the


object itself - for example, a value for 'DefaultAxesColor' can not
be set on an axes or an axes child, but can be set on a figure or on
the root.
Three strings have special meaning for PropertyValues:
'default' - use default value (from nearest ancestor)
'factory' - use factory default value
'remove' - remove default value.

See also GET, RESET, DELETE, GCF, GCA, FIGURE, AXES.

Overloaded methods
help zpk/set.m
help tf/set.m
help ss/set.m
help lti/set.m

help ltiprops

LTI system properties.

Below NU, NY, and NX refer to the number of inputs, outputs, and
states (when applicable).

Properties specific to transfer functions (TF).


num - Numerator.
Row vector for SISO systems, NY-by-NU cellarray of row
vectors for MIMO systems (e.g., {[1 0] 1 ; 3 [1 2 3]}).
den - Denominator.
Row vector for SISO systems, NY-by-NU cellarray of row
vectors for MIMO systems.
Variable - Variable name (optional).
Available choices: 's', 'p', 'z', 'z^-1', or 'q'.
The defaults are 's' (continuous) and 'z' (discrete).
The variable name influences the display and allows
for DSP-oriented specification of discrete TFs.

Properties specific to zero/pole/gain models (ZPK).


z - Zeros.
Vector of zeros for SISO systems, NY-by-NU cellarray of
vectors for MIMO systems.
p - Poles.
Vector of poles for SISO systems, NY-by-NU cellarray of
vectors for MIMO systems.
k - Gains.
Scalar for SISO systems, NY-by-NU matrix for MIMO systems.
Variable - Variable name (optional).
Same as for TF (see above).

Properties specific to state-space models (SS).


a,b,c,d - A,B,C,D matrices.
e - E matrix for Descriptor systems.
Empty by default, meaning E = eye(size(A)).
StateName - State names (optional).
NX-by-1 cellarray of strings (use '' for unnamed states)
Example: {'position' ; 'velocity'}.

Properties shared by all LTI models (optional).


Ts - Sample time (in second).
Positive scalar (sampling period) for discrete systems
Ts = -1 for discrete systems with unspecified sampling rate
Ts = 0 for continuous systems.
Td - Input delays (in second).
1-by-NU vector of input delay times. Setting Td to a scalar
specifies a common delay for all inputs.
Only supported for continuous systems. Use D2D to specify
discrete delay systems. Td = [] for discrete systems.
InputName - Input names.
String for single-input systems, NU-by-1 cell array of strings
for multiple-input systems (use '' for unnamed inputs).
Examples: 'torque' or {'thrust' ; 'aileron deflection'}.
OutputName - Output names.
String for single-output system, NY-by-1 cell array of strings
for multiple-output systems (use '' for unnamed outputs).
Example: 'power' or {'speed' ; 'angle of attack'}.
Notes - Personal notes.
Any string or cell array of strings.
Example: 'This model was created on Jan. 1st, 2000'.
Userdata - Additional information or data.
Can be any MATLAB data type.

help ssdata

--- help for ss/ssdata.m ---

SSDATA Quick access to state-space data.

[A,B,C,D] = SSDATA(SYS) returns the values of the A,B,C,D


matrices. If SYS is not a state-space model, it is first
converted to state space.

[A,B,C,D,TS,TD] = SSDATA(SYS) also returns the sample time


TS and input delays TD. For continuous systems, TD is a vector
with one entry per input channel. For discrete systems, TD is
the empty matrix [].

Other properties of SYS can be accessed with GET or by direct


structure-like referencing (e.g., SYS.Ts)

See also GET, DSSDATA.

There is more than one ssdata available. See also


help lti/ssdata.m

help zpkdata

--- help for zpk/zpkdata.m ---

ZPKDATA Quick access to zero-pole-gain data.

[Z,P,K] = ZPKDATA(SYS) returns the zeros, poles, and gain for


each I/O channel of the LTI system SYS. The cell arrays Z,P
and the matrix K have as many rows as outputs and as many columns
as inputs, and their (I,J) entries specify the zeros, poles,
and gain of the transfer function from input J to output I.
SYS is first converted to zero-pole-gain format if necessary.

[Z,P,K,TS,TD] = ZPKDATA(SYS) also returns the sample time


TS and input delays TD. For continuous systems, TD is a vector
with one entry per input channel. For discrete systems, TD is
the empty matrix [].

For SISO systems, the convenience syntax


[Z,P,K] = ZPKDATA(SYS,'v')
returns the zeros Z and poles P as column vectors rather than
cell arrays.

Other properties of SYS can be accessed with GET or by direct


structure-like referencing (e.g., SYS.Ts)

See also GET, TFDATA, SSDATA.

There is more than one zpkdata available. See also


help lti/zpkdata.m

help tfdata

--- help for tf/tfdata.m ---

TFDATA Quick access to transfer function data.

[NUM,DEN] = TFDATA(SYS) returns the numerator(s) and denominator(s)


of the transfer function SYS. NUM and DEN are cell arrays with as
many rows as outputs and as many columns as inputs, and their (I,J)
entries specify the transfer function from input J to output I.
SYS is first converted to transfer function if necessary.

[NUM,DEN,TS,TD] = TFDATA(SYS) also returns the sample time TS and


input delays TD. For continuous systems, TD is a vector with one
entry per input channel. For discrete systems, TD is the empty
matrix [].
For SISO systems, the convenience syntax
[NUM,DEN] = TFDATA(SYS,'v')
returns the numerator and denominator as row vectors rather than
cell arrays.

Other properties of SYS can be accessed with GET or by direct


structure-like referencing (e.g., SYS.Ts)

See also GET, SSDATA, ZPKDATA.

There is more than one tfdata available. See also


help lti/tfdata.m

help dssdata

--- help for ss/dssdata.m ---

DSSDATA Quick access to descriptor state-space data.

[A,B,C,D,E] = DSSDATA(SYS) returns the values of the A,B,C,D,E


matrices. Equivalent to SSDATA when SYS is not a descriptor
state-space model.

[A,B,C,D,E,TS,TD] = DSSDATA(SYS) also returns the sample time


TS and input delays TD. For continuous systems, TD is a vector
with one entry per input channel. For discrete systems, TD is
the empty matrix [].

Other properties of SYS can be accessed with GET or by direct


structure-like referencing (e.g., SYS.Ts)

See also GET, SSDATA.

There is more than one dssdata available. See also


help lti/dssdata.m

help get

GET Get object properties.


V = GET(H,'PropertyName') returns the value of the specified
property for the graphics object with handle H. If H is a
vector of handles, then get will return an M-by-1 cell array
of values where M is equal to length(H). If 'PropertyName' is
replaced by a 1-by-N or N-by-1 cell array of strings containing
property names, then GET will return an M-by-N cell array of
values.

GET(H) displays all property names and their current values for
the graphics object with handle H.
V = GET(H) where H is a scalar, returns a structure where each
field name is the name of a property of H and each field contains
the value of that property.

V = GET(0, 'Factory')
V = GET(0, 'Factory<ObjectType>')
V = GET(0, 'Factory<ObjectType><PropertyName>')
returns for all object types the factory values of all properties
which have user-settable default values.

V = GET(H, 'Default')
V = GET(H, 'Default<ObjectType>')
V = GET(H, 'Default<ObjectType><PropertyName>')
returns information about default property values (H must be
scalar). 'Default' returns a list of all default property values
currently set on H. 'Default<ObjectType>' returns only the
defaults for properties of <ObjectType> set on H.
'Default<ObjectType><PropertyName>' returns the default value
for the specific property, by searching the defaults set on H
and its ancestors, until that default is found. If no default
value for this property has been set on H or any ancestor of H
up through the root, then the factory value for that property
is returned.

Defaults can not be queried on a descendant of the object, or on the


object itself - for example, a value for 'DefaultAxesColor' can not
be queried on an axes or an axes child, but can be queried on a figure
or on the root.

When using the 'Factory' or 'Default' GET, if PropertyName is


omitted then the return value will take the form of a
structure in which each field name is a property name and the
corresponding value is the value of that property. If
PropertyName is specified then a matrix or string value will be
returned.

See also SET, RESET, DELETE, GCF, GCA, FIGURE, AXES.

Overloaded methods
help zpk/get.m
help tf/get.m
help ss/get.m
help lti/get.m

help class

CLASS Create object or return object class.


CLASS(OBJ) returns the class of the object OBJ.
Possibilities are:
double -- double precision floating point number array
(this is the traditional MATLAB matrix or array)
sparse -- 2-D real (or complex) sparse matrix
struct -- Structure array
cell -- cell array
char -- Character array
<class_name> -- Custom object class

Within a constructor method, CLASS(S,'class_name') creates an


object of class 'class_name' from the structure S. This
syntax is only valid in a function named <class_name>.m in a
directory named @<class_name> (where <class_name> is the same
as the string passed into CLASS). On VMS, the method directory
has the name #<class_name>.

CLASS(S,'class_name',PARENT1,PARENT2,...) also inherits the


methods and fields of the parent objects PARENT1, PARENT2, ...

See also ISA, SUPERIORTO, INFERIORTO, STRUCT.

help size

SIZE Size of matrix.


D = SIZE(X), for M-by-N matrix X, returns the two-element
row vector D = [M, N] containing the number of rows and columns
in the matrix. For N-D arrays, SIZE(X) returns a 1-by-N
vector of dimension lengths. Trailing singleton dimensions
are ignored.

[M,N] = SIZE(X) returns the number of rows and columns in


separate output variables. [M1,M2,M3,...,MN] = SIZE(X)
returns the length of the first N dimensions of X.

M = SIZE(X,DIM) returns the length of the dimension specified


by the scalar DIM. For example, SIZE(X,1) returns the number
of rows.

See also LENGTH, NDIMS.

Overloaded methods
help zpk/size.m
help tf/size.m
help ss/size.m

help isempty

ISEMPTY True for empty matrix.


ISEMPTY(X) returns 1 if X is an empty array and 0 otherwise. An
empty array has no elements, that is prod(size(X))==0.
Overloaded methods
help lti/isempty.m

help isct

--- help for lti/isct.m ---

ISCT Check if the LTI model SYS is a continuous-time system.

ISCT(SYS) returns 1 if SYS is continuous (zero sampling time)


and 0 otherwise.

See also ISDT.

help isdt

--- help for zpk/isdt.m ---

ISDT Check if LTI model SYS is a discrete-time system.

ISDT(SYS) returns 1 if SYS is discrete, 0 otherwise.


It always returns 1 for empty systems or static gains.

See also ISCT.

There is more than one isdt available. See also


help tf/isdt.m
help ss/isdt.m

help isproper

--- help for zpk/isproper.m ---

ISPROPER True for proper LTI systems.

ISPROPER(SYS) returns 1 (true) if the LTI model SYS is proper


(relative degree<=0), and 0 (false) otherwise.

See also ISSISO, ISEMPTY.

There is more than one isproper available. See also


help tf/isproper.m
help ss/isproper.m

help issiso

--- help for lti/issiso.m ---

ISSISO True for SISO LTI models.


ISSISO(SYS) returns 1 (true) if SYS is a SISO system, and
0 (false) otherwise.

See also SIZE, ISEMPTY.

help isa

ISA True if object is a given class.


ISA(OBJ,'class_name') returns 1 if OBJ is of class (or
subclass) of 'class_name' and 0 otherwise.

Some possibilities for 'class_name' are:


double -- Double precision floating point number array
(this is the traditional MATLAB matrix or array)
sparse -- 2-D real (or complex) sparse matrix
struct -- Structure array
cell -- Cell array
char -- Character array
uint8 -- Unsigned 8-bit integer array
<class_name> -- Custom object class

See also ISOBJECT, CLASS.

help ss

SS Create state-space models or convert LTI model to state space.

You can create a state-space model by:


SYS = SS(A,B,C,D) Continuous-time model
SYS = SS(A,B,C,D,T) Discrete-time model with sampling time T
(Set T=-1 if undetermined)
SYS = SS Default empty SS object
SYS = SS(D) Static gain matrix
SYS = SS(A,B,C,D,LTI) State-space model with LTI properties
inherited from the system LTI (can be
SS, TF, or ZPK)
All the above syntaxes may be followed by Property/Value pairs.
(Type "help ltiprops" for details on assignable properties).
Setting D=0 is interpreted as the zero matrix of adequate
dimensions. The output SYS is an SS object.

SYS_SS = SS(SYS) converts an arbitrary LTI model SYS to state space,


i.e., computes a state-space realization SYS_SS of SYS.

See also SET, SSDATA, DSS, TF, ZPK.

help zpk

ZPK Specify zero-pole-gain models or convert to zero-pole-gain form.


ZSYS = ZPK(SYS) converts an arbitrary LTI model SYS to
zero-pole-gain form. The output ZSYS is a ZPK object.

ZSYS = ZPK(SYS,'inv') uses a fast algorithm for state-space SYS,


but is typically less accurate for high-order systems with low
gain at s=0.

You can create SISO or MIMO zero-pole-gain (ZPK) models by:


SYS = ZPK(Z,P,K) Continuous-time system.
SYS = ZPK(Z,P,K,T) Discrete-time system with sample time T
(Set T=-1 if undetermined)
SYS = ZPK Default empty zero-pole-gain object
SYS = ZPK(M) Static gain matrix
SYS = ZPK(Z,P,K,LTI) ZPK model with LTI properties inherited
from system LTI (can be SS, TF, or ZPK).
All the above syntaxes may be followed by Property/Value pairs
(Type "help ltiprops" for details on assignable properties).
The output SYS is a ZPK object.

For SISO systems, Z and P are the vectors of zeros and poles
(set to [] if none) and K is the scalar gain.

For MIMO systems with NU inputs and NY outputs,


* Z and P are NY-by-NU cellarrays where Z{i,j} and P{i,j} are
the vectors of zeros and poles of the transfer function
from input j to output i
* K is the 2-D matrix of gains for each I/O channel.
For example,
zpk( {[];[2 3]} , {1;[0 -1]} , [-5;1] )
specifies the one-input/two-output system
[ -5 /(s-1) ]
[ (s-2)(s-3)/s(s+1) ]

See also ZPKDATA, GET, SET, LTIPROPS, TF, SS.

help tf

TF Specify transfer functions or convert LTI model to transfer function.

TFSYS = TF(SYS) converts an arbitrary LTI model SYS to transfer


function format. The output TFSYS is a TF object.

TFSYS = TF(SYS,'inv') uses a fast algorithm for state-space SYS,


but is typically less accurate for high-order systems.

You can create SISO or MIMO transfer functions (TF) by


SYS = TF(NUM,DEN) Continuous-time system NUM(s)./DEN(s)
SYS = TF(NUM,DEN,T) Discrete-time system NUM(z)./DEN(z) with
sampling time T (Set T=-1 if undetermined)
SYS = TF Default empty TF object
SYS = TF(M) Static gain matrix
SYS = TF(NUM,DEN,LTI) Transfer function with LTI properties inherited
from system LTI (can be SS, TF, or ZPK).
All the above syntaxes may be followed by Property/Value pairs.
(Type "help ltiprops" for details on assignable properties).
The output SYS is a TF object.

The default TF variables 's' and 'z' can be altered by resetting


the 'Variable' property. Alternatives include 'p' for continuous TF
and 'z^-1' or 'q' for discrete TF.

For SISO systems, NUM and DEN are row vectors listing the numerator and
denominator coefficients in
* descending powers of s or z by default
* ascending powers of q = z^-1 if 'Variable' is set to 'z^-1' or 'q'
(DSP convention).

For MIMO systems with NU inputs and NY outputs, NUM and DEN are
NY-by-NU cell arrays of row vectors where NUM{i,j} and DEN{i,j} specify
the transfer function from input j to output i. For example,
tf( {-5 ; [1 -5 6]} , {[1 -1] ; [1 1 0]})
specifies the two-output/one-input system

[ -5 /(s-1) ]
[ (s^2-5s+6)/(s^2+s) ]

See also FILT, TFDATA, GET, SET, LTIPROPS, ZPK, SS.

help c2d

C2D Conversion of continuous-time systems to discrete time.

SYSD = C2D(SYSC,TS,METHOD) converts the continuous system SYSC


to a discrete-time system SYSD with sample time TS. The string
METHOD selects the discretization method among the following:
'zoh' Zero-order hold on the inputs.
'foh' Linear interpolation of inputs (triangle appx.)
'tustin' Bilinear (Tustin) approximation.
'prewarp' Tustin approximation with frequency prewarping.
The critical frequency Wc is specified last as in
C2D(SysC,Ts,'prewarp',Wc)
'matched' Matched pole-zero method (for SISO systems only).
The default is 'zoh' when METHOD is omitted.

If SYS is a delay-free state-space model with initial state x0, the


matching initial state for its FOH discretization is x0-G*u(1,:)
where the matrix G is given by [SYSD,G] = C2D(SYSC,TS,'foh').

See also D2C, D2D.


Overloaded methods
help zpk/c2d.m
help tf/c2d.m
help ss/c2d.m

help d2c

D2C Conversion of discrete LTI models to continuous time.

SYSC = D2C(SYSD,METHOD) produces an equivalent continuous-time


model SYSC for the discrete-time LTI model SYSD. The string
METHOD selects the conversion method among the following:
'zoh' Assumes zero-order hold on the inputs.
'tustin' Bilinear (Tustin) approximation.
'prewarp' Tustin approximation with frequency prewarping.
The critical frequency Wc is specified last as in
D2C(SysD,'prewarp',Wc)
'matched' Matched pole-zero method (for SISO systems only).
The default is 'zoh' when METHOD is omitted.

See also C2D, D2D.

Overloaded methods
help zpk/d2c.m
help tf/d2c.m
help ss/d2c.m

help d2d

D2D Resample discrete LTI system or specify input delays

SYS = D2D(SYS,Ts) resamples the discrete-time LTI system SYS


to produce a discrete system with sample time Ts.

SYS = D2D(SYS,[],Nd) computes an equivalent delay-free LTI


model for the discrete system SYS with input delays specified
by Nd. The input delays must be integer multiples Nd*Ts of
the sampling period Ts of SYS, Nd being a vector of integers
with as many entries as inputs. A uniform input delay is
assumed if Nd is an integer scalar.

See also D2C, C2D.

Overloaded methods
help zpk/d2d.m
help tf/d2d.m
help ss/d2d.m

help pole
--- help for zpk/pole.m ---

POLE Find the poles of an LTI system.

P = POLE(SYS) returns the poles of SYS (P is a column vector).

For state-space models, the poles are the eigenvalues of the A


matrix or the generalized eigenvalues of the (A,E) pair in the
descriptor case.

See also DAMP, ESORT, DSORT, PZMAP, TZERO.

There is more than one pole available. See also


help tf/pole.m
help ss/pole.m

help eig

EIG Eigenvalues and eigenvectors.


E = EIG(X) is a vector containing the eigenvalues of a square
matrix X.

[V,D] = EIG(X) produces a diagonal matrix D of eigenvalues and a


full matrix V whose columns are the corresponding eigenvectors so
that X*V = V*D.

[V,D] = EIG(X,'nobalance') performs the computation with balancing


disabled, which sometimes gives more accurate results for certain
problems with unusual scaling.

E = EIG(A,B) is a vector containing the generalized eigenvalues


of square matrices A and B.

[V,D] = EIG(A,B) produces a diagonal matrix D of generalized


eigenvalues and a full matrix V whose columns are the
corresponding eigenvectors so that A*V = B*V*D.

See also CONDEIG, EIGS.

Overloaded methods
help lti/eig.m

help tzero

TZERO Transmission zeros of LTI systems.

Z = TZERO(SYS) returns the transmission zeros of the LTI


system SYS.
[Z,GAIN] = TZERO(SYS) also returns the transfer function
gain if the system is SISO.

Z = TZERO(A,B,C,D) works directly on the state space matrices


and returns the transmission zeros of the state-space system:
.
x = Ax + Bu or x[n+1] = Ax[n] + Bu[n]
y = Cx + Du y[n] = Cx[n] + Du[n]

See also PZMAP, POLE, EIG.

Overloaded methods
help lti/tzero.m

help pzmap

PZMAP Pole-zero map of linear systems.

For a SISO system, PZMAP(SYS) computes the poles and zeros


of SYS and plots them in the complex plane. The poles are
plotted as x's and the zeros are plotted as o's.

In the MIMO case, PZMAP(SYS) plots the poles and transmission


zeros of SYS.

When invoked with left hand arguments,


[P,Z] = PZMAP(SYS)
returns the poles and (transmission) zeros of the system in the
column vectors P and Z. No plot is drawn on the screen.

The functions SGRID or ZGRID can be used to plot lines of constant


damping ratio and natural frequency in the s or z plane.

See also RLOCUS, SGRID, ZGRID, EIG, TZERO.

Overloaded methods
help lti/pzmap.m

help dcgain

DCGAIN DC gain of LTI systems.

K = DCGAIN(SYS) computes the steady state (D.C. or low frequency)


gain of the system SYS.

See also NORM, EVALFR, FREQRESP.

Overloaded methods
help zpk/dcgain.m
help tf/dcgain.m
help ss/dcgain.m

help norm

NORM Matrix or vector norm.


For matrices...
NORM(X) is the largest singular value of X, max(svd(X)).
NORM(X,2) is the same as NORM(X).
NORM(X,1) is the 1-norm of X, the largest column sum,
= max(sum(abs((X)))).
NORM(X,inf) is the infinity norm of X, the largest row sum,
= max(sum(abs((X')))).
NORM(X,'fro') is the Frobenius norm, sqrt(sum(diag(X'*X))).
NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.

For vectors...
NORM(V,P) = sum(abs(V).^P)^(1/P).
NORM(V) = norm(V,2).
NORM(V,inf) = max(abs(V)).
NORM(V,-inf) = min(abs(V)).

See also COND, CONDEST, NORMEST.

Overloaded methods
help lti/norm.m

help covar

COVAR Covariance response of LTI systems to white noise.

P = COVAR(SYS,W) computes the covariance P = E[yy'] of the


output response when the LTI system SYS is driven by Gaussian
white noise inputs. The white noise intensity W is defined by

E[w(t)w(tau)'] = W delta(t-tau) (delta(t) = Dirac delta)

in continuous time and

E[w(k)w(n)'] = W delta(k,n) (delta(k,n) = Kronecker delta)

in discrete time. Note that unstable systems or continuous systems


with non-zero feedthrough have infinite covariance response.

[P,Q] = COVAR(SYS,W) also returns the state covariance Q = E[xx']


when SYS is a state-space system.

See also LYAP and DLYAP.

Overloaded methods
help lti/covar.m
help damp

DAMP Natural frequency and damping factor of LTI system poles.

[Wn,Z] = DAMP(SYS) returns vectors Wn and Z containing the


natural frequencies and damping factors of the LTI system SYS.
For discrete-time systems, the equivalent s-plane natural
frequency and damping ratio of an eigenvalue lambda are given by:

Wn = abs(log(lamba))/Ts , Z = -cos(angle(log(lamba))) .

Wn and Z are empty vectors if the sample time Ts is undefined.

[Wn,Z,P] = DAMP(SYS) also returns the system poles P.

When invoked without left-hand arguments, DAMP prints the poles


with their natural frequency and damping factor in a tabular format
on the screen. The poles are sorted by increasing frequency.

See also POLE, ESORT, DSORT, PZMAP, TZERO.

Overloaded methods
help lti/damp.m

help esort

ESORT Sort complex continuous eigenvalues in descending order.

S = ESORT(P) sorts the complex eigenvalues in the vector P in


descending order by real part. The unstable eigenvalues (in
the continuous-time sense) will appear first.

[S,NDX] = ESORT(P) also returns the vector NDX containing the


indexes used in the sort.

See also: DSORT and SORT.

help dsort

DSORT Sort complex discrete eigenvalues in descending order.

S = DSORT(P) sorts the complex eigenvalues in the vector P in


descending order by magnitude. The unstable eigenvalues (in
the continuous-time sense) will appear first.

[S,NDX] = DSORT(P) also returns the vector NDX containing the


indexes used in the sort.

See also: ESORT and SORT.


help pade

PADE Pade approximation of time delays.

[NUM,DEN] = PADE(T,N) returns the Nth-order Pade approximation


of the continuous time delay exp(-T*s) in transfer function form.
The row vectors NUM and DEN contain the polynomial coefficients
in descending powers of s.

When invoked without left-hand argument, PADE(T,N) plots the


step and phase responses of the N-th order Pade approximation
and compares them with the exact responses of the time delay
(Note: the Pade approximation has unit gain at all frequencies).

SYSX = PADE(SYS,N) returns a delay-free approximation SYSX of


the delay system SYS by replacing all input delays by their
Nth-order Pade approximation. If SYS has m inputs, you can
specify independent approximation orders for each input channel
with the syntax SYSX = PADE(SYS,[N1 , ... , Nm]).

See also C2D.

Overloaded methods
help lti/pade.m

help rss

RSS Generate random stable continuous-time state-space models.

SYS = RSS(N) generates an Nth-order SISO state-space model SYS.

SYS = RSS(N,P) generates a single-input Nth-order model with


P outputs.

SYS = RSS(N,P,M) generates an Nth-order model with M inputs and


P outputs.

To generate random TF or ZPK models, convert the result SYS to


the appropriate model type with the functions TF or ZPK.

See also: DRSS, TF, ZPK.

help drss

DRSS Generate random stable discrete-time state-space models.

SYS = DRSS(N) generates an Nth-order SISO state-space model SYS.

SYS = DRSS(N,P) generates a single-input Nth-order model with


P outputs.

SYS = DRSS(N,P,M) generates an Nth-order model with M inputs and


P outputs.

In all cases, the sample time is left unspecified (set to -1).


To generate random discrete TF or ZPK models, convert the result SYS
to the appropriate model type with the functions TF or ZPK.

See also: RSS, TF, ZPK.

help ss2ss

SS2SS Change of state coordinates for state-space systems.

SYS = SS2SS(SYS,T) performs the similarity transformation z = Tx


on the state vector x of the system SYS. The resulting state-space
system is described by:

. -1
z = [TAT ] z + [TB] u
-1
y = [CT ] z + D u

(Respectively,

-1 . -1
[TET ] z = [TAT ] z + [TB] u
-1
y = [CT ] z + D u

in the descriptor case).

See also CANON, AUGSTATE, SSBAL, BALREAL.

Overloaded methods
help ss/ss2ss.m
help lti/ss2ss.m

help canon

CANON Canonical state-space realizations.

CSYS = CANON(SYS,TYPE) computes a canonical state-space


realization CSYS of the LTI model SYS. The string TYPE
selects the type of canonical form:
'modal' : Modal canonical form where the system
eigenvalues appear on the diagonal.
The state matrix A must be diagonalizable.
'companion': Companion canonical form where the characteristic
polynomial appears in the right column.

[CSYS,T] = CANON(SYS,TYPE) also returns the state transformation


matrix T such that z = Tx where z is the new state. This syntax
is only meaningful when SYS is a state-space model.

The modal form is useful for determining the relative controll-


ability of the system modes. Note: the companion form is ill-
conditioned and should be avoided if possible.

See also SS2SS, CTRB, and CTRBF.

Overloaded methods
help ss/canon.m
help lti/canon.m

help ctrb

CTRB Form the controllability matrix.

CO = CTRB(A,B) returns the controllability matrix [B AB A^2B ...].

CO = CTRB(SYS) returns the controllability matrix of the


state-space system SYS with realization (A,B,C,D). This is
equivalent to CTRB(sys.a,sys.b)

See also CTRBF.

Overloaded methods
help lti/ctrb.m

help obsv

OBSV Form the observability matrix.

OB = OBSV(A,C) returns the observability matrix [C; CA; CA^2 ...]

CO = OBSV(SYS) returns the observability matrix of the state-space


system SYS with realization (A,B,C,D). This is equivalent to
OBSV(sys.a,sys.c)

See also OBSVF.

Overloaded methods
help lti/obsv.m

help gram

GRAM Controllability and observability gramians.


Wc = GRAM(SYS,'c') returns the controllability gramian of
the state-space system SYS.

Wo = GRAM(SYS,'o') returns its observability gramian.

In both cases, the state-space model SYS should be stable.


The gramians are computed by solving the Lyapunov equations:

* A*Wc + Wc*A' + BB' = 0 and A'*Wo + Wo*A + C'C = 0


for continuous-time systems
dx/dt = A x + B u , y = C x + D u

* A*Wc*A' - Wc + BB' = 0 and A'*Wo*A - Wo + C'C = 0


for discrete-time systems
x[n+1] = A x[n] + B u[n] , y[n] = C x[n] + D u[n].

See also BALREAL, CTRB, OBSV.

Overloaded methods
help lti/gram.m

help ssbal

--- help for ss/ssbal.m ---

SSBAL Balancing of state-space model using diagonal similarity.

[SYS,T] = SSBAL(SYS) uses BALANCE to compute a diagonal similarity


transformation T such that [T*A/T , T*B ; C/T 0] has approximately
equal row and column norms.

[SYS,T] = SSBAL(SYS,CONDT) specifies an upper bound CONDT on the


condition number of T. Since balancing with ill-conditioned T can
inadvertly magnify rounding errors, CONDT gives control over the
worst-case round-off amplification factor. The default value is
CONDT = 1/eps.

See also BALREAL, COMPBAL.

help balreal

BALREAL Gramian-based balancing of state-space realizations.

SYSb = BALREAL(SYS) returns a balanced state-space


realization of the reachable, observable, stable system SYS.

[SYSb,G,T,Ti] = BALREAL(SYS) also returns a vector G containing


the diagonal of the Gramian of the balanced realization. The
matrices T is the state transformation xb = Tx used to convert SYS
to SYSb, and Ti is its inverse.
If the system is normalized properly, small elements in the balanced
Gramian G indicate states that can be removed to reduce the model
to lower order.

See also MODRED, GRAM, SSBAL.

Overloaded methods
help ss/balreal.m
help lti/balreal.m

help modred

MODRED Model state reduction.

RSYS = MODRED(SYS,ELIM) or RSYS = MODRED(SYS,ELIM,'mdc') reduces


the order of the state-space model SYS by eliminating the states
specified in vector ELIM. The state vector is partitioned into X1,
to be kept, and X2, to be eliminated,

A = |A11 A12| B = |B1| C = |C1 C2|


|A21 A22| |B2|
.
x = Ax + Bu, y = Cx + Du (or discrete time counterpart).

The derivative of X2 is set to zero, and the resulting equations


solved for X1. The resulting system has LENGTH(ELIM) fewer states
and can be envisioned as having set the ELIM states to be infinitely
fast. The original and reduced models have matching DC gains
(steady-state response).

RSYS = MODRED(SYS,ELIM,'del') simply deletes the states X2. This


typically produces a better approximation in the frequency domain,
but the DC gains are not guaranteed to match.

If SYS has been balanced with BALREAL and the gramians have M
small diagonal entries, you can reduce the model order by
eliminating the last M states with MODRED.

See also BALREAL.

Overloaded methods
help ss/modred.m
help lti/modred.m

help minreal

MINREAL Minimal realization and pole-zero cancellation.

SYSr = MINREAL(SYS)
For state-space LTI systems SYS, this produces a minimal
realization SYSr of SYS. For transfer function or
zero/pole/gain models, SYSr is a simplified model where
all common poles and zeros have been cancelled.

SYSr = MINREAL(SYS,TOL) further specifies the tolerance


used for state elimination or pole-zero cancellations.
The default value is SQRT(EPS) and increasing this tolerance
forces additional state deletions or pole/zero cancellations.

See also BALREAL, MODRED.

Overloaded methods
help zpk/minreal.m
help tf/minreal.m
help ss/minreal.m

help augstate

AUGSTATE Appends states to the outputs of a state-space system.

ASYS = AUGSTATE(SYS) appends the states to the outputs of


the system SYS. The resulting system is:
. .
x = A x + B u (or E x = A x + B u for descriptor SS)

|y| = [C] x + [D] u


|x| [I] [0]

This command is useful to close the loop on a full-state


feedback gain u = Kx. After preparing the plant with
AUGSTATE, you can use the FEEDBACK command to form the
closed-loop system.

See also FEEDBACK.

Overloaded methods
help ss/augstate.m
help lti/augstate.m

help step

STEP Step response of LTI systems.

STEP(SYS) plots the step response of each input channel of


the LTI system SYS. The time range and number of points are
chosen automatically.

STEP(SYS,TFINAL) simulates the step response from t = 0 to the


final time t = TFINAL. For discrete-time systems with unspecified
sampling time, TFINAL is interpreted as the number of samples.

STEP(SYS,T) uses the user-supplied time vector T for simulation.


For discrete-time systems, T should be of the form Ti:Ts:Tf
where Ts is the sample time of the system. For continuous systems,
T should be of the form Ti:dt:Tf where dt will become the sample
time of a discrete approximation to the continuous system.

STEP(SYS1,SYS2,...,T) plots the step response of multiple LTI


systems SYS1,SYS2,... on a single plot. The time vector T is
optional. You can also specify a color, line style, and marker
for each system, as in step(sys1,'r',sys2,'y--',sys3,'gx').

When invoked with left-hand arguments,


[Y,T] = STEP(SYS,...)
returns the output response Y and the time vector T used for
simulation. No plot is drawn on the screen. If SYS has
NU inputs and NY outputs, and LT=length(T), the array Y is
LT-by-NY-by-NU and Y(:,:,j) gives the step response of the
j-th input channel.

For state-space systems,


[Y,T,X] = STEP(SYS,...)
also returns the state trajectory X which is an LT-by-NX-by-NU
array if SYS has NX states.

See also INITIAL, IMPULSE, LSIM.

Overloaded methods
help lti/step.m

help impulse

IMPULSE Impulse response of LTI systems.

IMPULSE(SYS) plots the impulse response of each input channel of


the LTI system SYS. The time range and number of points are chosen
automatically. The infinite pulse at t = 0 in the response of
continuous systems with direct feedthrough is disregarded.

IMPULSE(SYS,TFINAL) simulates the impulse response from t = 0 to the


final time t = TFINAL. For discrete-time systems with unspecified
sampling time, TFINAL is interpreted as the number of samples.

IMPULSE(SYS,T) uses the user-supplied time vector T for simulation.


For discrete-time systems, T should be of the form Ti:Ts:Tf
where Ts is the sample time of the system. For continuous systems,
T should be of the form Ti:dt:Tf where dt will become the sample
time of a discrete approximation to the continuous system.
IMPULSE(SYS1,SYS2,...,T) plots the step response of multiple
LTI systems SYS1,SYS2,... on a single plot. The time vector T is
optional. You can also specify a color, line style, and marker
for each system, as in impulse(sys1,'r',sys2,'y--',sys3,'gx').

When invoked with left-hand arguments,


[Y,T] = IMPULSE(SYS, ...)
returns the output response Y and the time vector T used for
simulation. No plot is drawn on the screen. If SYS has
NU inputs and NY outputs, and LT=length(T), the array Y is
LT-by-NY-by-NU and Y(:,:,j) gives the impulse response of the
j-th input channel.

For state-space systems,


[Y,T,X] = IMPULSE(SYS, ...)
also returns the state trajectory X which is an LT-by-NX-by-NU array
if SYS has NX states.

See also STEP, INITIAL, LSIM.

Overloaded methods
help lti/impulse.m

help initial

INITIAL Initial condition response of state-space models.

INITIAL(SYS,X0) plots the undriven response of the state-space


system SYS with initial condition X0 on the states. This
response is characterized by the equations
.
Continuous time: x = A x , y = C x , x(0) = x0

Discrete time: x[k+1] = A x[k], y[k] = C x[k], x[0] = x0 .

The time range and number of points are chosen automatically.

INITIAL(SYS,X0,TFINAL) simulates the time response from t = 0


to the final time t = TFINAL. For discrete-time systems with
unspecified sample time, TFINAL should be the number of samples.

INITIAL(SYS,X0,T) specifies a time vector T to be used for


simulation. For discrete systems, T should be of the form
0:Ts:Tf where Ts is the sample time of the system. For continuous
systems, T should be of the form 0:dt:Tf where dt will become the
sample time of a discrete approximation of the continuous system.

INITIAL(SYS1,SYS2,...,X0,T) plots the response of multiple LTI


systems SYS1,SYS2,... on a single plot. The time vector T is
optional. You can also specify a color, line style, and marker
for each system, as in initial(sys1,'r',sys2,'y--',sys3,'gx',x0).

When invoked with left hand arguments,


[Y,T,X] = INITIAL(SYS,X0,...)
returns the output response Y, the time vector T used for simulation,
and the state trajectories X. No plot is drawn on the screen. The
matrix Y has LENGTH(T) rows and as many columns as outputs in SYS.
Similarly, X has LENGTH(T) rows and as many columns as states.

See also IMPULSE, STEP, LSIM.

Overloaded methods
help lti/initial.m

help lsim

LSIM Simulation of the time response of LTI systems to arbitrary inputs.

LSIM(SYS,U,T) plots the time response of the LTI system SYS to the
input signal described by U and T. The time vector T consists of
regularly spaced time samples and U is a matrix with as many columns
as inputs and whose i-th row specifies the input value at time T(i).
For instance,
t = 0:0.01:5; u = sin(t); lsim(sys,u,t)
simulates the response of SYS to u(t) = sin(t) during 5 seconds.

In discrete time, U should be sampled at the same rate as the system


(T is then redundant and can be omitted or set to the empty matrix).
In continuous time, the sampling period T(2)-T(1) should be chosen
small enough to capture the details of the input signal. The time
vector T is resampled when intersample oscillations may occur.

LSIM(SYS,U,T,X0) specifies an additional nonzero initial state X0


(for state-space systems only).

LSIM(SYS1,SYS2,...,U,T,X0) simulates the response of multiple LTI


systems SYS1,SYS2,... on a single plot. The initial condition X0
is optional. You can also specify a color, line style, and marker
for each system, as in lsim(sys1,'r',sys2,'y--',sys3,'gx',u,t).

When invoked with left hand arguments,


[Y,T] = LSIM(SYS,U,...)
returns the output history Y and time vector T used for simulation.
No plot is drawn on the screen. The matrix Y has LENGTH(T) rows
and as many columns as outputs in SYS.

For state-space systems,


[Y,T,X] = LSIM(SYS,U,...)
also returns the state trajectory X, a matrix with LENGTH(T) rows
and as many columns as states.

See also GENSIG, STEP, IMPULSE, INITIAL.

Overloaded methods
help lti/lsim.m

help ltiview

LTIVIEW Open the LTI Viewer


LTIVIEW issued from the command line without any input arguments
initializes the LTI Viewer. This user-interface is used to perform the
various Control Toolbox response functions for any state space, transfer
function, or zero-pole-gain system in the workspace.

LTIVIEW(PLOTTYPE) opens an LTI Viewer with the LTI system response


of a random model with two inputs, two outputs, and three states.
PLOTTYPE may be any of the following strings.

PLOTTYPE may be: 1) 'step'


2) 'impulse'
3) 'bode'
4) 'nyquist'
5) 'nichols'
6) 'sigma'
7) 'lsim'
8) 'initial'

LTIVIEW(PLOTTYPE,SYS) initializes a new LTI Viewer with the response type


indicated by PLOTTYPE for the LTI system SYS.

LTIVIEW(PLOTTYPE,SYS1,SYS2,...SYSN) initializes a new LTI Viewer with the


responses of multiple LTI systems

LTIVIEW(PLOTTYPE,SYS1,PLOTSTR1,SYS2,PLOTSTR2,...SYSN,PLOTSTRN)
initializes
an LTI Viewer with the responses of multiple LTI systems, each represented
by a line with the characteristics in the associated PLOTSTR. A color
linestyle, and marker may be contained in each PLOTSTR string. For
example, 'r' is a solid red line, 'b--' is a dashed blue line, and
'm*:' is a dotted magenta line with astericks as markers.

LTIVIEW(PLOTTYPE,SYS,OPTIONS) allows the additional input


arguments supported by the different PLOTTYPES to be entered.
These arguments are specified in accordance with the
function given in PLOTTYPE. See the appropriate HELP text for more
detail on the format of these extra arguments. In the case of LSIM
and INITIAL, the OPTIONS field must include the input signal or
initial condition, respectively. OPTIONS can be added to the end
of any LTIVIEW calling syntax
Two additional PLOTTYPE options are available for manipulating
previously opened LTI Viewers:

LTIVIEW('clear',Hviewers) clears the plots and data from the LTI Viewers
with the handles provided in Hviewers.

LTIVIEW('current',SYS1,PLOTSTR1,SYS2,PLOTSTR2,...SYSN,PLOTSTRN,Hviewers)
appends the responses for the systems in SYS# to the LTI Viewers with the
handles provided in Hviewers, if the systems have the same dimensions as
those currently in the LTI Viewer. If the dimensions are different, the LTI
Viewer is first cleared and only the new responses are shown. The response
type will be the one currently selected by the Plot Type popup menu.

See also STEP, IMPULSE, BODE, NYQUIST, NICHOLS, SIGMA, LSIM, INITIAL

help gensig

GENSIG Periodic signal generator for time response simulations with LSIM.

[U,T] = GENSIG(TYPE,TAU) generates a scalar signal U of class TYPE


and period TAU. The following classes are supported:
TYPE = 'sin' --- sine wave
TYPE = 'square' --- square wave
TYPE = 'pulse' --- periodic pulse
GENSIG returns a vector T of time samples and the vector U of signal
values at these samples. All generated signals have unit amplitude.

[U,T] = GENSIG(TYPE,TAU,TF,TS) further specifies the time duration TF


of the signal and the spacing TS of the time samples in T.

See also LSIM, SQUARE, SAWTOOTH.

help stepfun

STEPFUN Unit step function.

STEPFUN(T,T0), where T is a monotonically increasing vector,


returns a vector the same length as T with zeros where T < T0
and ones where T >= T0.

help bode

BODE Bode frequency response of LTI systems.

BODE(SYS) draws the Bode plot of the LTI system SYS. The
frequency range and number of points are chosen automatically.

BODE(SYS,{WMIN,WMAX}) draws the Bode plot for frequencies


between WMIN and WMAX (in radian/second).
BODE(SYS,W) uses the user-supplied vector W of frequencies,
in radian/second, at which the Bode response is to be evaluated.
See LOGSPACE to generate logarithmically spaced frequency vectors.

BODE(SYS1,SYS2,...,W) plots the Bode response of multiple LTI


systems SYS1,SYS2,... on a single plot. The frequency vector W
is optional. You can also specify a color, line style, and marker
for each system, as in bode(sys1,'r',sys2,'y--',sys3,'gx').

When invoked with left-hand arguments,


[MAG,PHASE,W] = BODE(SYS,...)
returns the frequency vector W and arrays MAG and PHASE of
magnitudes (in dB) and phases (in degrees). No plot is drawn
on the screen. If SYS has NU inputs and NY outputs and
LW=length(W), MAG and PHASE are NY-by-NU-by-LW arrays and
the response at the frequency W(k) is given by MAG(:,:,k) and
PHASE(:,:,k).

For discrete systems with sample time Ts, BODE uses the
transformation Z = exp(j*W*Ts) to map the unit circle to the
real frequency axis. The frequency response is only plotted
for frequencies smaller than the Nyquist frequency pi/Ts, and
the default value 1 (second) is assumed when Ts is unspecified.

See also NICHOLS, NYQUIST, SIGMA, FREQRESP, LTIVIEW.

Overloaded methods
help lti/bode.m

help sigma

SIGMA Singular value plot of LTI systems.

SIGMA(SYS) produces a singular value (SV) plot of the frequency


response of the system SYS. The frequency range and number of
points are chosen automatically. See BODE for details on the
notion of frequency in discrete time.

SIGMA(SYS,{WMIN,WMAX}) draws the SV plot for frequencies ranging


between WMIN and WMAX (in radian/second).

SIGMA(SYS,W) uses the user-supplied vector W of frequencies, in


radian/second, at which the frequency response is to be evaluated.
See LOGSPACE to generate logarithmically spaced frequency vectors.

SIGMA(SYS,W,TYPE) or SIGMA(SYS,[],TYPE) draws the following


modified SV plots depending on the value of TYPE:
TYPE = 1 --> SV of inv(SYS)
TYPE = 2 --> SV of I + SYS
TYPE = 3 --> SV of I + inv(SYS)
SYS should be a square system when using this syntax.

SIGMA(SYS1,SYS2,...,W,TYPE) draws the SV response of several LTI


systems SYS1,SYS2,... on a single plot. The arguments W and TYPE
are optional. You can also specify a color, line style, and marker
for each system, as in sigma(sys1,'r',sys2,'y--',sys3,'gx').

When invoked with left-hand arguments,


[SV,W] = SIGMA(SYS,...)
returns the frequency vector W and array SV of singular values
at these frequencies. No plot is drawn on the screen. The 2-D
array SV has length(W) columns and its k-th column SV(:,k) gives
the singular values (in descending order) at the frequency W(k).

For details on Robust Control Toolbox syntax, type HELP RSIGMA.

See also BODE, NICHOLS, NYQUIST, FREQRESP, LTIVIEW.

Overloaded methods
help lti/sigma.m

help nyuist

nyuist.m not found.

help nyquist

NYQUIST Nyquist frequency response of LTI systems.

NYQUIST(SYS) draws the Nyquist plot of the system SYS. The


frequency range and number of points are chosen automatically.
See BODE for details on the notion of frequency in discrete-time.

NYQUIST(SYS,{WMIN,WMAX}) draws the Nyquist plot for frequencies


between WMIN and WMAX (in radians/second).

NYQUIST(SYS,W) uses the user-supplied vector W of frequencies


(in radian/second) at which the Nyquist response is to be evaluated.
See LOGSPACE to generate logarithmically spaced frequency vectors.

NYQUIST(SYS1,SYS2,...,W) plots the Nyquist response of multiple


LTI systems SYS1,SYS2,... on a single plot. The frequency vector
W is optional. You can also specify a color, line style, and marker
for each system, as in nyquist(sys1,'r',sys2,'y--',sys3,'gx').

When invoked with left-hand arguments,


[RE,IM,W] = NYQUIST(SYS,...)
returns the frequency vector W and the arrays RE and IM of real
and imaginary parts of the frequency response of each I/O channel.
No plot is drawn on the screen. If SYS has NU inputs and NY outputs
and LW=length(W), RE and IM are NY-by-NU-by-LW arrays and the
response at the frequency W(k) is given by RE(:,:,k)+j*IM(:,:,k).

See also BODE, NICHOLS, SIGMA, FREQRESP, LTIVIEW.

Overloaded methods
help lti/nyquist.m

help nichols

NICHOLS Nichols frequency response of LTI systems.

NICHOLS(SYS) draws the Nichols chart of the system SYS. The


frequency range and number of points are chosen automatically.
See BODE for details on the notion of frequency in discrete-time.

NICHOLS(SYS,{WMIN,WMAX}) draws the Nichols chart for frequencies


between WMIN and WMAX (in radian/second).

NICHOLS(SYS,W) uses the user-supplied vector W of frequencies, in


radians/second, at which the Nichols response is to be evaluated.
See LOGSPACE to generate logarithmically spaced frequency vectors.

NICHOLS(SYS1,SYS2,...,W) plots the Nichols chart of multiple LTI


systems SYS1,SYS2,... on a single plot. The frequency vector W
is optional. You can also specify a color, line style, and marker
for each system, as in nichols(sys1,'r',sys2,'y--',sys3,'gx').

When invoked with left-hand arguments,


[MAG,PHASE,W] = NICHOLS(SYS,...)
returns the frequency vector W and matrices MAG and PHASE of
magnitudes and phases (in degrees). No plot is drawn on the
screen. If SYS has NU inputs and NY outputs, and LW=length(W),
MAG and PHASE are NY-by-NU-by-LW arrays and the response at
the frequency W(k) is given by MAG(:,:,k) and PHASE(:,:,k).

See also BODE, NYQUIST, SIGMA, FREQRESP, LTIVIEW.

Overloaded methods
help lti/nichols.m

help evalfr

--- help for lti/evalfr.m ---

EVALFR Evaluate frequency response at a single (complex) frequency.

FRESP = EVALFR(SYS,S) evaluates the transfer function of the


LTI system SYS at the complex number S. For state-space systems,
the result is
-1
FRESP = D + C * (S * E - A) * B .

EVALFR is a simplified version of FREQRESP meant for quick


evaluation of the response at a single point. Use FREQRESP
to compute the frequency response over a grid of frequencies.

See also FREQRESP, BODE, SIGMA.

help freqresp

FREQRESP Frequency response of LTI systems.

H = FREQRESP(SYS,W) computes the frequency response H of the


system SYS at the frequencies specified by the vector W.
These frequencies should be real and in radians/second.

If SYS has NY outputs and NU inputs, and LW = length(W), the


output H is a NY-by-NU-by-LW array such that H(:,:,k) gives
the response at the frequency W(k).

See also EVALFR, BODE, SIGMA, NYQUIST, NICHOLS.

Overloaded methods
help zpk/freqresp.m
help tf/freqresp.m
help ss/freqresp.m

help margin

MARGIN Gain margin, phase margin, and crossover frequencies.

[Gm,Pm,Wcg,Wcp] = MARGIN(SYS) returns the gain margin Gm, the


phase margin Pm, and associated frequencies Wcg and Wcp, given
the SISO open-loop model SYS (continuous or discrete). The
gain margin Gm is defined as 1/G where G is the gain at the
-180 phase frequency. The gain margin in dB is 20*log10(Gm).

[Gm,Pm,Wcg,Wcp] = MARGIN(MAG,PHASE,W) derives the gain and phase


margins from the Bode magnitude, phase, and frequency vectors
MAG, PHASE, and W produced by BODE. Interpolation is performed
between the frequency points to estimate the values.

When invoked without left hand arguments, MARGIN(SYS) plots


the open-loop Bode plot with the gain and phase margins marked
with a vertical line.

See also BODE, LTIVIEW.


Overloaded methods
help lti/margin.m

help append

APPEND Group LTI systems by appending inputs and outputs.

SysOut = APPEND(Sys1,Sys2, ...) produces the aggregate system

[ Sys1 0 ]
SysOut = [ 0 Sys2 ]
[ . }
[ .]

This operation amounts to concatenation of the input and output


vectors of the systems Sys1, Sys2, ...

See also SERIES, PARALLEL, FEEDBACK.

Overloaded methods
help zpk/append.m
help tf/append.m
help ss/append.m

help parallel

PARALLEL Parallel interconnection of two LTI systems.

+------+
v1 ---------->| |----------> z1
| SYS1 |
u1 +-->| |---+ y1
| +------+ |
u ------>+ O------> y
| +------+ |
u2 +-->| |---+ y2
| SYS2 |
v2 ---------->| |----------> z2
+------+

SYS = PARALLEL(SYS1,SYS2,IN1,IN2,OUT1,OUT2) connects the two


LTI systems SYS1 and SYS2 in parallel such that the inputs
specified by IN1 and IN2 are connected and the outputs specified
by OUT1 and OUT2 are summed. The resulting system SYS maps
[v1;u;v2] to [z1;y;z2]. The vectors IN1 and IN2 contain indexes
into the input vectors of SYS1 and SYS2, respectively, and define
the input channels u1 and u2 in the diagram. Similarly, the
vectors OUT1 and OUT2 contain indexes into the outputs of these
two systems.
If IN1,IN2,OUT1,OUT2 are jointly omitted, PARALLEL forms the
standard parallel interconnection of SYS1 and SYS2 and returns
SYS = SYS2 + SYS1 .

See also APPEND, SERIES, FEEDBACK.

Overloaded methods
help lti/parallel.m

help series

SERIES Series interconnection of the two LTI models.

+------+
v2 --->| |
+------+ | SYS2 |-----> y2
| |------->| |
u1 ----->| |y1 u2 +------+
| SYS1 |
| |---> z1
+------+

SYS = SERIES(SYS1,SYS2,OUTPUTS1,INPUTS2) connects the two systems


in series such that the outputs of SYS1 specified by OUTPUTS1 are
connected to the inputs of SYS2 specified by INPUTS2. The vectors
OUTPUTS1 and INPUTS2 contain indexes into the outputs and inputs
of SYS1 and SYS2, respectively. The resulting LTI model SYS maps
u1 to y2.

If OUTPUTS1 and INPUTS2 are omitted, SERIES connects SYS1 and SYS2
in cascade and returns
SYS = SYS2 * SYS1 .

See also APPEND, PARALLEL, FEEDBACK.

Overloaded methods
help lti/series.m

help feedback

FEEDBACK Feedback connection of two systems.

SYS = FEEDBACK(SYS1,SYS2) produces the feedback loop

u --->O---->[ SYS1 ]----+---> y


| |
+-----[ SYS2 ]<---+

Negative feedback is assumed and the resulting system SYS


maps u to y. To apply positive feedback, use the syntax
SYS = FEEDBACK(SYS1,SYS2,+1).

SYS = FEEDBACK(SYS1,SYS2,FEEDIN,FEEDOUT,SIGN) builds the more


general feedback system
+--------+
v --------->| |--------> z
| SYS1 |
u --->O---->| |----+---> y
| +--------+ |
| |
+-----[ SYS2 ]<---+

The vector FEEDIN contains indices into the input vector of SYS1
and specifies which inputs u are involved in the feedback loop.
Similarly, FEEDOUT specifies which outputs y of SYS1 are used for
feedback. If SIGN=1 then positive feedback is used. If SIGN=-1
or SIGN is omitted, then negative feedback is used. In all cases,
the resulting system SYS has the same inputs and outputs as SYS1
(with their order preserved).

See also STAR, PARALLEL, SERIES, and CONNECT.

Overloaded methods
help zpk/feedback.m
help tf/feedback.m
help ss/feedback.m

help star

--- help for zpk/star.m ---

STAR Redheffer star product of LTI systems.

SYS = STAR(SYS1,SYS2,NU,NY) evaluates the star product SYS of


the two systems SYS1 and SYS2. The star product or generalized
Linear Fractional Transformation corresponds to the following
feedback interconnection of SYS1 and SYS2:

+-------+
w1 -------->| |-------> z1
| SYS1 |
+---->| |-----+
| +-------+ |
u| |y
| +-------+ |
+-----| |<----+
| SYS2 |
z2 <---------| |-------- w2
+-------+
The feedback loop connects the first NU outputs of SYS2 to the
last NU inputs of SYS1 (signals u), and the last NY outputs of
SYS1 to the first NY inputs of SYS2 (signals y). The resulting
system SYS maps the input vector [w1;w2] to the output vector
[z1;z2].

SYS = STAR(SYS1,SYS2) returns


* the lower Linear Fractional Transformation of SYS1 and SYS2
if SYS2 has less inputs and outputs than SYS1. This amounts
to deleting w2 and z2 in the above diagram.
* the upper Linear Fractional Transformation of SYS1 and SYS2
if SYS1 has less inputs and outputs than SYS2. This amounts
to deleting w1 and z1 in the above diagram.

See also FEEDBACK, CONNECT.

There is more than one star available. See also


help tf/star.m
help ss/star.m

help connect

CONNECT Derive state-space model for block diagram interconnection

SYSc = CONNECT(SYS,Q,INPUTS,OUTPUTS) returns a state-space


model SYSc for the block diagram specified by the block-diagonal,
unconnected LTI model SYS and the interconnection matrix Q.
The matrix Q has a row for each input, where the first element
of each row is the number of the input. The subsequent elements
of each row specify where the block gets its summing inputs,
with negative elements used to indicate minus inputs to the
summing junction. For example, if block 7 gets its inputs from
the outputs of blocks 2, 15, and 6, and the block 15 input is
negative, the 7th row of Q would be [7 2 -15 6]. The index
vectors INPUTS and OUTPUTS are used to select the final inputs
and outputs of SYSc.

For more information see the User's Guide.

See also APPEND.

Overloaded methods
help lti/connect.m

help rlocus

RLOCUS Evans root locus.

For a SISO system SYS with numerator N(s) and denominator D(s),
RLOCUS(SYS) calculates and plots the locus of the roots of
H(s) = D(s) + k * N(s) = 0

for a set of positive gains K which are adaptively calculated to


produce a smooth plot.

RLOCUS(SYS,K) uses a user-specified vector K of gains.

[R,K] = RLOCUS(SYS) or R = RLOCUS(SYS,K) returns the matrix R


of complex root locations for the gains K. R has LENGTH(K) columns
and its j-th column lists the closed-loop roots for the gain K(j).

See also RLOCFIND, PZMAP, EIG.

Overloaded methods
help lti/rlocus.m

help rlocfind

RLOCFIND Find root locus gains for a given set of roots.

[K,POLES] = RLOCFIND(SYS) is used for interactive gain


selection from the root locus plot of the SISO system SYS
generated by RLOCUS. RLOCFIND puts up a crosshair cursor
in the graphics window which is used to select a pole location
on an existing root locus. The root locus gain associated
with this point is returned in K and all the system poles for
this gain are returned in POLES.

[K,POLES] = RLOCFIND(SYS,P) takes a vector P of desired root


locations and computes a root locus gain for each of these
locations (i.e., a gain for which one of the closed-loop roots
is near the desired location). The j-th entry of the vector K
gives the computed gain for the location P(j), and the j-th
column of the matrix POLES lists the resulting closed-loop poles.

See also RLOCUS.

Overloaded methods
help lti/rlocfind.m

help acker

ACKER Pole placement gain selection using Ackermann's formula.

K = ACKER(A,B,P) calculates the feedback gain matrix K such that


the single input system
.
x = Ax + Bu
with a feedback law of u = -Kx has closed loop poles at the
values specified in vector P, i.e., P = eig(A-B*K).

Note: This algorithm uses Ackermann's formula. This method


is NOT numerically reliable and starts to break down rapidly
for problems of order greater than 10, or for weakly controllable
systems. A warning message is printed if the nonzero closed-loop
poles are greater than 10% from the desired locations specified
in P.

See also PLACE.

help place

PLACE Pole placement technique

K = PLACE(A,B,P) computes a state-feedback matrix K such that


the eigenvalues of A-B*K are those specified in vector P.
No eigenvalue should have a multiplicity greater than the
number of inputs.

[K,PREC,MESSAGE] = PLACE(A,B,P) returns PREC, an estimate of how


closely the eigenvalues of A-B*K match the specified locations P
(PREC measures the number of accurate decimal digits in the actual
closed-loop poles). If some nonzero closed-loop pole is more than
10% off from the desired location, MESSAGE contains a warning
message.

See also ACKER.

help estim

ESTIM Form estimator given estimator gain.

EST = ESTIM(SYS,L) produces an estimator EST with gain L for


the outputs and states of the state-space model SYS, assuming
all inputs of SYS are stochastic and all outputs are measured.
For a continuous system
.
SYS: x = Ax + Bw , y = Cx + Dw (with w stochastic),

the resulting estimator


.
x_e = [A-LC] x_e + Ly

|y_e| = |C| x_e


|x_e| |I|

generates estimates x_e and y_e of x and y. ESTIM behaves


similarly when applied to discrete-time systems.
EST = ESTIM(SYS,L,SENSORS,KNOWN) handles more general plants
SYS with both deterministic and stochastic inputs, and both
measured and non-measured outputs. The index vectors SENSORS
and KNOWN specify which outputs y are measured and which inputs
u are known, respectively. The resulting estimator EST uses
[u;y] as input to produce the estimates [y_e;x_e].

You can use pole placement techniques (see PLACE) to design


the estimator (observer) gain L, or use the Kalman filter gain
returned by KALMAN or KALMD.

See also REG, PLACE, KALMAN, KALMD, LQGREG.

Overloaded methods
help lti/estim.m

help reg

REG Form regulator given state-feedback and estimator gains.

RSYS = REG(SYS,K,L) produces an observer-based regulator RSYS


for the state-space system SYS, assuming all inputs of SYS are
controls and all outputs are measured. The matrices K and L
specify the state-feedback and observer gains. For
.
SYS: x = Ax + Bu , y = Cx + Du

the resulting regulator is


.
x_e = [A-BK-LC+LDK] x_e + Ly
u = -K x_e

This regulator should be connected to the plant using positive


feedback. REG behaves similarly when applied to discrete-time
systems.

RSYS = REG(SYS,K,L,SENSORS,KNOWN,CONTROLS) handles more


general regulation problems where
* the plant inputs consist of controls u, known inputs Ud,
and stochastic inputs w,
* only a subset y of the plant outputs are measured.
The I/O subsets y, Ud, and u are specified by the index vectors
SENSORS, KNOWN, and CONTROLS. The resulting regulator RSYS
uses [Ud;y] as input to generate the commands u.

You can use pole placement techniques (see PLACE) to design the
gains K and L, or alternatively use the LQ and Kalman gains
produced by LQR/DLQR and KALMAN.
See also ESTIM, PLACE, LQR, DLQR, LQGREG, KALMAN.

Overloaded methods
help lti/reg.m

help lqr

LQR Linear-quadratic regulator design for continuous-time systems.

[K,S,E] = LQR(A,B,Q,R,N) calculates the optimal gain matrix K


such that the state-feedback law u = -Kx minimizes the cost
function

J = Integral {x'Qx + u'Ru + 2*x'Nu} dt


.
subject to the state dynamics x = Ax + Bu.

The matrix N is set to zero when omitted. Also returned are the
Riccati equation solution S and the closed-loop eigenvalues E:
-1
SA + A'S - (SB+N)R (B'S+N') + Q = 0 , E = EIG(A-B*K) .

See also LQRY, DLQR, LQGREG, CARE, and REG.

help dlqr

DLQR Linear-quadratic regulator design for discrete-time systems.

[K,S,E] = DLQR(A,B,Q,R,N) calculates the optimal gain matrix K


such that the state-feedback law u[n] = -Kx[n] minimizes the
cost function

J = Sum {x'Qx + u'Ru + 2*x'Nu}

subject to the state dynamics x[n+1] = Ax[n] + Bu[n].

The matrix N is set to zero when omitted. Also returned are the
Riccati equation solution S and the closed-loop eigenvalues E:
-1
A'SA - S - (A'SB+N)(R+B'SB) (B'SA+N') + Q = 0, E = EIG(A-B*K).

See also DLQRY, LQRD, LQGREG, and DARE.

help lqry

LQRY Linear-quadratic regulator design with output weighting.

[K,S,E] = LQRY(SYS,Q,R,N) calculates the optimal gain matrix K


such that:

* if SYS is a continuous-time system, the state-feedback law


u = -Kx minimizes the cost function

J = Integral {y'Qy + u'Ru + 2*y'Nu} dt


.
subject to the system dynamics x = Ax + Bu, y = Cx + Du

* if SYS is a discrete-time system, u[n] = -Kx[n] minimizes

J = Sum {y'Qy + u'Ru + 2*y'Nu}

subject to x[n+1] = Ax[n] + Bu[n], y[n] = Cx[n] + Du[n].

The matrix N is set to zero when omitted. Also returned are the
the solution S of the associated algebraic Riccati equation and
the closed-loop eigenvalues E = EIG(A-B*K).

See also LQR, LQGREG, CARE, DARE.

Overloaded methods
help lti/lqry.m

help lqrd

LQRD Discrete linear-quadratic regulator design from continuous


cost function.

[K,S,E] = LQRD(A,B,Q,R,Ts) calculates the optimal gain matrix K


such that the discrete state-feedback law u[n] = -K x[n]
minimizes a discrete cost function equivalent to the continuous
cost function

J = Integral {x'Qx + u'Ru} dt

subject to the discretized state dynamics x[n+1] = Ad x[n] + Bd u[n]


where [Ad,Bd] = C2D(A,B,Ts). Also returned are the discrete Riccati
equation solution S and the closed-loop eigenvalues E = EIG(Ad-Bd*K).

[K,S,E] = LQRD(A,B,Q,R,N,Ts) handles the more general cost function


J = Integral {x'Qx + u'Ru + 2*x'Nu} dt .

Algorithm: the continuous plant (A,B,C,D) and continuous weighting


matrices (Q,R,N) are discretized using the sample time Ts and
zero-order hold approximation. The gain matrix K is then calculated
using DLQR.

See also DLQR, LQR, C2D, and KALMD.


help kalman

--- help for lti/kalman.m ---

KALMAN Continuous or discrete Kalman estimator

[KEST,L,P] = KALMAN(SYS,Qn,Rn,Nn) designs a Kalman estimator


KEST for the continuous or discrete LTI plant SYS. For a
continuous plant
.
x = Ax + Bu + Gw {State equation}
y = Cx + Du + Hw + v {Measurements}

with known inputs u, process noise w, measurement noise v, and


noise covariances

E{ww'} = Qn, E{vv'} = Rn, E{wv'} = Nn,

the estimator KEST has input [u;y] and generates optimal


estimates y_e,x_e of y,x by:
.
x_e = Ax_e + Bu + L(y - Cx_e - Du)

|y_e| = | C | x_e + | D | u
|x_e| | I | |0|

Type HELP DKALMAN for details on the discrete-time counterpart.

The LTI system SYS contains the plant data (A,[B G],C,[D H]),
and Nn is set to zero when omitted. The Kalman estimator KEST
is continuous when SYS is continuous, discrete otherwise.
Also returned are the estimator gain L and the steady-state
error covariance P. In continuous time with H=0, P solves the
Riccati equation
-1
AP + PA' - (PC'+G*N)R (CP+N'*G') + G*Q*G' = 0 .

[KEST,L,P] = KALMAN(SYS,Qn,Rn,Nn,SENSORS,KNOWN) handles more


general plants SYS where the known and stochastic inputs u,w
are mixed together, and not all outputs are measured. The
index vectors SENSORS and KNOWN then specify which outputs y
of SYS are measured and which inputs u are known. All other
inputs are assumed stochastic.

See also KALMD, ESTIM, LQGREG, CARE, DARE.

help kalmd

--- help for lti/kalmd.m ---


KALMD Discrete Kalman estimator for continuous plant

[KEST,L,P,M,Z] = KALMD(SYS,Qn,Rn,Ts) produces a discrete


Kalman estimator KEST for the continuous plant
.
x = Ax + Bu + Gw {State equation}
y = Cx + Du + v {Measurements}

with process and measurement noise

E{w} = E{v} = 0, E{ww'} = Qn, E{vv'} = Rn, E{wv'} = 0.

The LTI system SYS specifies the plant data (A,[B G],C,[D 0]).
The continuous plant and covariance matrices (Q,R) are first
discretized using the sample time Ts and zero-order hold
approximation, and the discrete Kalman estimator for the
resulting discrete plant is then calculated with KALMAN.

Also returned are the estimator and innovation gains L and M,


and the steady-state error covariances P and Z (type
HELP DKALMAN for details).

See also LQRD, KALMAN, LQGREG.

help lqgreg

--- help for lti/lqgreg.m ---

LQGREG Form linear-quadratic-Gaussian (LQG) regulator

RLQG = LQGREG(KEST,K) produces an LQG regulator by


connecting the Kalman estimator KEST designed with KALMAN
and the state-feedback gain K designed with (D)LQR or LQRY:

+---------------------------+
u| |
+--->| | x_e |
| KEST |------>| -K |--+-----> u
y -------->| |

The resulting regulator RLQG has input y and generates the


commands u = -K x_e where x_e is the Kalman state estimate
based on the measurements y. This regulator should be
connected to the plant using positive feedback.

For discrete systems, x_e is the state estimate x[n|n-1]


based on past measurements up to y[n-1]. Alternatively,
RLQG = LQGREG(KEST,K,'current')
forms the "current" regulator u = -K x[n|n].
RLQG = LQGREG(KEST,K,CONTROLS) handles estimators that have
access to additional known plant inputs Ud. The index vector
CONTROLS then specifies which estimator inputs are the
controls u, and the LQG regulator has input [Ud;y]:

+---------------------------+
u| |
+--->| | x_e |
Ud -------->| KEST |------>| -K |--+-----> u
y -------->| |

See also (D)LQR, LQRY, KALMAN, LQRD, KALMD, ESTIM, REG.

help lyap

LYAP Solve continuous-time Lyapunov equations.

X = LYAP(A,C) solves the special form of the Lyapunov matrix


equation:

A*X + X*A' = -C

X = LYAP(A,B,C) solves the general form of the Lyapunov matrix


equation (also called Sylvester equation):

A*X + X*B = -C

See also DLYAP.

help dlyap

DLYAP Discrete Lyapunov equation solver.

X = DLYAP(A,Q) solves the discrete Lyapunov equation:

A*X*A' - X + Q = 0

See also LYAP.

help care

CARE Solve continuous-time algebraic Riccati equations.

[X,L,G,RR] = CARE(A,B,Q,R,S,E) computes the unique symmetric


stabilizing solution X of the continuous-time algebraic Riccati
equation
-1
A'XE + E'XA - (E'XB + S)R (B'XE + S') + Q = 0
or, equivalently,
-1 -1 -1
F'XE + E'XF - E'XBR B'XE + Q - SR S' = 0 with F:=A-BR S'.

When omitted, R,S and E are set to the default values R=I, S=0,
and E=I. Additional optional outputs include the gain matrix
-1
G = R (B'XE + S') ,

the vector L of closed-loop eigenvalues (i.e., EIG(A-B*G,E)),


and the Frobenius norm RR of the relative residual matrix.

[X,L,G,REPORT] = CARE(A,B,Q,...,'report') turns off error


messages and returns a success/failure diagnosis REPORT instead.
The value of REPORT is
* -1 if Hamiltonian matrix has eigenvalues too close to jw axis
* -2 if X=X2/X1 with X1 singular
* the relative residual RR when CARE succeeds.

[X1,X2,L,REPORT] = CARE(A,B,Q,...,'implicit') also turns off


error messages, but now returns matrices X1,X2 such that X=X2/X1
and [X1;X2] has orthonormal columns. REPORT=0 indicates success.

See also DARE.

help dare

DARE Solve discrete-time algebraic Riccati equations.

[X,L,G,RR] = DARE(A,B,Q,R,S,E) computes the unique symmetric


stabilizing solution X of the discrete-time algebraic Riccati
equation
-1
E'XE = A'XA - (A'XB + S)(B'XB + R) (A'XB + S)' + Q

or, equivalently (if R is nonsingular)


-1 -1 -1
E'XE = F'XF - F'XB(B'XB + R) B'XF + Q - SR S' with F:=A-BR S'.

When omitted, R,S and E are set to the default values R=I, S=0,
and E=I. Additional optional outputs include the gain matrix
-1
G = (B'XB + R) (B'XA + S'),

the vector L of closed-loop eigenvalues (i.e., EIG(A-B*G,E)),


and the Frobenius norm RR of the relative residual matrix.

[X,L,G,REPORT] = DARE(A,B,Q,...,'report') turns off error


messages and returns a success/failure diagnosis REPORT instead.
The value of REPORT is
* -1 if symplectic pencil has eigenvalues too close to unit circle,
* -2 if X=X2/X1 with X1 singular
* the relative residual RR when DARE succeeds.

[X1,X2,L,REPORT] = DARE(A,B,Q,...,'implicit') also turns off


error messages, but now returns matrices X1,X2 such that X=X2/X1
and [X1;X2] has orthonormal columns. REPORT=0 indicates success.

See also CARE.

Potrebbero piacerti anche