35

Delta

Embed Size (px)

Citation preview

Page 1: Delta

Delta Index

balanced models ��

Bode plots ��

c�del �

canonical forms ����

controllability �

conversions ��

delay �

delbalre ��

design �

discrete�time ��

estimator ��

frequency response �

gramian ��

H�in�nity ��

impulse response ��

Kalman �lter ��

LQG ��

Lyapunov equation ��

models �

Nichols plots �

Nyquist plots �

observability �

optimal control �����

regulator ��

Riccati equation �����

simulation �����

step response ��

time response �����

��

Page 2: Delta

z�del z�del

Purpose�

Conversion of discrete time shift models to discrete time delta models�

Synopsis�

�da�db�dc�dd��z�del�za�zb�zc�zd�delta�

�dnum�dden��z�del�znum�zden�delta�

Description�

z�del converts from discrete time z domain models to discrete time delta domain models��DA�DB�DC�DD��z�del�ZA�ZB�ZC�ZD�delta� converts the discrete shift system�

qx � ZAx� ZBu

y � ZCx� ZDu

to the discrete delta system�

�x � DAx �DBu

y � DCx�DDu

using delta as the sampling period��DNUM�DDEN��z�del�ZNUM�ZDEN�delta� converts the discrete system descibed by�

G�z� �ZNUM �z�

ZDEN �z�

to the discrete time system�

G��� �DNUM ���

DDEN ���

Algorithm�

z�del is implemented in an Mle�

See also�

del�z�c�del�del�c�c�d�d�c

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section �����

��

Page 3: Delta

tfadd�tfmult tfadd�tfmult

Purpose�

Addition and multiplication of transfer functions�

Synopsis�

�num�den��tfadd�num��den��num��den��

�num�den��tfmult�num��den��num��den��

Description�

�NUM�DEN��tfadd�NUM��NUM��DEN��DEN�� adds together two transfer functions to give a third�

NUM

DEN�

NUM�

DEN��NUM�

DEN�

�NUM�DEN��tfmult�NUM��NUM��DEN��DEN��multiplies together two transfer functions to give a third�

NUM

DEN�

NUM�

DEN��NUM�

DEN�

Algorithm�

tfadd and tfmult are Mles� They both convert the transfer functions into state space form andthen add or multiply� then convert back�

��

Page 4: Delta

s�del s�del

Purpose�

Maps matrices and vectors from the continuous s plane to the discrete delta plane�

Synopsis�

y�s�del�s�delta�

Description�

s�del maps points from the continuous s plane to the discrete delta plane�Y�s�del�S�delta�

Given S� a matrix� returns�

Y �eS� � I

where delta is the sampling period and e is the matrix exponential�Given S� a vector� returns�

Y �i� �eS�i�� � �

where delta is the sampling period�

Algorithm�

s�del is an Mle� If S is a matrix the matrix exponential is calculated using a Pad�e approximation�otherwise the vector is calculated point by point�

See also�

c�del

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section �����

��

Page 5: Delta

lctrb�lobsv lctrb�lobsv

Purpose�

Linearly independent controllability and observability matrices�

Synopsis�

co�lctrb�a�b�

ob�lobsv�a�c�

Description�

CO�lctrb�A�B� returns the controllability matrix of the system�

�x � Ax� Bu

such that the columns are linearly independent�OB�lobsv�A�C� returns the observability matrix of the system�

�x � Ax�Bu

y � Cx�Du

such that the rows are linearly independent�

Algorithm�

lctrb and lobsv are Mles� They use ctrb and obsv to nd the controllability and observabilitymatrices and then use rref to remove the linearly dependent columns or rows�

See also�

ctrb�obsv

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Sections ��� and ���

��

Page 6: Delta

delsim delsim

Purpose�

Simulation of discrete time systems in delta domain�

Synopsis�

�y�x��delsim�a�b�c�d�u�delta�x�

�y�x��delsim�num�den�u�delta�x�

Description�

delsim calculates the response of discrete time linear systems in delta domain to arbitrary inputs��Y�X��delsim�A�B�C�D�U�delta�X� Given the LTI system�

�x � Ax�Bu

y � Cx�Du

and the input matrix U� with as many rows as there are inputs and each column corresponding to anew time point� spaced by delta� the sampling period� With X specifying the initial conditions ofthe states� Y is returned with as many rows as there are outputs and with length�U� columns� Uponexit X contains the state history and has as many rows as there are states and length�U� columns� IfX is unspecied it is assumed to be zero��Y�X��delsim�NUM�DEN�U�delta�X� returns the response of the system given by�

G��� �NUM ���

DEN ���

Example

Simulate the response of the system�

H�s� ��s� � �s� �

s� � �s � �

to a sine wave� for �� seconds� in discrete time with a sample period of ����

num��������

den���������

�num�den��c�del�num�den� ���

t��� �����

u�sin�t��

�y�x��delsim�num�den�u� ���

plot�t�y��

Algorithm�

delsim is an Mle� The response of the states of the system to the input are propagated takingadvantage of the numerical advantages of the delta transform� then the output is found directly�This routine is not a kernel routine of matlab and hence is slower than the equivalent routine for ztransforms�

See also�

delimp�delstep��

Page 7: Delta

See also�

delfreq�logspace�unwrap

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section ���

��

Page 8: Delta

delnyq delnyq

Purpose�

Nyquist frequency response plots of discrete time delta systems�

Synopsis�

�re�im�w��delnyq�a�b�c�d�iu�delta�

�re�im�w��delnyq�num�den�delta�

Description�

delnyq calculates the frequency response of a discrete time LTI system in delta domain then� automatically selecting the appropriate frequency range� plots the nyquist diagram��RE�IM�W��delnyq�A�B�C�D�iu�delta� calculates the frequency response of the system�

�x � Ax�Bu

y � Cx�Du

from the iu�th input using delta as the sampling period� delnyq returns the matrices RE and IM

with as many rows as there are outputs and length�W� columns� Upon exit W contains the frequencypoints used in the bode plot�

G��� � C��I � A���B �D

re��� � real�G�ej�� � �

���

im��� � imag�G�ej�� � �

���

�RE�IM�W��delnyq�NUM�DEN�delta� calculates the frequency response from the transfer functiondescription�

G��� �NUM ���

DEN ���

and plots it as a nyquist diagram�

Example

Plot the Nyquist diagram step of a second order system with a natural frequency �n � �� a dampingfactor of � � ���� and a sample time of ��� using the delta operator�

�a�b�c�d��ord���� ���

�a�b�c�d��c�del�a�b�c�d� ���

�re�im�w��delnyq�a�b�c�d��� ���

Algorithm�

delnyq is an Mle� The routine delfreq is used to calculate the frequency response of the systemover a preset frequency range and the resulted is plotted�The routine uses unwrap to ensure that the phase remains smooth and doesn�t jump from ��� degreesto ��� degrees�If it is desired to enter your own frequency range� use delfreq and then plot the results manually�

��

Page 9: Delta

delnic delnic

Purpose�

Nichols frequency response plots of discrete time delta systems�

Synopsis�

�mag�pha�w��delnic�a�b�c�d�iu�delta�

�mag�pha�w��delnic�num�den�delta�

Description�

delnic calculates the frequency response of a discrete time LTI system in delta domain then� automatically selecting the appropriate frequency range� plots the nichols diagram��MAG�PHA�W��delnic�A�B�C�D�iu�delta� calculates the frequency response of the system�

�x � Ax�Bu

y � Cx�Du

from the iu�th input using delta as the sampling period� delnic returns the matrices MAG and PHA

�in degrees� with as many rows as there are outputs and length�W� columns� Upon exit W containsthe frequency points used in the bode plot�

G��� � C��I � A���B �D

mag��� � abs�G�ej�� � �

���

pha��� � angle�G�ej�� � �

���

�MAG�PHA�W��delnic�NUM�DEN�delta� calculates the frequency response from the transfer functiondescription�

G��� �NUM ���

DEN ���

and plots it as a nichols diagram�

Algorithm�

delnic is an Mle� The routine delfreq is used to calculate the frequency response of the systemover a preset frequency range�The routine uses unwrap to ensure that the phase remains smooth and doesn�t jump from ��� degreesto ��� degrees�If it is desired to enter your own frequency range� use delfreq and then plot the results manually�

See also�

delfreq�logspace�unwrap

��

Page 10: Delta

Limitations�

A number of assumptions must be met for a unique positive denite solution to exist for the LQRproblem�

�� Matrix Q must be symmetric and positive semidenite�

�� Matrix R must be symmetric and positive denite�

�� �A�B� must be stabilisable�

�� �A�C� must be detectable�

�� �A�H� must be detectable�where H�H�Q and rank�H��rank�Q�

Note also that if the hamiltonian matrix has repeated eigenvalues it will not be possible to decomposethe matrix and hence the method will fail�

Algorithm�

dellqr and dellqe are Mles� They use eigenvector decomposition of the associated Hamiltonianmatrix to solve the Riccati equation�

See also�

lqr�lqe

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Chapter �� and ��

��

Page 11: Delta

dellqe�dellqr dellqe�dellqr

Purpose�

Discrete time delta domain linear quadratic estimator design�Discrete time delta domain linear quadratic regulator design�

Synopsis�

�h�p��dellqe�a�c�ohm�gamma�delta�nn�

�l�s��dellqr�a�b�q�r�delta�nn�

Description�

dellqr and dellqe solve the delta domain discrete time linear quadratic regulator �backslash� estimator problems and their associated Riccati equations��L�S��dellqr�A�B�Q�R�delta�N� calculates the optimal feedback gain matrix L such that the feedback law�

u � �Lx

minimises the cost function�

J � x�tf ��x�tf � �

Z tf

t�

�x�t��Qx�t� � u�t��Ru�t��dt

subject to the constraint�

�x � Ax� Bu

L is given by�

L � �R��B�SB���B�S�I �A��

where S is given by the Riccati equation�

� � Q� A�S � SA ��A�SA � L��R��B�SB�L

�H�P��dellqe�A�C�Q�R�delta�N� is used for linear quadratic estimator design in delta domain�Given the system�

�x � Ax� v�

y � Cx� v�

whereQ�E�v�v�� �delta� R�delta�E�v�v�� � N�E�v�v�� �delta

returns the gain matrix H such that the delta domain discrete time Kalman lter�

��x � A�x�H�y �C�x

produces an optimal estimate of x in the LQG sense�H is given by�

H � ���A� I�PC� � N ��CPC��R ��

where P is given by the Riccati equation�

� � Q� PA� �AP ��APA� �H�R��CPC� H�

For both dellqe and dellqr the cross weighting matrix� N� between Q and R may be incorporated orleft out as desired�

��

Page 12: Delta

See also�

delsim�lmsim�dlsim

��

Page 13: Delta

delimp�delstep delimp�delstep

Purpose�

Discrete time delta impulse response�Discrete time delta step response�

Synopsis�

�y�x��delimp�a�b�c�d�iu�t�delta�

�y�x��delimp�num�den�t�delta�

�y�x��delstep�a�b�c�d�iu�t�delta�

�y�x��delstep�num�den�t�delta�

Description�

delimp and delstep calculate the impulse and step response of discrete time linear systems in deltadomain��Y�X��delimp�A�B�C�D�iu�T�delta� given the LTI system�

�x � Ax�Bu

y � Cx�Du

the ouput matrix�Y� returns with the impulse response of the system found from the iu�th input� T isthe time vector over which the response is desired to be found and must be regularly spaced by delta�the sampling period� Upon output Y has as many columns as there are outputs and length�T� rows�X contains the state history of the system��Y�X��delimp�NUM�DEN�T�delta� nds the impulse response of the system�

G��� �NUM ���

DEN ���

delstep is identical to delimp except that it returns the step response rather than the impulseresponse�

Example

Plot the step response from � to �� seconds of a second order system with a natural frequency �n � ��a damping factor of � � ���� and a sample time of ��� using the delta operator�

�a�b�c�d��ord���� ���

�a�b�c�d��c�del�a�b�c�d� ���

t��� �����

�y�x��delstep�a�b�c�d���t� ���

plot�t�y��

Algorithm�

delimp and delstep are Mles� The impulse response is found by setting the initial conditions toB then nding the zero input response of the system using the numerical advantages of the deltatransform� The step response is found by cascading an integrator in series with the system and thencalling delimp� As these routines are not implemented in the kernel of matlab� unlike z domainsimulations� they are not as quick as the z domain routines�

��

Page 14: Delta

Algorithm�

delhinf is an Mle� The algorithm used to solve the Riccati equation is eigenvector decompositionof the associated Hamiltonian matrix� The value of alpha that is used is the smallest value of alphapossible such that the solution matrix P found satises the Riccati equation� Alpha is found byrepeatedly decreasing the value of alpha from an initial large value� determined by the ratio of thenorms of B� and B�� and solving for P� until P no longer saties the Riccati equation�

See also�

lqe�lqr�dellqe�dellqr

References�

�� Lee�L � Goodwin�G�C� and Kolodziej�W Interconnections between Continuous and Discrete Games

with Applications to H�

��

Page 15: Delta

delhinf delhinf

Purpose�

Solution of discrete time delta domain game problems�

Synopsis�

�p�l�q�alpha��delhinf�a�b��b��c�delta�

Description�

delhinf uses the ideas of H� to nd a solution to the discrete time� delta domain game problem��P�L�Q�alpha��delhinf�A�B��B��C�delta�

Given the system�

�x � Ax� B�w � B�u

z � Cx�Du

and the sampling period� delta� the optimum gain matrices L and Q are calculated so that with�

u � �Lx

w � Qx

the cost function�

J�u�w� ��

�k z k�� ��

� k w k���

is minimised�L and Q are given by�

L � B���I ��P

����B�B�� � B�B��

����P �I ��A�

Q � ���B���I ��P

����B�B�� � B�B��

����P �I ��A�

where P is given by the Riccati equation�

� � C�C � A�P � PA��A�PA� �I ��A��P�I ��

����B�B�� �B�B��

�P���

����B�B�� �B�B��

�P �I ��A�

Also returned is the value of alpha that the routine used to nd the gain matrices� Alpha provides alimit on the norm of the transfer function from w to z�

Limitations

A number of assumptions must be met for a unique solution of the Riccati equation to exist and forthe method of solution to work�

�� �A�B� must be stabilizable

�� �C�A must be detectable

�� �I ��A��� must exist

Additionally the solution matrix P must be found to be positive semidenite or else the result ismeaningless�

��

Page 16: Delta

delgram delgram

Purpose�

Discrete time delta domain controllability and observability gramians�

Synopsis�

p�delgram�a�b�delta�

Description�

delgram nds the controllability and observability gramians in delta domain using the discrete timedelta domain form of the Lyapunov equation�P�delgram�A�B�delta� returns the controllability gramian�P�delgram�A��C��delta� returns the observability gramian�

Algorithm�

delgram is an Mle� The delta domain form of the Lyapunov equation is�

AP � PA� ��APA� � �BB�

Using the transformation�

Ac �

�I �

�A

���A

the equation can be put into the form�

AcP � PA�c �

�I �

�A

���

BB��I �

�A����

Now the existing lyap function can be used to solve the problem�

Limitations�

The Lyapunov equation has a unique solution provided A is asymptotically stable� i�e� the eigenvalues�i�of A satisfy Re�i� �

�� jij

� ��

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section ��� and ���

��

Page 17: Delta

Algorithm�

delfreq is an Mle� It uses a Hessenberg algorithm to solve for the frequency response� First theA�B�C�D matrices are balanced and A reduced to upper Hessenberg form� Then the linear equation

C�ej�� � �

�I � A���B �D

is solved directly for each frequency point� taking advantage of the Hessenberg form�

See also�

delbode�delnyq�delnic�logspace

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section ���

��

Page 18: Delta

delfreq delfreq

Purpose�

Frequency response of discrete time linear system in delta domain�

Synopsis�

h�delfreq�a�b�c�d�iu�w�delta�

Description�

delfreq calculates the frequency response of a discrete time delta domain system which can then beused for various di�erent frequency domain plots� such as Bode�Nyquist and Nichols�H�delfreq�A�B�C�D�iu�W�delta� calculates the frequency response of the system�

�x � Ax�Bu

y � Cx�Du

That is� returns�

H�ej�� � �

��

where

H��� � C��I �A���B �D

The response is calculated from the iu�th input and delta is used as the sampling period� The vectorW must initially contain the frequencies� in radians� at which the response is to be evaluated� Theelements of W should not exceed the folding frequency i�e� � ��

� � Upon exit the matrix H has asmany columns as there are outputs and length�W� rows�H�delfreq�NUM�DEN�W�delta� calculates the frequency response from the transfer function description�

H��� �NUM ���

DEN ���

where NUM and DEN contain the polynomial coe�cients in descending powers�

Example

Plot the magnitude and phase responses from � � ��� up to � � ��� of a second order system witha natural frequency �n � �� a damping factor of � � ���� and a sample time of ��� using the deltaoperator�

�a�b�c�d��ord���� ���

�a�b�c�d��c�del�a�b�c�d� ���

w�logspace�������

h�delfreq�a�b�c�d���w� ���

mag�abs�h��

pha�angle�h�����pi�

loglog�w�mag��title��Magnitude response���

semilogx�w�pha��title��Phase response���

which results in the bode diagram being displayed on the screen���

Page 19: Delta

Algorithm�

delbode is an Mle� It rst calculates the frequency range required by nding all the poles of thesystem and then ensuring that the range extends from ��� times the lowest pole up to � times thelargest pole in the system� Next the frequency range is found using logspace to get logarithmicallyspaced points� The routine delfreq is then used to calculate the frequency response of the systemand the resulted is plotted�The routine uses unwrap to ensure that the phase remains smooth and doesn�t jump from ��� degreesto ��� degrees�If it is desired to enter your own frequency range� use delfreq and then plot the results manually�

See also�

delfreq�logspace�unwrap

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section ���

��

Page 20: Delta

delbode delbode

Purpose�

Bode frequency response plots of discrete time delta systems�

Synopsis�

�mag�pha�w��delbode�a�b�c�d�iu�delta�

�mag�pha�w��delbode�num�den�delta�

Description�

delbode calculates the frequency response of a discrete time LTI system in delta domain then� automatically selecting the appropriate frequency range� plots the bode diagram��MAG�PHA�W��delbode�A�B�C�D�iu�delta� calculates the frequency response of the system�

�x � Ax�Bu

y � Cx�Du

from the iu�th input using delta as the sampling period�delbode returns the matrices MAG and PHA �in degrees� with as many rows as there are outputs andlength�W� columns� Upon exit W contains the frequency points used in the bode plot�

G��� � C��I � A���B �D

mag��� � abs�G�ej�� � �

���

pha��� � angle�G�ej�� � �

���

�MAG�PHA�W��delbode�NUM�DEN�delta� calculates the frequency response from the transfer functiondescription�

G��� �NUM ���

DEN ���

and plots it as a bode diagram�

Example

Plot the magnitude and phase responses of a second order system with a natural frequency �n � �� adamping factor of � � ���� and a sample time of ��� using the delta operator�

�a�b�c�d��ord���� ���

�a�b�c�d��c�del�a�b�c�d� ���

�mag�pha�w��delbode�a�b�c�d��� ���

which results in the bode diagram being displayed on the screen�

��

Page 21: Delta

delbalre delbalre

Purpose�

Balanced state space realization and model reduction in discrete time using delta domain�

Synopsis�

�ab�bb�cb�m�t��delbalre�a�b�c�delta�

Description�

delbalre nds an equivalent state space realization that has equal and diagonal controllability andobservability gramians� This system is then in a convenient form for model order reduction��AB�BB�CB�M�T��delbalre�A�B�C�delta� returns the balanced versions of A�B and C� a vector Mcontaining the diagonal of the gramian of the balanced realization �the Hankel singular values�� andthe matrix T used in the similarity transformation�

Algorithm�

delbalre is an Mle and uses the algorithmoutlined in �� � This involves using Cholesky Factorizationand singular value decomposition for symmetric matrices�

Limitations�

The A matrix must have all its eigenvalues within the stability region� Also the system must becontrollable and observable�

See also�

balreal�modred�minreal�gram

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section ����

��

Page 22: Delta

del�z del�z

Purpose�

Conversion of discrete time delta models to discrete time shift models�

Synopsis�

�za�zb�zc�zd��del�z�da�db�dc�dd�delta�

�znum�zden��del�z�dnum�dden�delta�

Description�

del�z converts from discrete time delta domain models to discrete time z domain models��ZA�ZB�ZC�ZD��del�z�DA�DB�DC�DD�delta� converts the discrete delta system�

�x � DAx �DBu

y � DCx�DDu

to the discrete shift system�

qx � ZAx� ZBu

y � ZCx� ZDu

using delta as the sampling period��ZNUM�ZDEN��del�z�DNUM�DDEN�delta� converts the discrete system descibed by�

G��� �DNUM ���

DDEN ���

to the discrete time system�

G�z� �NUM �z�

DEN �z�

Algorithm�

del�z is implemented in an Mle�

See also�

z�del�c�del�del�c�c�d�d�c

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section �����

��

Page 23: Delta

del�c del�c

Purpose�

Conversion of discrete time delta domain models to continuous time models�

Synopsis�

�a�b�c�d��del�c�da�db�dc�dd�delta�

�num�den��del�c�dnum�dden�delta�

Description�

del�c converts from discrete time domainmodels to continuous time models using the delta transformand assuming a zeroorder hold on the inputs��A�B�C�D��del�c�DA�DB�DC�DD�delta� converts the discrete system�

�x � DAx �DBu

y � DCx�DDu

to the continuous system�

�x � Ax� Bu

y � Cx�Du

using delta as the sampling period��NUM�DEN��del�c�DNUM�DDEN�delta� converts the discrete system described by�

G��� �DNUM ���

DDEN ���

to the discrete time system�

G�s� �NUM �s�

DEN �s�

Algorithm�

del�c is implemented in an Mle� The calculation uses a matrix logarithm which is calculated viaParlett�s method in the function logm�

Limitations

For del�c to work the real part of the eigenvalues of DA should not be in the range ����� �� �

See also�

c�del�logm

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section �������

Page 24: Delta

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section ����� and �����

��

Page 25: Delta

ctrlf�obsrf ctrlf�obsrf

Purpose�

Controller and observer form�

Synopsis�

�ac�bc�cc�p��ctrlf�a�b�c�

�ao�bo�co�p��obsrf�a�b�c�

Description�

ctrlf uses a similarity transform to convert a state space system into canonical controller form�obsrf uses a similarity transform to convert a state space system into canonical observer form��AC�BC�CC�P��ctrlf�A�B�C� determines the similarity transformation matrix P such that the transformation x � P �x puts the system�

�x � Ax�Bu

y � Cx�Du

in the form�

��x �

������

��n�� � � � ���� � � � �� � � � �� �

� � � � �

� �x�

������

�����

�u

y � C�x�Du

�AC�BC�CC�P��obsrf�A�B�C� is similar to the controller form except the transformation puts thesystem in the form�

��x �

������

��n�� � � � �� � �� � �

� � ���� � � � �

� �x�Bu

y ��� � � � �

�x�Du

Algorithm�

ctrlf is an Mle� The similarity transform matrix is found by determining the controllability matrixand then post multiplying by a matrix whose form is dependent on the controllability matrix found�obsrf uses duality with the controller form�

Limitations

ctrlf does not work with multiple inputs and obsrf does not work with multiple outputs�

See also�

ctrb�obsv�ctrbf�obsvf

��

Page 26: Delta

c�deld c�deld

Purpose�

Conversion of a continuous time model with a time delay to a discrete time delta model�

Synopsis�

�da�db�dc�dd��c�deld�a�b�c�d�delay�delta�

�dnum�dden��c�deld�num�den�delay�delta�

Description�

c�deld converts from continuous domain models incorporation a time delay to discrete time domainmodels using the delta transform and assuming a zeroorder hold on the inputs� The time delay ismodelled exactly in discrete time by increasing the order of the resulting system��DA�DB�DC�DD��c�del�A�B�C�D�delay�delta� converts the continuous system�

�x � Ax� Bu

y � Cx�Du

with a time delay that is delay seconds long on each on the inputs� to the discrete time system�

�x � DAx �DBu

y � DCx�DDu

using delta as the sampling period��DNUM�DDEN��c�deld�NUM�DEN�delay�delta� converts the continuous system described by�

G�s� �NUM �s�

DEN �s�e��delay�s

to the discrete time system�

G��� �DNUM ���

DDEN ���

Algorithm�

c�deld is implemented in an Mle and uses the algorithm from �� � The calculation uses matrixexponentials which are calculated via Pad�e approximation in the function expm�

See also�

c�del

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section �����

Page 27: Delta

c�del c�del

Purpose�

Conversion of a continuous time model to a discrete time delta model�

Synopsis�

�da�db�dc�dd��c�del�a�b�c�d�delta�

�dnum�dden��c�del�num�den�delta�

Description�

c�del converts from continuous domain models to discrete time domain models using the delta transform and assuming a zeroorder hold on the inputs��DA�DB�DC�DD��c�del�A�B�C�D�delta� converts the continuous system�

�x � Ax� Bu

y � Cx�Du

to the discrete time system�

�x � DAx �DBu

y � DCx�DDu

using delta as the sampling period��DNUM�DDEN��c�del�NUM�DEN�delta� converts the continuous system described by�

G�s� �NUM �s�

DEN �s�

to the discrete time system�

G��� �DNUM ���

DDEN ���

Algorithm�

c�del is implemented in an Mle� The calculation uses a matrix exponential which is calculated viaPad�e approximation in the function expm�

See also�

expm�del�c�c�deld

References�

�� Middleton�R�H� and Goodwin�G�C�Digital Control and Estimation � A Uni�ed Approach

Section �����

Page 28: Delta

Delta Toolbox� Reference

This section contains detailed descriptions of all DELTA TOOLBOX functions� It begins witha list of functions grouped by subject area and continues with the reference entries in alphabeticalorder� Information is also available through the online help facility�

MODEL CONVERSIONSs�del s to � plane conversionc�del cont� to delta conversion using zero order holdc�deld cont� to delta for systems with a time delaydel�c discrete delta to continuous domain conversiondel�z discrete delta to discrete shift conversionz�del discrete shift to discrete delta conversion

FREQUENCY RESPONSEdelfreq frequency response of discrete system in delta domaindelbode bode plot of discrete system in delta domaindelnic nichols plot of discrete system in delta domaindelnyq nyquist plot of discrete system in delta domain

TIME RESPONSEdelsim response of discrete delta system to arbitrary inputdelimp impulse response of discrete delta systemdelstep step response of discrete delta system

MODEL REALIZATIONSdelbalre delta domain form of balanced state space realizationctrlf controller formobsrf observer form

MODEL PROPERTIESdelgram discrete delta form of controllability gramianlctrb controllability matrix with linearly independent columnslobsv observability matrix with linearly independent rows

GAIN SELECTIONdellqe discrete delta domain linear quadratic estimator designdellqr discrete delta domain linear quadratic regulator designdelhinf discrete delta form of H� game problem

UTILITYtfadd addition of two systems in transfer function formtfmult multiplication of two systems in transfer function form

Page 29: Delta

Delta Toolbox� Reference

c�del ������������������������������������������������������������������

c�deld ������������������������������������������������������������������

ctrlf �������������������������������������������������������������������

del�c �������������������������������������������������������������������

del�z ������������������������������������������������������������������

delbalre �������������������������������������������������������������������

delbode �������������������������������������������������������������������

delfreq ������������������������������������������������������������������

delgram �������������������������������������������������������������������

delhinf �������������������������������������������������������������������

delimp �������������������������������������������������������������������

dellqe �������������������������������������������������������������������

dellqr �������������������������������������������������������������������

delnic ������������������������������������������������������������������

delnyq ������������������������������������������������������������������

delsim �������������������������������������������������������������������

delstep �������������������������������������������������������������������

lctrb ������������������������������������������������������������������

lobsv ������������������������������������������������������������������

obsrf �������������������������������������������������������������������

s�del ������������������������������������������������������������������

tfadd ������������������������������������������������������������������

tfmult ������������������������������������������������������������������

z�del �����������������������������������������������������������������

Page 30: Delta

� References

�� R�H Middleton and G�C GoodwinDigital Control and Estimation � A Uni�ed Approach

Note that the references given in the CONTROL SYSTEM TOOLBOX are still relevant for numerical and general systems analysis� The single reference given here is all that is required for theconversion to delta domain�

Page 31: Delta

��� Reliable Computation

The corresponding section in the CONTROL SYSTEM TOOLBOX is applicable to the new routinesas for the old� The emphasis is on simple tools that are easy to understand and use� These toolshowever may break down when the system order is too large or the problem is ill formed� Someroutines will solve a problem that is illconditioned providing results that are meaningless� It istherefore necessary to understand the problem that you are trying to solve when using the toolbox�as for other MATLAB toolboxes�

��� Analysis Functions

This section is as for the CONTROL SYSTEM TOOLBOX except that one set of routines replacesthe two sets� one for continuous time and one for discrete time� that provide the basic linear time andfrequency domain analysis tools required for control system engineering�

ANALYSIS FUNCTIONSdelfreq frequency response of discrete system in delta domaindelbode bode plot of discrete system in delta domaindelnic nichols plot of discrete system in delta domaindelnyq nyquist plot of discrete system in delta domaindelsim response of discrete delta system to arbitrary inputdelimp impulse response of discrete delta systemdelstep step response of discrete delta systemdelgram discrete delta form of controllability gramianlctrb controllability matrix with linearly independent columnslobsv observability matrix with linearly independent rows

��� Model Order Reduction

Using the delta operator some pairs of model order reduction routines can be replaced� Additionallya new form of model realization is introduced�

MODEL REALISATIONSdelbalre delta domain form of balanced state space realizationctrlf controller formobsrf observer form

��� Design Functions

The linear quadratic routines are redone using the delta operator and a new gain selection routineusing the ideas of H� is introduced�

GAIN SELECTIONdellqe discrete delta domain linear quadratic estimator designdellqr discrete delta domain linear quadratic regulator designdelhinf discrete delta form of H� game problem

Page 32: Delta

� Installation

Instructions for installing the DELTA TOOLBOX are found in the section entitled Installing Toolboxes

in the computer specic section of the MATLAB user�s guide� We recommend that you locate the lesfrom this toolbox in a directory named delta o� the control directory of the CONTROL SYSTEMTOOLBOX�

� Integration With The Control Systems Toolbox

The idea of the DELTA TOOLBOX extension to the CONTROL SYSTEM TOOLBOX is to replacethe existing pairs of routines� one continuous and one discrete� by a single delta operator routine� Allthe delta routines have the input parameter delta corresponding to the sampling period� By settingdelta to zero the continuous time case is selected and when delta is nonzero the discrete time case�

In addition to the delta operator routines that are provided there are some extra routines of moregeneral nature that are included� These are included to ll some of the gaps left by the CONTROLSYSTEM TOOLBOX�

The current version of the DELTA TOOLBOX is only an extension to the existing toolbox toallow a familiarity and comparison phase before the delta routines replace completely the existingshift and continuous routines� Hence the existence of routines such as z�del which allow comparisonof the performance of shift domain and delta domain routines�

��� System Models

With the addition of the DELTA TOOLBOX to the CONTROL SYSTEM TOOLBOX all of thesystem models previously supported are still supported� The only modication is that the discretetime case can be represented in two ways� using shift as for the discrete time case in the CONTROLSYSTEM TOOLBOX� or using the delta operator� With the delta operator a system of LTI di�erenceequations can be represented in matrix or state space form by�

�xk � Axk � Buk

yk � Cxk �Duk

where u is a vector of control inputs� x is the state vector� and y is a vector of outputs�An equivalent representation using the delta transform is�

Y ��� � H���U ���

where

H��� � C��I �A���B �D

Otherwise all the comments on system models remain relevant�

��� Model Conversions

As for the System Models case all of the comments in the CONTROL SYSTEM TOOLBOX arepertinent� The only addition are a set of routines to allow conversion back and forth between the threedi�erent domains supported� the discrete time domain using delta� the discrete time shift operatordomain� and the continuous domain�

MODEL CONVERSIONSs�del s to � plane conversionc�del cont� to delta conversion using zero order holdc�deld cont� to delta for systems with a time delaydel�c discrete delta to continuous domain conversiondel�z discrete delta to discrete shift conversionz�del discrete shift to discrete delta conversion

Page 33: Delta

Delta Toolbox� A Tutorial

� Introduction

MATLAB� through its linear algebra� matrix computation� and numerical analysis capabilities provides a good foundation for control theory system design and analysis� The CONTROL SYSTEMTOOLBOX� an extension of MATLAB� provides an extensive collection of routines for use by thecontrol or systems engineer� The routines allow control systems to be modelled as transfer functionsor in state space form� and provide conversion routines between the various model representations�Time response� frequency response� poleplacement� optimal control and estimation are all providedin the toolbox� The toolbox handles both continuous and discrete time systems� The CONTROLSYSTEM TOOLBOX therefore� is a very useful tool for any control or system engineer�

A disadvantage with the CONTROL SYSTEM TOOLBOX is that the shift operator and ztransforms are used for discrete time systems� It has been shown extensively in the last few years �� that the delta operator is superior to the shift operator for discrete time systems� The delta operatorunies continuous and discrete time theory such that discrete time results converge to the corresponding continuous time results as the sampling period is decreased and� in addition� provides improvednumerical properties� The idea of the DELTA TOOLBOX then is to upgrade the CONTROL SYSTEM TOOLBOX using the delta operator such that each pair of existing routines� one continuousand one discrete� is replaced by one routine using the delta operator�

The DELTA TOOLBOX is based very closely on the design of the CONTROL SYSTEM TOOLBOX and most of what is said in its tutorial is relevant to the DELTA TOOLBOX also� What followsis a brief explanation for the motivation behind the toolbox and then an explanation on how thetoolbox integrates with the CONTROL SYSTEM TOOLBOX�

� Advantages of Delta Over Shift

A disadvantage with the CONTROL SYSTEM TOOLBOX is that� as the shift operator is used fordiscrete time� for each application there is one routine for continuous time and another for discretetime� Having a pair of routines for each task emphasises the di�erences between discrete and continuous theory rather than the similarities� Also� note that as the sampling rate increases shift operatorsand z transforms have no continuous time counterpart� Use of the delta operator� however� ensuresthat the discrete time result converges to the corresponding continuous time result as the samplingrate is increased� thus continuous and discrete time theory are unied�

A side benet of the use of the delta operator is improved numerical properties over the shiftoperator� The shift and delta operators are related by�

� �q � �

One might initially think that some form of di�erentiation is occurring and thus the numerical performance of the delta operator would be inferior to that of the shift operator� However� after extensivesimulation studies and analysis� it was found that this was not the case� rather the delta operatorgave improved relative performance� This was observed especially when the sampling period wassmall� the order of the systems very large� or the numerical calculations were performed in restrictedwordlength� The reason for this is that in discrete time all the information about a system is containedin the distance that the poles and zeros of the system are from one� When using the shift operatorhowever the physical numbers that are recorded by the computer are not these distances but theactual positions of the poles and zeros� When the sampling period is small� the systems order high�or nite word length arithmetic is used the numbers to be stored are very close to one and not suitedto storage by a computer using oating point arithmetic� The delta operator solves the problem bysubtracting one from the shift operator value �and then scaling�� Hence for numbers very close toone� numbers very close to zero are generated� which are much easier to store using oating pointarithmetic� Therefore delta operators retain information that is lost when using shift operators when oating point arithmetic is used� hence the improved performance under adverse conditions� It hassince been proven mathematically that the delta operator is superior to the shift operator numerically�

For a more detailed treatment on the advantages of the delta operator see reference �� �

Page 34: Delta

Delta Toolbox� A Tutorial

�� Introduction

�� Advantages Of Delta Over Shift

�� Installation

�� Integration With The Control Systems Toolbox

��� System Models

��� Model Conversions

��� Reliable Computation

��� Analysis Functions

��� Model Order Reduction

��� Design Functions

�� References

Page 35: Delta

Delta Toolbox

Users Guide

March � ����