Library - lti

Library "lti" defines methods related to objects which represent linear time-invariant dynamical systems. LTI systems may be used to model many different systems: electro-mechanical devices, robots, chemical processes, filters, etc. LTI systems map one or more inputs u to one or more outputs y. The mapping is defined as a state-space model or as a matrix of transfer functions, either in continuous time or in discrete time. Methods are provided to create, combine, and analyze LTI objects.

The following statement makes available functions defined in lti:

use lti

ss::ss

LTI state-space constructor.

Syntax

a = ss
a = ss(A, B, C, D)
a = ss(A, B, C, D, Ts)
a = ss(A, B, C, D, Ts, var)
a = ss(A, B, C, D, b)
a = ss(b)

Description

ss(A,B,C,D) creates an LTI object which represents the continuous-time state-space model

x'(t) = A x(t) + B u(t)
y(t)  = C x(t) + D u(t)

ss(A,B,C,D,Ts) creates an LTI object which represents the discrete-time state-space model with sample time Ts

x(k+1) = A x(k) + B u(k)
y(k)   = C x(k) + D u(k)

In both cases, if D is 0, it is resized to match the size of B and C if necessary. An additional argument var may be used to specify the variable of the Laplace ('s' (default) or 'p') or z transform ('z' (default) or 'q').

ss(A,B,C,D,b), where b is an LTI object, creates a state-space model of the same kind (continuous/discrete time, sampling time and variable) as b.

ss(b) converts the LTI object b to a state-space model.

Examples

sc = ss(-1, [1,2], [2;5], 0)
  sc =
    continuous-time LTI state-space system
    A =
        -1
    B =
         1     2
    C =
         2
         5
    D =
         0     0
         0     0
sd = ss(tf(1,[1,2,3,4],0.1))
  sd =
    discrete-time LTI state-space system, Ts=0.1
    A =
      -2    -3    -4
       1     0     0
       0     1     0
    B =
       1
       0
       0
    C =
       0     0     1
    D =
       0

See also

tf

tf::tf

LTI transfer function constructor.

Syntax

a = tf
a = tf(num, den)
a = tf(numlist, denlist)
a = tf(..., Ts)
a = tf(..., Ts, var)
a = tf(..., b)
a = tf(b)

Description

tf(num,den) creates an LTI object which represents the continuous-time transfer function specified by descending-power coefficient vectors num and den. tf(num,den,Ts) creates an LTI object which represents a discrete-time transfer function with sample time Ts.

In both cases, num and den may be replaced with lists of lists of coefficients; sublists represent the rows of the matrix of transfer functions. The number of sublists is the number of system outputs, and the number of vectors of coefficients in each sublist is the number of system inputs.

An additional argument var may be used to specify the variable of the Laplace ('s' (default) or 'p') or z transform ('z' (default) or 'q').

tf(...,b), where b is an LTI object, creates a transfer function of the same kind (continuous/discrete time, sampling time and variable) as b.

tf(b) converts the LTI object b to a transfer function.

Examples

sc = tf(1,[1,2,3,4],'p')
  sc =
    continuous-time transfer function
    1/(p^3+2p^2+3p+4)

See also

ss

lti::append

Append the inputs and outputs of systems.

Syntax

b = append(a1, a2, ...)

Description

append(a1,a2) builds a system with inputs [u1;u2] and outputs [y1;y2], where u1 and u2 are ths inputs of a1 and y1 and y2 their outputs, respectively. append accepts any number of input arguments.

See also

connect

ss::augstate

Extend the output of a system with its states.

Syntax

b = augstate(a)

Description

augstate(a) extends the ss object a by adding its states to its outputs. The new output yext is [y;x], where y is the output of a and x is its states.

lti::c2d

Conversion from continuous time to discrete time.

Syntax

b = c2d(a, Ts)
b = c2d(a, Ts, method)

Description

c2d(a,Ts) converts the continuous-time system a to a discrete-time system with sample time Ts.

c2d(a,Ts,method) uses the specified conversion method. method is one of the methods supported by c2dm.

See also

d2c, c2dm

lti::connect

Arbitrary feedback connections.

Syntax

b = connect(a, links, in, out)

Description

connect(a,links,in,out) modifies lti object a by connecting some of the outputs to some of the inputs and by keeping some of the inputs and some of the outputs. Connections are specified by the rows of matrix link. In each row, the first element is the index of the system input where the connection ends; other elements are indices to system outputs which are summed. The sign of the indices to outputs gives the sign of the unit weight in the sum. Zeros are ignored. Arguments in and out specify which input and output to keep.

See also

feedback

lti::d2c

Conversion from discrete time to continuous time.

Syntax

b = d2c(a)
b = d2c(a, method)

Description

d2c(a) converts the discrete-time system a to a continuous-time system.

d2c(a,method) uses the specified conversion method. method is one of the methods supported by d2cm.

See also

c2d, d2cm

lti::evalfr

Frequency value.

Syntax

y = evalfr(a, x)

Description

evalfr(a,x) evaluates system a at complex value or values x.

See also

polyval

ss::ctrb

Controlability matrix.

Syntax

C = crtb(a)

Description

ctrb(a) gives the controlability matrix of system a, which is full-rank if and only if a is controlable.

See also

obsv

lti::feedback

Feedback connection.

Syntax

c = feedback(a, b)
c = feedback(a, b, sign)
c = feedback(a, b, ina, outa)
c = feedback(a, b, ina, outa, sign)

Description

feedback(a,b) connects all the outputs of lti object a to all its inputs via the negative feedback lti object b.

feedback(a,b,sign) applies positive feedback with weight sign; the default value of sign is -1.

feedback(a,b,ina,outa) specifies which inputs and outputs of a to use for feedback. The inputs and outputs of the result always correspond to the ones of a.

See also

connect

lti::isempty

Test for an LTI without input/output.

Syntax

b = isempty(a)

Description

isempty(a) is true if system a has no input and/or no output, and false otherwise.

See also

size, issiso

lti::issiso

Test for a single-input single-output LTI.

Syntax

b = issiso(a)

Description

issiso(a) is true if lti object a has one input and one output (single-input single-output system, or SISO), or false otherwise.

size, isempty

lti::isproper

Test for a proper (causal) LTI.

Syntax

b = isproper(a)

Description

isproper(a) is true if lti object a is causal, or false otherwise. An ss object is always causal. A tf object is causal if all the transfer functions are proper, i.e. if the degrees of the denominators are at least as large as the degrees of the numerators.

lti::minreal

Minimum realization.

Syntax

b = minreal(a)
b = minreal(a, tol)

Description

minreal(a) modifies lti object a in order to remove states which are not controllable and/or not observable. For tf objects, identical zeros and poles are canceled out.

minreal(a,tol) uses tolerance tol to decide whether to discard a state or a pair of pole/zero.

ss::obsv

Observability matrix.

Syntax

O = obsv(a)

Description

obsv(a) gives the observability matrix of system a, which is full-rank if and only if a is observable.

See also

ctrb

lti::parallel

Parallel connection.

Syntax

c = parallel(a, b)
c = parallel(a, b, ina, inb, outa, outb)

Description

parallel(a,b) connects lti objects a and b in such a way that the inputs of the result is applied to both a and b, and the outputs of the result is their sum.

parallel(a,b,ina,inb,outa,outb) specifies which inputs are shared between a and b, and which outputs are summed. The inputs of the result are partitioned as [ua,uab,ub] and the outputs as [ya,yab,yb]. Inputs uab are fed to inputs ina of a and inb of b; inputs ua are fed to the remaining inputs of a, and ub to the remaining inputs of b. Similarly, outputs yab are the sum of outputs outa of a and outputs outb of b, and ya and yb are the remaining outputs of a and b, respectively.

See also

series

lti::series

Series connection.

Syntax

c = series(a, b)
c = series(a, b, outa, inb)

Description

series(a,b) connects the outputs of lti object a to the inputs of lti object b.

series(a,b,outa,inb) connects outputs outa of a to inputs inb of b. Unconnected outputs of a and inputs of b are discarded.

See also

parallel

lti::repmat

Replicate a system.

Syntax

b = repmat(a, n)
b = repmat(a, [m,n])
b = repmat(a, m, n)

Description

repmat(a,n), when a is a transfer function or a matrix of transfer functions, creates a new system described by a matrix of transfer functions where a is repeated n times horizontally and vertically. If a is a state-space system, conversions to and from a matrix of transfer functions are performed.

repmat(a,[m,n]) or repmat(a,m,n) repeats matrix a m times vertically and n times horizontally.

See also

append

lti::size

Number of outputs and inputs.

Syntax

s = size(a)
(nout, nin) = size(a)
n = size(a, dim)

Description

With one output argument, size(a) gives the row vector [nout,nin], where nout is the number of outputs of system a and nin its number of inputs. With two output arguments, size(a) returns these results separately as scalars.

size(a,1) gives only the number of outputs, and size(a,2) only the number of inputs.

See also

isempty, issiso

zpk

LTI transfer function constructor using zeros and poles.

Syntax

a = zpk(z, p, k)
a = zpk(zeroslist, poleslist, gainlist)
a = zpk(..., Ts)
a = zpk(..., Ts, var)
a = zpk(..., b)
a = zpk(b)

Description

zpk creates transfer-function LTI systems like tf. Instead of using transfer function coefficients as input, it accepts a vector of zeros, a vector of poles, and a gain for a simple-input simple-output (SISO) system; or lists of sublists of zeros, poles and gains for multiple-input multiple-output (MIMO) systems.

Examples

sd = zpk(0.3, [0.8+0.5j; 0.8-0.5j], 10, 0.1)
  sd =
    discrete-time transfer function, Ts=0.1
    (10z-3)/(z^2-1.6z+0.89)

See also

tf::tf


Copyright 2001, Calerga.

All rights reserved.