ComputationVisualizationProgrammingFor Use with MATLAB®Using the Control System ToolboxVersion 1Control SystemToolbox
viiiStore ... 13-20Retrieve... 13-21Clear ...
3 Operations on LTI Models3-26Resampling of Discrete-Time ModelsYou can resample a discrete-time TF, SS, or ZPK model sys1 by typingsys2 = d2d(sys1,Ts
References3-27References[1] Åström, K.J. and B. Wittenmark, Computer-Controlled Systems: Theoryand Design, Prentice-Hall, 1990, pp. 48–52.[2] Franklin
3 Operations on LTI Models3-28
4Model Analysis ToolsGeneral Model Characteristics ...4-2Model Dynamics ...4-4State-Space Realizations ...4-7
4 Model Analysis Tools4-2
General Model Characteristics4-3General Model CharacteristicsGeneral model characteristics include the model type, I/O dimensions,and continuous or di
4 Model Analysis Tools4-4 Transfer function from input 2 to output: s – 1--------------s^2 + 2 s + 10class(H)ans =tfsize(H)Transfer function with 2
Model Dynamics4-5Model DynamicsThe Control System Toolbox offers commands to determine the systempoles, zeros, DC gain, norms, etc. You can apply thes
4 Model Analysis Tools4-6–1.7971 – 2.2137i–0.2629 + 2.7039i–0.2629 – 2.7039izero(h)ans = –0.0500 + 2.7382i –0.0500 – 2.7382i –2.0000 dcgain(h)an
Model Dynamics4-7 Model sysarray(:,:,3,1)=======================Transfer function: 0.621 s + 0.7567 --------------------- s^2 + 2.942 s + 2.1133x
ixLTI Viewer Menu Bar ... 14-4File ... 14-4NewViewer ...
4 Model Analysis Tools4-8State-Space RealizationsThe following functions are useful to analyze, perform state coordinatetransformations on, and derive
State-Space Realizations4-9poorly suited for state-space computations. Consequently, it is wise touse them only for analysis purposes and notincontrol
4 Model Analysis Tools4-10
5Arrays of LTI ModelsIntroduction ...5-4When to Collect a Set of Models in an LTI Array . . . . . . 5-2Restrictions for LTI Models Co
5 Arrays of LTI Models5-2IntroductionIn many applications, it is useful to consider collections of linear, timeinvariant (LTI) models. For example, yo
Introduction5-3•The number of inputs and outputs•The sample time, for discrete-time models•The I/O names and I/O groupsNote You cannot specify Simuli
5 Arrays of LTI Models5-4The Concept of an LTI ArrayTo visualize the concept of an LTI array, consider the set of five transferfunction models shown b
The Concept of an LTI Array5-5Just as you might collect a set of two-by-two matrices in a multidimensionalarray, you can collect this set offive trans
5 Arrays of LTI Models5-6Higher Dimensional Arrays of LTI ModelsYou can also collect a set of models in a two-dimensional array. The followingdiagram
Dimensions, Size, and Shape of an LTI Array5-7Dimensions, Size, and Shape of an LTI ArrayThe dimensions and size of a single LTI model are determined
x ContentsCharacteristics ... 15-4Grid... 15-5Zoom ...
5 Arrays of LTI Models5-8The next figure illustrates the concepts of dimension and size for the LTI arraym2d, a 2-by-3 array of one-input, two-output
Dimensions, Size, and Shape of an LTI Array5-9•N, the number of models in the LTI array•K, the number of array dimensions• , the list of lengths of th
5 Arrays of LTI Models5-10Note the following when using the size function:•By convention, a single LTI model is treated as a 1-by-1 array of models.Fo
Dimensions, Size, and Shape of an LTI Array5-11reshapeUsereshape to reorganizethearrangement (arrayconfiguration) ofthemodelsof an existing LTI array.
5 Arrays of LTI Models5-12Building LTI ArraysThere are several ways to build LTI arrays:•Using afor loop to assign each model in the array•Usingstack
Building LTI Arrays5-13Suppose, based on measured input and output data, you estimate confidenceintervals , and for each of the parameters, and . All
5 Arrays of LTI Models5-14The first two colon indices ( ) select all I/O channels from the I/O dimensionsofH.Thethird index ofH refers to the firstarr
Building LTI Arrays5-15For the purposes of efficient computation, you can initialize an LTI array tozero, and then reassign the entire array to the va
5 Arrays of LTI Models5-16When you concatenate several models or LTI arrays along the jth arraydimension, such as instack(j,sys1,sys2,...,sysn)•The le
Building LTI Arrays5-17Notice that this result is very different from the single MIMO LTI modelreturned byH = [H11,H12;H21,H22];Building LTI Arrays Us
xidsort ... 16-65dss ... 16-66dssdata ...
5 Arrays of LTI Models5-18•gains is a multidimensional array containing the scalar gains for each I/Opair of each model in the array.•The dimensions (
Building LTI Arrays5-19Specifying Arrays of FRD Models Using frdTo specify a K-dimensional array of p-output, m-input FRD models for whichare the leng
5 Arrays of LTI Models5-20Indexing Into LTI ArraysYou can index into LTI arrays in much the same way as you would formultidimensional arrays to:•Acces
Indexing Into LTI Arrays5-21•The remaining indices specify the model coordinates within the array.For example, ifsys is a 5-by-2 array of state-space
5 Arrays of LTI Models5-22or equivalently,A = sys(1,[1 2],:,:)selects the first two input channels,and the first output channel in each modelof the LT
Indexing Into LTI Arrays5-23Notice that you don’t have to use the array dimensions with this assignment.This is because I/O selection applies to all m
5 Arrays of LTI Models5-24Operations on LTI ArraysUsing LTI arrays, you can apply almost all of the basic model operations thatwork on single LTI mode
Operations on LTI Arrays5-25Example: Addition of Two LTI ArraysThe following diagram illustrates the addition of two 3-by-1 LTI arrayssys1+sys2.Figure
5 Arrays of LTI Models5-26Note that:•Each model insys1 and sys2 must have the same number of inputs andoutputs. This is required for the addition of t
Operations on LTI Arrays5-27dimensions as sys1. You can use shortcuts for coding sysa = op(sys1,sys2)in the following cases:•For operations that apply
xii Contentsnichols... 16-149norm ... 16-152nyquist ...
5 Arrays of LTI Models5-28h(:,:,i)=tf(1,[1 tau]); endH = [h 0; –1 tf(1,[1 0])]; %Concatenation: array h & single modelssize(H)3x1 array of continu
Operations on LTI Arrays5-29adds the array of scalars to each entry of each MIMO model in the LTI array[h,h] on a model-by-model basis. This last comm
5 Arrays of LTI Models5-30
6CustomizationThe Property and Preferences Hierarchy . . . . . . . . . 6-3
6 Customization6-2The Control System Toolbox provides editors that allow you to set propertiesand preferences in the SISO Design Tool, the LTI Viewer,
6-3The Property and Preferences HierarchyThis diagram explains the hierarchy from properties, which are local, totoolbox preferences, which are global
6 Customization6-4
7Setting ToolboxPreferencesOpening the Toolbox Preferences Editor . . . . . . . . . 7-2UnitsPage...7-3StylePage ...
7 Setting Toolbox Preferences7-2The Toolbox Preferences Editor allows you to set plot preferences that willpersist from session to session. This is th
7-3Units PageNote To get help on pages in the Control System Toolbox Preferences editor,click on the page tabs below.Use theUnits page to set prefere
xiiiIndex
7 Setting Toolbox Preferences7-4Use the Style page to toggle grid visibility and set font preferences and axesforeground colors for all plots you crea
7-5The Characteristics page has selections for response characteristics and phasewrapping. This figure shows the Characteristics page with default set
7 Setting Toolbox Preferences7-6The SISO Tool page has settings for the SISO Design Tool. This figure showsthe SISO Tool page with default settings.Yo
8Setting Tool PreferencesOpeningtheLTIViewerPreferencesEditor...8-2UnitsPage...8-3StylePage ...8-3Characteris
8 Setting Tool Preferences8-2Both the LTI Viewer and the SISO Design Toolhave Tool Preferences Editors.These editors comprise the middle layer of “The
8-3Units PageNote Click on the page tabs below to get help on LTI Viewer Preferenceeditor pages.You can select the following on theUnits page (shown
8 Setting Tool Preferences8-4Use the Style page to toggle grid visibility and set font preferences and axesforeground colors for all plots in the LTI
8-5The Characteristics page, shown below, has selections for responsecharacteristics and phase wrapping.The following choices are available:•Response
8 Setting Tool Preferences8-6Use the Parameters page, shown below, to specify input vectors for time andfrequency simulation.The defaults are to gener
8-7To open the SISO Tool Preferences editor, select SISO Tool Preferencesfrom the Edit menu of the SISO Design Tool. This window opens.Figure 8-2: Th
xiv Contents
8 Setting Tool Preferences8-8The Units page has settings for the following units:•Frequency — Radians per second (rad/sec) or Hertz (Hz)•Magnitude — D
8-9Colors PanelSpecify the color vector to use for the axes foreground, which includes the X-Yaxes, grid lines, and tick labels. Use a three-element v
8 Setting Tool Preferences8-10the Define Custom Colors button. This extends the Select Color window, asshowninthisfigure.You can pick colors fromtheco
8-11The Options page, shown below, has selections for compensator format andBode diagrams.You can make the following selections:•Compensator Format —
8 Setting Tool Preferences8-12Line Colors PageNote Click on the page tabs below to get help on SISO Tool Preference editorpages.TheLine Colors page,
9Customizing ResponsePlot PropertiesProperty Editor ...9-3LabelsPage...9-4LimitsPage...9-4UnitsPage
9 Customizing Response Plot Properties9-2The lowest level of “The Property and Preferences Hierarchy” is settingresponse plot properties. If you have
Property Editor9-3Property EditorNote Click on the page tabs below to get help on pages in the PropertyEditor.This figure shows theProperty Editor fo
9 Customizing Response Plot Properties9-4As you make changes in the Property Editor, they display immediately in theresponse plot. Conversely, if you
Property Editor9-5The Control System Toolbox selects default values for the axes limits to makesurethatthemaximumandminimum xandyvaluesare displayed.I
1 Introduction
9 Customizing Response Plot Properties9-6You can use the units page to change units in your response plot. The contentsof this page depend on the resp
Property Editor9-7Style PageNote Click on the page tabs below to get help on pages in the PropertyEditor.Use theStyle page to toggle grid visibility
9 Customizing Response Plot Properties9-8•Colors — Specify the color vector to use for the axes foreground, whichincludes the X-Y axes, grid lines, an
Property Editor9-9them. Use the checkboxes to activate the feature and the fields to specify riseor settling time percentages.Table 9-2: Response Cha
9 Customizing Response Plot Properties9-10Property Editing for SubplotsIf you create more than one plot in a single figure window, you can edit eachpl
Customizing Plots Inside the SISO Design Tool9-11Customizing Plots Inside the SISO Design ToolCustomizing plots inside the SISO Design Tool issimilar
9 Customizing Response Plot Properties9-12Labels PageNote Click on the page tabs below to get help on pages in the Root LocusProperty Editor.You can
Customizing Plots Inside the SISO Design Tool9-13root locus plot. Use the Limits page, shown below, to override the defaultsettings.To change the limi
9 Customizing Response Plot Properties9-14Using these buttons, you can store and retrieve any number of saved customaxes limits.Options PageNote Clic
Customizing Plots Inside the SISO Design Tool9-15at the MATLAB promptandimportGservo from the workspace into your SISODesign Tool.Figure 9-3: Display
1 Introduction1-2For convenience, this document gathers together nearly all the online doc forthe Control System Toolbox in PDF format for printing. T
9 Customizing Response Plot Properties9-16•Select Bode and then Properties from Edit in the menu barNote Click on the page tabs below to get help on
Customizing Plots Inside the SISO Design Tool9-17You can use the Label page to specify plot titles and axis labels. To specify anew label, type the st
9 Customizing Response Plot Properties9-18The Control System Toolbox sets default limits for the frequency, magnitude,and phase scales for your plots.
Customizing Plots Inside the SISO Design Tool9-19This figure shows the Options page for Bode diagrams.The following options are available from this pa
9 Customizing Response Plot Properties9-20
10Design Case StudiesYaw Damper for a 747 Jet Transport ...10-3Open-LoopAnalysis ...10-5RootLocusDesign...10-9Washo
10 Design Case Studies10-2This chapter contains four detailed case studies of control system design andanalysis using the Control System Toolbox.•“Yaw
Yaw Damper for a 747 Jet Transport10-3Yaw Damper for a 747 Jet TransportThis case study demonstrates the tools for classical control design by steppin
10 Design Case Studies10-4 b = rudder aileron beta 0.0729 0 yaw -4.75 0.00775
Yaw Damper for a 747 Jet Transport10-5pzmap(sys)This model has one pair of lightly damped poles. They correspond to what iscalled the “Dutch roll mode
2LTI ModelsCreating LTI Models ...2-8LTI Properties ...2-25Model Conversion ...2-40Time Delays ...
10 Design Case Studies10-6impulse(sys)Theimpulseresponseconfirmsthatthesystemis lightly damped. But the timeframe is much too long because the passeng
Yaw Damper for a 747 Jet Transport10-7impulse(sys,20)Look at the plot from aileron (input 2) to bank angle (output 2). To show onlythis plot, right-cl
10 Design Case Studies10-8The new figure is shown below.The aircraft is oscillating around a nonzero bank angle. Thus, the aircraft isturning in respo
Yaw Damper for a 747 Jet Transport10-9bode(sys11)From this Bode diagram, you can see that the rudder has significant effectaround the lightly damped D
10 Design Case Studies10-10rlocus(sys11)This is the root locus for negative feedback and shows that the system goesunstable almost immediately. If, in
Yaw Damper for a 747 Jet Transport10-11sgridThis looks better. By using simple feedback, you can achieve a damping ratioof . Click on the blue curve a
10 Design Case Studies10-12gain and damping values. To achieve a 0.45 damping ratio, the gain should beabout 2.85. This figure shows the data marker w
Yaw Damper for a 747 Jet Transport10-13impulse(sys11,'b--',cl11,'r',20)The closed-loop response settles quickly and does not oscil
10 Design Case Studies10-14Plot the MIMO impulse response.impulse(sys,'b--',cloop,'r',20)The yaw rate response is now well damped,
Yaw Damper for a 747 Jet Transport10-15The washoutfilter places a zero at the origin,which constrains the spiral modepole to remain near the origin. W
How to Contact The MathWorks:508-647-7000 Phone508-647-7001 FaxThe MathWorks, Inc. Mail3AppleHillDriveNatick, MA 01760-2098http://www.mathworks.com We
2 LTI Models2-2The Control System Toolbox offers extensive tools to manipulate and analyzelinear time-invariant (LTI) models. It supports both continu
10 Design Case Studies10-16This figure shows a data marker at the maximum damping ratio; the gain isapproximately 2.07.Look at the closed-loop respons
Yaw Damper for a 747 Jet Transport10-17impulse(cl11,20)The response settles nicely but has less damping than your previous design.Finally, you can ver
10 Design Case Studies10-18% Final closed-loop impulse responseimpulse(sys,'b--',cloop,'r',20)The bank angle response (output 2)du
Yaw Damper for a 747 Jet Transport10-19response more closely, use the I/O Selector in the right-click menu to select the(2,2) I/O pair.Although you di
10 Design Case Studies10-20Hard-Disk Read/Write Head ControllerThis case study demonstrates the ability to perform classical digital controldesign by
Hard-Disk Read/Write Head Controller10-21num = Ki;den = [J C K];H = tf(num,den)MATLAB responds withTransfer function: 0.05--------------------
10 Design Case Studies10-22bode(H,'-',Hd,'--')To analyze the discrete system, plot its step response, type
Hard-Disk Read/Write Head Controller10-23step(Hd)The system oscillates quite a bit. This is probably due to very light damping.You can check this by c
10 Design Case Studies10-24rlocus(Hd)As shown in the root locus, the poles quickly leave the unit circle and gounstable. You need to introduce some le
Hard-Disk Read/Write Head Controller10-25D = zpk(0.85,0,1,Ts)oloop = Hd * DNow see how this compensator modifies the open-loop frequency response.bode
2-3Using LTI Models in the Control System ToolboxYou can manipulate TF, SS, and ZPK models using the arithmetic and modelinterconnectionoperations des
10 Design Case Studies10-26Open the Property Editor by right-clicking in the plot away from the curve.On theLimits page, set the x-axis limits from -1
Hard-Disk Read/Write Head Controller10-27marker to find the point on the curve where the gain equals 4.111e+03. Thisfigure shows the data marker at th
10 Design Case Studies10-28step(cloop)Thisresponsedependsonyourclosedloopsetpoint.Theoneshownhereisrelatively fastandsettles inabout 0.07 seconds. The
Hard-Disk Read/Write Head Controller10-29Next apply margin to this open-loop model. Type[Gm,Pm,Wcg,Wcp] = margin(olk);Margins = [Gm Wcg Pm Wcp]Margins
10 Design Case Studies10-30The command produces the plot shown below.This design is robust and can tolerate a 11 dB gain increase or a 40 degreephase
LQG Regulation: Rolling Mill Example10-31LQG Regulation: Rolling Mill ExampleThis case study demonstrates the use of the LQG design tools in a process
10 Design Case Studies10-32This shape is impressed by two pairs of rolling cylinders (one per axis)positioned by hydraulic actuators. The gap between
LQG Regulation: Rolling Mill Example10-33This leads to the following generic model for each axis of the rolling process.Figure 10-1: Open-loop model
10 Design Case Studies10-34Model Data for the x-AxisModel Data for the y-AxisLQG Design for the x-AxisAs a first approximation, ignore the cross-coupl
LQG Regulation: Rolling Mill Example10-35% Input thickness/hardness disturbance modelFix = tf(1e4,[1 0.05],'inputn','w-ix')% Rolli
2 LTI Models2-4Creating an LTI Object: An ExampleAn LTI object of the type TF, ZPK, SS, or FRD is created whenever you invokethe corresponding constru
10 Design Case Studies10-36ans = 'x-gap' 'x-force'The second output 'x-force' is the rolling force measurement. T
LQG Regulation: Rolling Mill Example10-37Note: lqry expects all inputs to be commands and all outputs to bemeasurements. Here the command'u-x&ap
10 Design Case Studies10-38bode(Regx,{0.1 1000})The phase response has an interesting physical interpretation. First, consideran increase in input thi
LQG Regulation: Rolling Mill Example10-39 'u-x' 'w-ex' 'w-ix' Regx.outputnameans = 'u-x' Px.outpu
10 Design Case Studies10-40bode(Px(1,2:3),'--',clx(1,2:3),'-',{0.1 100})The dashed lines show the open-loop response. Note that th
LQG Regulation: Rolling Mill Example10-41lsim(Px(1,2:3),':',clx(1,2:3),'-',wx,t)The dotted lines correspond to the open-loop respo
10 Design Case Studies10-42% State-feedback gain designPydes = append(lpf,1) * Py % Add low-freq. weigthingset(Pydes,'outputn',{'y-gap
LQG Regulation: Rolling Mill Example10-43lsim(Py(1,2:3),':',cly(1,2:3),'-',wy,t)The dotted lines correspond to the open-loop respo
10 Design Case Studies10-44The coupling between axes is as follows.Figure 10-2: Coupling between the x- and y-axesAccordingly, the thickness gaps and
LQG Regulation: Rolling Mill Example10-45Let’s see how the previous “decoupled” LQG design fares when cross-couplingis taken into account. To build th
2-5Precedence RulesOperations like addition and commands like feedback operate on more thanone LTI model at a time. If these LTI models are represente
10 Design Case Studies10-46lsim(Pc(1:2,3:6),':',cl(1:2,3:6),'-',wxy,t)The response reveals a severe deterioration in regulation pe
LQG Regulation: Rolling Mill Example10-47 'w_ey' 'w_iy'P.outputnameans = 'x-gap' 'y-gap' &apos
10 Design Case Studies10-48sigma(RegMIMO)Next, plot the open- and closed-loop time responses to the white noise inputs(using the MIMO LQG regulator fo
LQG Regulation: Rolling Mill Example10-49lsim(Pc(1:2,3:6),':',cl(1:2,3:6),'-',wxy,t)The MIMO design is a clear improvement over th
10 Design Case Studies10-50Kalman FilteringThis final case study illustrates the use of the Control System Toolbox forKalman filter design and simulat
Kalman Filtering10-51In these equations:• is the estimate of given past measurements up to• is the updated estimate based on the last measurementGiven
10 Design Case Studies10-52 'outputname','y');Assuming that , you can now design the discrete Kalman filt
Kalman Filtering10-53 x2_e 0.5919 0.3798 x3_e 0.5191 0.081732 c = x1_e x2_e
10 Design Case Studies10-54You can construct a state-space model of this block diagram with the functionsparallel and feedback. First build a complete
Kalman Filtering10-55 'v' 'u'SimModel.outputnameans = 'y' 'y_e'You are now ready to simulate the
2 LTI Models2-6sys = sys1 + sys2because parallel connection amounts to adding the transfer matrices.Similarly, subsystems of a given LTI modelsys can
10 Design Case Studies10-56xlabel('No. of samples'), ylabel('Error')The first plot shows the true response (dashed line) and the f
Kalman Filtering10-57EstErrCov EstErrCov = 0.2722Time-Varying Kalman FilterThe time-varying Kalman filter is a generalization of the steady-state f
10 Design Case Studies10-58For simplicity, we have dropped the subscripts indicating the time dependenceof the state-space matrices.Given initial cond
Kalman Filtering10-59 x = A*x + B*u(i); % x[n+1|n] P = A*P*A' + B*Q*B'; % P[n+1|n]endYou can now compare the true and estimated
10 Design Case Studies10-60plot(t,errcov), ylabel('Error covar')From this covariance plot, you can see that the output covariance did indeed
Kalman Filtering10-61Mn = 0.3798 0.0817 -0.2570M = 0.3798 0.0817 -0.2570References[1] Grimble, M.J., Robust Industrial Control: Optima
10 Design Case Studies10-62
11Reliable ComputationsConditioning and Numerical Stability ...11-4Conditioning ...11-4Numerical Stability . . . . . . . . . . .
11 Reliable Computations11-2When working with low-order SISO models (less than five states), computersare usually quite forgiving and insensitive to n
11-3At the same time, it is important to appreciate the limitations of computeranalyses. By following a few guidelines, you can avoid certain tools an
2-7ssdata, dssdataRetrieve state-space data (respectively, descriptorstate-space data).tfCreate a transfer function.tfdataRetrieve transfer function d
11 Reliable Computations11-4Conditioning and Numerical StabilityTwo of the key concepts in numerical analysis are the conditioning of problemsand the
Conditioning and Numerical Stability11-5Notice how much the small change in the data is magnified in the solution.One way to measure the magnification
11 Reliable Computations11-6row of A. This perturbed matrix has n distinct eigenvalues with. Thus, you can see that this small perturbation in thedata
Conditioning and Numerical Stability11-7Using row 1as the pivot row (i.e., subtracting 1000 times row 1from row 2)youarrive at the equivalent triangul
11 Reliable Computations11-8Choice of LTI ModelNow turn to the implications of the results in the last section on the linearmodeling techniquesused fo
Choice of LTI Model11-9A major difficulty is the extreme sensitivity of the roots of a polynomial to itscoefficients. This example is adapted from Wil
11 Reliable Computations11-10very little. This is true ingeneral. Different roots have different sensitivities todifferent perturbations. Computed roo
Choice of LTI Model11-11 5.000000270433721e+00 5.000000000000000e+00 5.999998194359617e+00 6.000000000000000e+00 7.000004542844700
11 Reliable Computations11-12 0 0 0 10.0000The condition number (with respect to inversion) of the eigenvector matrix iscond
Choice of LTI Model11-13The condition number of the new eigenvector matrixcond(vc)ans =34.5825is thirty times larger.The phenomenon illustrated abovei
2 LTI Models2-8Creating LTI ModelsThe functions tf, zpk, ss,andfrd create transfer function models,zero-pole-gain models, state-space models, and freq
11 Reliable Computations11-14extraordinary arithmetic range difficulties of polynomial coefficients, asillustrated in the “Transfer Function” section.
Scaling11-15ScalingStatespaceisthepreferred modelforLTIsystems, especially withhigher ordermodels. Even with state-space models, however, accurate res
11 Reliable Computations11-16entries are the smallest deviations that are significant to each variable. Anexcellent discussion of scaling is given in
Summary11-17SummaryThis chapter has described numerous things that can go wrong whenperforming numerical computations. You won’t encounter most of the
11 Reliable Computations11-18References[1] Dongarra, J.J., J.R. Bunch,C.B. Moler, and G.W. Stewart, LINPACK UsersGuide, SIAM Publications, Philadelphi
12 GUI Reference
12 GUI Reference12-2The next three chapters discuss in detail all the features of theLTI Viewer andthe SISO Design Tool. The LTI Viewer is a graphical
13 SISO Design ToolReferenceMenu Bar ...13-4Tool Bar ...13-23Current Compensator ...13-24Feedback Stru
13 SISO Design Tool Reference13-2TheSISO DesignTool isa graphical-user interface(GUI)thatallowsyou touseroot-locus and Bode diagram techniques to desi
13-3This document describes the SISO Design Tool features left-to-right andtop-to-bottom, starting with the Menu bar and ending with the Status panel
Creating LTI Models2-9where num and den are row vectors listing the coefficients of the polynomialsand , respectively, when these polynomials are orde
13 SISO Design Tool Reference13-4Menu BarNote Click on items on the menu bar pictured below to get help contents.Most of the tasks you can do in the
Menu Bar13-5ImportSelect Import to import models into the SISO Design Tool. Selecting Importopens the Import System Data window, which is shown below.
13 SISO Design Tool Reference13-6•Feedback structure specification — Press Other to toggle between placingthe compensator in the forward and feedback
Menu Bar13-7they are adjacent on the list. If you want to save non-adjacent models, holddown theCtrl key while selecting the models.2 For each model y
13 SISO Design Tool Reference13-8Toolbox PreferencesSelect Toolbox Preferences to open the Control System Toolbox Preferencesmenu. This picture shows
Menu Bar13-9Print to FigurePrint to Figure opens a separate figure window containing the root locusand/or Bode diagrams in your current SISO Design To
13 SISO Design Tool Reference13-10SISO Tool PreferencesSISO Tool Preferences opens the SISO Tool Preferences editor. This pictureshows the open window
Menu Bar13-11Root Locus and Bode DiagramsBy default, the SISO Design Tool displays the root locus and Bode magnitudeand phase diagrams. You can desele
13 SISO Design Tool Reference13-12Closed Loop PolesUsethismenuitemtodisplaytheclosed-looppolevaluesofthecurrentsystem.Design HistorySelecting Design H
Menu Bar13-13•Open-Loop Nyquist — The open-loop Nyquist plot for your system•Open-Loop Nichols — The open-loop Nichols plot for your systemCustomizing
2 LTI Models2-10MIMO Transfer Function ModelsMIMO transfer functions are two-dimensional arrays of elementary SISOtransfer functions. There are severa
13 SISO Design Tool Reference13-14•Loop transfer — This is defined as the compensator (C), the plant (G), andthe sensor (H) multiplied together (CGH).
Menu Bar13-15Continuous/Discrete ConversionsSelectingContinuous/Discrete Conversions opens theContinuous/DiscreteConversionswindow, which you can use
13 SISO Design Tool Reference13-16Conversion method. The following are the available continuous-to-discreteconversion methods:•Zero-order hold•First-o
Menu Bar13-17•Tustin with prewarping•Matched pole/zeroAgain, if you choose Tustin with prewarping, you must specify the criticalfrequency.Draw a Simul
13 SISO Design Tool Reference13-18FormatSelecting Format under Compensator activates the SISO Tool Preferenceseditor with theOptions page open. This f
Menu Bar13-19For a general description of the SISO Tool Preferences editor, see SISO DesignTool Preferences in the online documentation.EditSelecting
13 SISO Design Tool Reference13-20Adding poles and zerosTo add real poles to yourcompensator, press Add Real Pole.Thisactionopensan empty field in the
Menu Bar13-21RetrieveRetrieve opens the Compensator Designs window, shown in the figurebelow.Thiswindowlistsallthecompensatordesignsyou havestoredduri
13 SISO Design Tool Reference13-22Each topics takes you to a different place in the online documentation:•Main Help — The top of this document (SISO T
Tool Bar13-23Tool BarThe tool bar performs the following operations:•Add and delete real and complex poles and zeros•Zoom in and out•Invoke the SISO D
Creating LTI Models2-11You can specify this MIMO transfer matrix by typingN = {[1 –1];[1 2]}; % cell array for N(s)D = {[1 1];[1 4 5]}; % cell array f
13 SISO Design Tool Reference13-24Current CompensatorThe Current Compensator panel shows the structure of the compensator youare designing. The defaul
Feedback Structure13-25Feedback StructureTo the right of the Current Compensator panel is the Feedback Structurepanel, which is shown in its default c
13 SISO Design Tool Reference13-26Root Locus Right-Click MenusNote Click on items in the right-click menu pictured below to get helpcontents..Note th
Root Locus Right-Click Menus13-27•Complex Zero•Differentiator (zero at 0)•Lead•Lag•NotchIn all but the integrator and differentiator, once you select
13 SISO Design Tool Reference13-28Design ConstraintsSelect Design Constraints to open the Design Constraints window, which isshown below.You have the
Root Locus Right-Click Menus13-29ZoomSelecting Zoom opens this submenu.You have the following zooming options:•X-Y — Enlarge a selected area in the X-
13 SISO Design Tool Reference13-30PropertiesProperties opens the Property Editor for the root locus. This picture showsthe open window.You can use thi
Bode Diagram Right-Click Menus13-31Bode Diagram Right-Click MenusNote Click on items in the right-click menu pictured below to get helpcontents..AddT
13 SISO Design Tool Reference13-32•Lead•Lag•NotchIn all but the integrator and differentiator, once you select the configuration,your cursor changes t
Bode Diagram Right-Click Menus13-33ShowUse Show to select/deselect the display of magnitude, phase, and stabilitymargins. This figure displays the Sho
iContents1Introduction2LTI ModelsLTIModels... 2-2UsingLTIModelsintheControlSystemToolbox... 2-3LTIObjec
2 LTI Models2-12Zero-Pole-Gain ModelsThis section explains how to specify continuous-time SISO and MIMOzero-pole-gain models. The specification for di
13 SISO Design Tool Reference13-34•In-Y — Zoom in, Y-axis only. To do this, select In-Y, hold down your mouse’sleft button, and drag vertically to cre
Status Panel13-35Status PanelThe Status Panel is located at the bottom of the SISO Design Tool. It displaysthe most recent actionyou have performedand
13 SISO Design Tool Reference13-36
14LTI Viewer ReferenceLTI Viewer ...14-2LTI Viewer Menu Bar ...14-4Right-Click Menus for SISO Systems ...14-12Righ
14 LTI Viewer Reference14-2LTI ViewerThe LTI Viewer is a graphical user interface (GUI) that supports ten plotresponses, including step, impulse, Bode
LTI Viewer14-3Figure 14-1: The LTI Viewer and Right-Click Menus for SISO and MIMO/LTI Array Models. Click on the Plots or the Menus for Help Contents
14 LTI Viewer Reference14-4LTI Viewer Menu BarNote Click on File, Edit, Window,orHelp on the menu bar pictured belowto get help on the menu items.Thi
LTI Viewer Menu Bar14-5•Import and export models•SetplotpreferencesforalltheplotsgeneratedbytheControlSystemToolbox•Print response plots•Close the LTI
14 LTI Viewer Reference14-6b Hold the Control key and click on individual variables.c Hold the Shift key while clicking, to select a range.•Press theO
LTI Viewer Menu Bar14-7Print to FigurePrint to Figure sends a picture of the selected system to a new figure window.Note that this new figure is a MAT
Creating LTI Models2-131 Defining the variable s as a ZPK models = zpk('s')2 Entering the transfer function as a rational expression in s.Fo
14 LTI Viewer Reference14-8Plot Configurations WindowPlot Configuration under the Edit menu opens the Plot Configurationswindow.There are six possible
LTI Viewer Menu Bar14-9SystemsThe Systems menu item has two selections, Refresh and Delete. This figureshows the two options.Refreshupdatesimportedmod
14 LTI Viewer Reference14-10a Click and drag over several variables in the list.b Hold the Control key and click on individual variables.c Hold the Sh
LTI Viewer Menu Bar14-11Setting PreferencesYou can use the “Distinguish by” matrix to specify the line property that willvary throughout the response
14 LTI Viewer Reference14-12Right-Click Menus for SISO SystemsNote Click on items in the right-click menu pictured below for help contents.This right
Right-Click Menus for SISO Systems14-13Plot TypeSelect which plot type you want to display. The LTI Viewer shows a check tomark which plot is currentl
14 LTI Viewer Reference14-14SystemsUse Systems to select which of the imported systems to display. Selecting asystemcauses a check mark to appear besi
Right-Click Menus for SISO Systems14-15Step ResponseStep plots the model’s response to a step input.You can display the following types of information
14 LTI Viewer Reference14-16Impulse ResponseImpulse Response plots the model’s response to an impulse.The LTI Viewer can display the following types o
Right-Click Menus for SISO Systems14-17Bode DiagramBode plots the open-loop Bode phase and magnitude diagrams for the model.The LTI Viewer can display
2 LTI Models2-14K = [–1 3;2 0];H = zpk(Z,P,K)creates the two-input/two-output zero-pole-gain modelNotice that you use[] as a place-holder in Z (or P
14 LTI Viewer Reference14-18Bode MagnitudeBode Magnitude plots the Bode magnitude diagram for the model.The LTI Viewer can display thePeak Response, w
Right-Click Menus for SISO Systems14-19Nyquist Diagrams Nyquist plots the Nyquist diagram for the model.The LTI Viewer can display the following types
14 LTI Viewer Reference14-20Nichols ChartsNichols plots the Nichols Chart for the model.The LTI Viewer can display the following types of information
Right-Click Menus for SISO Systems14-21SigmaSigma plots the singular values for the model.The LTI Viewer can display thePeak Response, which is the la
14 LTI Viewer Reference14-22Pole/ZeroPole/Zero plots the poles and zeros of the model with ‘x’ for poles and ‘o’ forzeros. There are noCharacteristics
Right-Click Menus for SISO Systems14-23Out restores the previous appearance of the plot. Note that Out is grey whenyou have reached the limit of zoomi
14 LTI Viewer Reference14-24Right-Click Menus for MIMO and LTI ArraysAll of the menu options described in “Right-Click Menus for SISO Systems”hold whe
Right-Click Menus for MIMO and LTI Arrays14-25Axis GroupingYoucanusseAxisGroupingtochangethe grouping ofplots inyourLTIViewer.This picture shows the m
14 LTI Viewer Reference14-26default, all the I/O pairs are selected. If you click on a button, that I/O pairalone is displayed in the LTI Viewer. The
Status Panel14-27Status PanelThe Status Panel is located at the bottom of the LTI Viewer. It contains usefulinformation about changes you have made to
Creating LTI Models2-15As an illustration, consider the following simple model of an electric motor.where istheangulardisplacementoftherotorand thedri
14 LTI Viewer Reference14-28
15Right-Click Menus forResponse PlotsRight-Click Menus for SISO Systems ...15-4Systems ...15-4Characteristics ...
15 Right-Click Menus for Response Plots15-2All the response plots that the Control System Toolbox creates haveright-clickmenus available. The plots in
15-3- regroup the plots- Select subsets of I/O pairs
15 Right-Click Menus for Response Plots15-4Right-Click Menus for SIXXSO SystemsWhen you create a response plot for a SISO system, you have available a
Right-Click Menus for SIXXSO Systems15-5GridThe Grid command activates a grid appropriate to the plot in the region youselect.initialPeak Responsenich
15 Right-Click Menus for Response Plots15-6ZoomThe Zoom command zooms in and out of the plot region selected.There are four options:•In-X — Zoom in on
Right-Click Menus for SIXXSO Systems15-7For a full description of the Property Editor, see Setting Response PlotProperties online.
15 Right-Click Menus for Response Plots15-8Right-Click Menus for MIMO and LTI ArraysAll of the menu options described in “Right-Click Menus for SIXXSO
Right-Click Menus for MIMO and LTI Arrays15-9•None — By default,thereisnoaxisgrouping.Forexample,ifyoudisplaythestep responses for a 3-input, 2- outpu
2 LTI Models2-16In addition to the A, B, C,andD matrices, the display of state-space modelsincludes state names, input names, and output names. Defaul
15 Right-Click Menus for Response Plots15-10
16Function ReferenceFunctions by Category ...16-3
16 Function Reference16-2This chapter contains detailed descriptions of all Control System Toolboxfunctions. It begins with a list of functions groupe
Functions by Category16-3Functions by Category Table 16-1: LTI ModelsFunction Name DescriptiondrssGenerate random discrete state-space modeldssCreate
16 Function Reference16-4Table 16-2: Model CharacteristicsFunction Name DescriptionclassDisplay model type ('tf', 'zpk', 'ss
Functions by Category16-5padeCompute the Padé approximation of delaysreshapeChange the shape of an LTI arrayresidueProvide partial fraction expansions
16 Function Reference16-6obsvObservability matrixobsvfObservability staircase formss2ssState coordinate transformation.ssbalDiagonal balancing of stat
Functions by Category16-7Table 16-7: Model InterconnectionsFunction Name DescriptionappendAppend models in a block diagonal configurationaugstateAugm
16 Function Reference16-8Table 16-9: Time DelaysFunction Name Descriptiondelay2zConvert delays in discrete-time models or FRD modelspadeCompute the P
Functions by Category16-9nyquistCalculate Nyquist plotsigmaCalculate singular value plotTable 16-11: SISO Feedback DesignFunction Name Descriptionall
Creating LTI Models2-17Frequency Response Data (FRD) Models Insomeinstances, you may only have sampled frequency responsedata, ratherthan a transfer f
16 Function Reference16-10lqryCalculate the LQ-optimal gain with outputweightinglqrdCalculate the discrete LQ gain for continuousmodelskalmanCalculate
acker16-1116ackerPurpose Pole placement design for single-input systemsSyntax k = acker(A,b,p)Description Given the single-input systemand a vectorp o
allmargin16-1216allmarginPurpose Compute all crossover frequencies and corresponding stability marginsSyntax S = allmargin(sys)Description allmargin c
append16-1316appendPurpose Group LTI models by appending their inputs and outputsSyntax sys = append(sys1,sys2,...,sysN)Description append appends the
append16-14Arguments The input arguments sys1,..., sysN can be LTI models of any type. Regularmatrices are also accepted as a representation of static
append16-15 y2 0 0 y3 0 3.00000 d = u1 u2 u3
augstate16-1616augstatePurpose Append the state vector to the output vectorSyntax asys = augstate(sys)Description Given a state-space model sys with e
balreal16-1716balrealPurpose Input/output balancing of state-space realizationsSyntax sysb = balreal(sys)[sysb,g,T,Ti] = balreal(sys)Description sysb
balreal16-18 1.0062e-01 6.8039e-05 1.0055e-05which indicates that the last two states of sysb are weakly coupled tothe inputand output. You can
balreal16-19bode(sys,'-',sysr,'x')Algorithm Consider the modelwith controllability and observability grammians and . The statecoor
2 LTI Models2-18•response is a vector of length Nf of complex frequency response values forthese frequencies.•units is an optional string for the unit
balreal16-20The function balreal computes a particular similarity transformationsuch thatSee [1,2] for details on the algorithm.Limitations The LTI mo
bode16-2116bodePurpose Compute the Bode frequency response of LTI modelsSyntax bode(sys)bode(sys,w)bode(sys1,sys2,...,sysN)bode(sys1,sys2,...,sysN,w)b
bode16-22uses red dashed lines for the first system sys1 and green 'x' markers for thesecond systemsys2.When invoked with left-hand argument
bode16-23by typingg = tf([1 0.1 7.5],[1 0.12 9 0 0]);bode(g)To plot the response on a wider frequency range, for example, from 0.1 to 100rad/sec, type
bode16-24bode(g,'r',gd,'b--')Algorithm For continuous-time systems, bode computes the frequency response byevaluating the transfer
bode16-25where is the sample time. is called the Nyquist frequency.Theequivalent “continuous-time frequency” is thenusedas the -axis variable.Becausei
bodemag16-2616bodemagPurpose Compute the Bode magnitude response of LTI modelsSyntax bodemag(sys)bodemag(sys,{wmin,wmax})bodemag(sys,w)bodemag(sys1,sy
c2d16-2716c2dPurpose Discretize continuous-time systemsSyntax sysd = c2d(sys,Ts)sysd = c2d(sys,Ts,method)[sysd,G] = c2d(sys,Ts,method)Description sysd
c2d16-28Example Consider the systemwith input delay second. To discretize this system using thetriangle approximation with sample time second, typeH =
c2d16-29step(H,'-',Hd,'--')See Also d2c Discrete to continuous conversiond2d Resampling of discrete systems-References [1] Frankli
Creating LTI Models2-19Discrete-Time ModelsCreating discrete-time models is very much like creating continuous-timemodels, except that you must also s
canon16-3016canonPurpose Compute canonical state-space realizationsSyntax csys = canon(sys,'type')[csys,T] = canon(sys,'type')Desc
canon16-31For state-space models sys,[csys,T] = canon(a,b,c,d,'type')also returns the state coordinate transformation T relating the origina
care16-3216carePurpose Solve continuous-time algebraic Riccati equations (CARE)Syntax [X,L,G,rr] = care(A,B,Q)[X,L,G,rr] = care(A,B,Q,R,S,E)[X,L,G,rep
care16-33• The relative residual defined above when the solution exists (success)Alternatively,[X1,X2,L,report] = care(A,B,Q,...,'implicit')
care16-34 -3.4495 -3.5026 1.4495 -1.4370Finally, note that the variable l contains the closed-loop eigenvalueseig(a-b*g).ll = -3.5026 -1.
care16-35have no eigenvalue on the imaginary axis. Sufficient conditions for this to holdare detectable when and , orSee Also dare Solve discrete-time
chgunits16-3616chgunitsPurpose Convert the frequency units of an FRD modelSyntax sys = chgunits(sys,units) Description sys = chgunits(sys,units) conve
connect16-3716connectPurpose Derive state-space model from block diagram descriptionSyntax sysc = connect(sys,Q,inputs,outputs)Description Complex dyn
connect16-38inputs = [1 2 15]; outputs = [2 7]; The final model sysc has these particular inputs and outputs.Sinceitiseasytomakeamistakeenteringallthe
connect16-39-13.5009 18.0745];D = [-.5476 -.1410-.6459 .2958 ];Define the three blocks as individual LTI models.sys1 = tf(10,[1 5],'inputname&
2 LTI Models2-20By convention, the sample time of continuous-time models is Ts = 0.SettingTs = –1 leaves the sample time of a discrete-time model unsp
connect16-40 d = uc u1 u2 ? ? 0 0 0 0
connect16-41 uc u1 x1 4 0 x2 0 -0.076001 x3
covar16-4216covarPurpose Output and state covariance of a system driven by white noiseSyntax [P,Q] = covar(sys,W)Description covar calculates the stat
covar16-43p =30.3167You can compare this output of covar to simulation results.randn('seed',0)w = sqrt(5)∗randn(1,1000); % 1000 samples% Sim
covar16-44Note that is well defined for nonzero in the discrete case.Limitations The state and output covariances are defined for stable systems only.
ctrb16-4516ctrbPurpose Form the controllability matrixSyntax Co = ctrb(A,B)Co = ctrb(sys)Description ctrb computes the controllability matrix for stat
ctrb16-46Limitations Estimating the rank of the controllability matrix is ill-conditioned; that is, it isvery sensitive to round-off errors and errors
ctrbf16-4716ctrbfPurpose Compute the controllability staircase formSyntax [Abar,Bbar,Cbar,T,k] = ctrbf(A,B,C)[Abar,Bbar,Cbar,T,k] = ctrbf(A,B,C,tol)De
ctrbf16-48B = 1 -1 1 -1C = 1 0 0 1and locate the uncontrollable mode.[Abar,Bbar,Cbar,T,k]=ctrbf(A,B,C)Abar = -3.0000
d2c16-4916d2cPurpose Convert discrete-time LTI models to continuous timeSyntax sysc = d2c(sysd)sysc = d2c(sysd,method)Description d2c converts LTI mod
Creating LTI Models2-21creates the same TF model asH = tf([1 2], [1 0.6 0.9], 0.1);Similarly,z = zpk('z', 0.1);H = [z/(z+0.1)/(z+0.2) ; (z^2
d2c16-50c2d(Hc,0.1,'tustin')gives back the original .Algorithm The 'zoh' conversion is performed in state space and relies on the
d2c16-51c2d(Hc,Ts)yieldingZero/pole/gain: (z+0.5) (z+0.2)-------------------------(z+0.5)^2 (z^2 + z + 0.4) Sampling time: 0.1This discrete model
d2d16-5216d2dPurpose Resample discrete-time LTI models or add input delaysSyntax sys1 = d2d(sys,Ts)Description sys1 = d2d(sys,Ts) resamples the discre
damp16-5316dampPurpose Compute damping factors and natural frequenciesSyntax [Wn,Z] = damp(sys)[Wn,Z,P] = damp(sys)Description damp calculates the dam
damp16-54damp(H)and MATLAB returnsEigenvalue Damping Freq. (rad/s) -1.00e+000
dare16-5516darePurpose Solve discrete-time algebraic Riccati equations (DARE)Syntax [X,L,G,rr] = dare(A,B,Q,R)[X,L,G,rr] = dare(A,B,Q,R,S,E)[X,L,G,rep
dare16-56and L = eig(A-B*G,E).Two additional syntaxes are provided to help develop applications such as-optimal control design.[X,L,G,report] = dare(A
dare16-57References [1] Arnold, W.F., III and A.J. Laub, “Generalized Eigenproblem Algorithmsand Software for Algebraic Riccati Equations,” Proc. IEEE
dcgain16-5816dcgainPurpose Compute low frequency (DC) gain of LTI systemSyntax k = dcgain(sys)Description k = dcgain(sys) computes the DC gain k of th
delay2z16-5916delay2zPurpose Replace delays of discrete-time TF, SS, or ZPK models by poles at z=0, orreplace delays of FRD models by a phase shiftSyn
iiTime Delays ... 2-43Supported Functionality . . . ... 2-43SpecifyingInput/OutputDelays
2 LTI Models2-22clashes with the “descending powers of ”conventionassumedbytf (see“Transfer Function Models” on page 2-8, ortf). For example,h = tf([1
dlqr16-6016dlqrPurpose Design linear-quadratic (LQ) state-feedback regulator for discrete-time plantSyntax [K,S,e] = dlqr(a,b,Q,R)[K,S,e] = dlqr(a,b,Q
dlqr16-61lqr State-feedback LQ regulator for continuous plantlqrd Discrete LQ regulator for continuous plantlqry State-feedback LQ regulator with outp
dlyap16-6216dlyapPurpose Solve discrete-time Lyapunov equationsSyntax X = dlyap(A,Q)Description dlyap solves the discrete-time Lyapunov equationwhere
drss16-6316drssPurpose Generate stable random discrete test modelsSyntax sys = drss(n)sys = drss(n,p)sys = drss(n,p,m)sys = drss(n,p,m,s1,...sn)Descri
drss16-64c = x1 x2 x3 y1 0.22595 0.76037 0 y2 0
dsort16-6516dsortPurpose Sort discrete-time poles by magnitudeSyntax s = dsort(p)[s,ndx] = dsort(p)Description dsort sorts the discrete-time poles con
dss16-6616dssPurpose Specify descriptor state-space modelsSyntax sys = dss(a,b,c,d,e)sys = dss(a,b,c,d,e,Ts)sys = dss(a,b,c,d,e,ltisys)sys = dss(a,b,c
dss16-67sys = dss(1,2,3,4,5,'td',0.1,'inputname','voltage',...'notes','Just an example')creates the
dssdata16-6816dssdataPurpose Quick access to descriptor state-space dataSyntax [a,b,c,d,e] = dssdata(sys)[a,b,c,d,e,Ts] = dssdata(sys)Description [a,b
esort16-6916esortPurpose Sort continuous-time poles by real partSyntax s = esort(p)[s,ndx] = esort(p)Description esort sorts the continuous-time poles
Creating LTI Models2-23Data RetrievalThe functions tf, zpk, ss,andfrd pack the model data and sample time in asingleLTI object.Conversely,thefollowing
esort16-70zero Compute (transmission) zeros
estim16-7116estimPurpose Form state estimator given estimator gainSyntax est = estim(sys,L)est = estim(sys,L,sensors,known)Description est = estim(sys
estim16-72estim handles both continuous- and discrete-time cases. You can use thefunctionsplace (pole placement) or kalman (Kalman filtering) to desig
evalfr16-7316evalfrPurpose Evaluate frequency response at a single (complex) frequencySyntax frsp = evalfr(sys,f)Description frsp = evalfr(sys,f) eval
feedback16-7416feedbackPurpose Feedback connection of two LTI modelsSyntax sys = feedback(sys1,sys2)sys = feedback(sys1,sys2,sign)sys = feedback(sys1,
feedback16-75computes a closed-loop model sys for the more general feedback loop.The vectorfeedin contains indices into the input vector of sys1 and s
feedback16-76Examples Example 1To connect the plantwith the controllerusing negative feedback, typeG = tf([2 5 1],[1 2 3],'inputname','
feedback16-77Example 2Consider a state-space plant P with five inputs and four outputs and astate-spacefeedbackcontrollerK withthreeinputsandtwooutput
filt16-7816filtPurpose Specify discrete transfer functions in DSP formatSyntax sys = filt(num,den)sys = filt(num,den,Ts)sys = filt(M)sys = filt(num,de
filt16-79MIMO transfer functions are regarded as arrays of SISO transfer functions(one per I/O channel), each of which is characterized by its numerat
2 LTI Models2-24 1 2 10Note that the same result is obtained usingH.num{1,1}, H.den{1,1}See“DirectPropertyReferencing”on page2-31formoreinf
frd16-8016frdPurpose Create a frequency response data (FRD) object or convert another model typeto an FRD modelSyntax sys = frd(response,frequency)sys
frd16-81sysfrd = frd(sys,frequency,'Units',units)convertsanFRDmodelfrom aTF, SS, or ZPK model while specifying the units forfrequency to be
frd16-82tf Create transfer functionszpk Create zero-pole-gain models
frdata16-8316frdataPurpose Quick access to data for a frequency response data objectSyntax [response,freq] = frdata(sys)[response,freq,Ts] = frdata(sy
frdata16-84 2.4359 - 4.3665ifreq = 10 100See Also frd Create or convert to FRD modelsget Get the properties for an LTI modelset Set model prope
freqresp16-8516freqrespPurpose Compute frequency response over grid of frequenciesSyntax H = freqresp(sys,w)Description H = freqresp(sys,w) computes t
freqresp16-86at the frequencies . Typew = [1 10 100]H = freqresp(P,w)H(:,:,1) = 0 0.5000- 0.5000i -0.2000+ 0.6000i 1.0000
freqresp16-87Algorithm For transfer functions or zero-pole-gain models, freqresp evaluates thenumerator(s) and denominator(s) at the specified frequen
gensig16-8816gensigPurpose Generate test input signals for lsimSyntax [u,t] = gensig(type,tau)[u,t] = gensig(type,tau,Tf,Ts)Description [u,t] = gensig
gensig16-89axis([0 30 -1 2])See Also lsim Simulate response to arbitrary inputs0 5 10 15 20 25 30−1−0.500.511.52
LTI Properties2-25LTI PropertiesThe previous section shows how to create LTI objects that encapsulate themodel data and sample time. You also have the
get16-9016getPurpose Access/query LTI property valuesSyntax Value = get(sys,'PropertyName')get(sys)Struct = get(sys)Description Value = get(
get16-91 Notes = {} UserData = 'hello'or query only about the numerator and sample time values byget(h,'num')ans =
gram16-9216gramPurpose Compute controllability and observability state-spacemodels:descriptor;state-space models:quick data retrievalgrammiansSyntax W
gram16-93to compute the grammians of a continuous or discrete system. The LTI modelsys must be in state-space form.Algorithm The controllability gramm
hasdelay16-9416hasdelayPurpose Test if an LTI model has time delaysSyntax hasdelay(sys)Description hasdelay(sys) returns 1 (true) if the LTI model sys
impulse16-9516impulsePurpose Compute the impulse response of LTI modelsSyntax impulse(sys)impulse(sys,t)impulse(sys1,sys2,...,sysN)impulse(sys1,sys2,.
impulse16-96As with bode or plot, you can specify a particular color, linestyle, and/ormarker for each system, for example,impulse(sys1,'y:'
impulse16-97sys = ss(a,b,c,0);impulse(sys)The left plot shows the impulse response of the first input channel, and theright plot shows the impulse res
impulse16-98Algorithm Continuous-time models are first converted to state space. The impulseresponse of a single-input state-space modelis equivalent
initial16-9916initialPurpose Compute the initial condition response of state-space modelsSyntax initial(sys,x0)initial(sys,x0,t)initial(sys1,sys2,...,
2 LTI Models2-26ThesampletimepropertyTs keeps track of the sample time (in seconds) ofdiscrete-time systems. By convention,Ts is 0 (zero) for continuo
initial16-100initial(sys1,sys2,...,sysN,x0) initial(sys1,sys2,...,sysN,x0,t)(see impulse for details).When invoked with lefthand arguments,[y,t,x] = i
initial16-101initial(sys,x0)See Also impulse Impulse responselsim Simulate response to arbitrary inputsltiview LTIsystemviewerstep Step response
interp16-10216interpPurpose Interpolate an FRD model between frequency pointsSyntax isys = interp(sys,freqs) interpolates the frequency response datac
inv16-10316invPurpose Invert LTI systemsSyntax isys = inv(sys)Description inv inverts the input/output relationto produce the LTI system with the tran
inv16-104H * Hiis the identity transfer function (static gain I).Limitations Do not use inv to model feedback connections such asWhile it seems reason
isct, isdt16-10516isct, isdtPurpose Determine whether an LTI model is continuous or discreteSyntax boo = isct(sys)boo = isdt(sys)Description boo = isc
isempty16-10616isemptyPurpose Test if an LTI model is emptySyntax boo = isempty(sys)Description isempty(sys) returns 1 (true) if the LTI model sys has
isproper16-10716isproperPurpose Test if an LTI model is properSyntax boo = isproper(sys)Description isproper(sys) returns 1 (true) if the LTI model sy
issiso16-10816issisoPurpose Test if an LTI model is single-input/single-output (SISO)Syntax boo = issiso(sys)Description issiso(sys) returns 1 (true)
kalman16-10916kalmanPurpose Design continuous- or discrete-time Kalman estimatorSyntax [kest,L,P] = kalman(sys,Qn,Rn,Nn)[kest,L,P,M,Z] = kalman(sys,Qn
LTI Properties2-27following four tables. The property values differ for LTI arrays. See set formore information on these values.Table 2-5: TF-Specifi
kalman16-110the output and state estimates and . Note that estimates the true plantoutputDiscrete-Time EstimationGiven the discrete plantand the noise
kalman16-111andgeneratesoptimal“current”outputandstateestimates andusing all available measurements including . The gain matrices andare derived by so
kalman16-112for more general plants sys where the known inputs and stochastic inputsare mixed together, and not all outputs are measured. The index ve
kalmd16-11316kalmdPurpose Design discrete Kalman estimator for continuous plantSyntax [kest,L,P,M,Z] = kalmd(sys,Qn,Rn,Ts)Description kalmd designs a
kalmd16-114lqgreg Assemble LQG regulatorlqrd Discrete LQ-optimal gain for continuous plant References [1]Franklin, G.F.,J.D.Powell, and M.L. Workman,
lft16-11516lftPurpose Redheffer star product (linear fractional transformation) of two LTI modelsSyntax sys = lft(sys1,sys2)sys = lft(sys1,sys2,nu,ny)
lft16-116produces:• The lower LFT ofsys1 and sys2 if sys2 has fewer inputs and outputs thansys1. This amounts to deleting and in the above diagram.• T
lqgreg16-11716lqgregPurpose Form LQG regulator given state-feedback gain and Kalman estimatorSyntax rlqg = lqgreg(kest,k)rlqg = lqgreg(kest,k,'cu
lqgreg16-118In discrete time, you can form the LQG regulator using either the predictionof basedonmeasurementsup to , or thecurrentstateestimate based
lqgreg16-119• Discrete regulator for continuous plant: use lqrd and kalmd.In discrete time,lqgreg produces the regulatorbydefault(see“Description”).To
2 LTI Models2-28Most of these properties are dedicated to storing the model data. Note that thematrix is set to[] (the empty matrix) for standard stat
lqgreg16-120See Also kalman Kalman estimator designkalmd Discrete Kalman estimator for continuous plantlqr, dlqr State-feedback LQ regulatorlqrd Discr
lqr16-12116lqrPurpose Design linear-quadratic (LQ) state-feedback regulator for continuous plantSyntax [K,S,e] = lqr(A,B,Q,R)[K,S,e] = lqr(A,B,Q,R,N)D
lqrd16-12216lqrdPurpose Design discrete LQ regulator for continuous plantSyntax [Kd,S,e] = lqrd(A,B,Q,R,Ts)[Kd,S,e] = lqrd(A,B,Q,R,N,Ts)Description lq
lqrd16-123the discretized plant has equationsand the weighting matrices for the equivalent discrete cost function areThe integrals are computed using
lqry16-12416lqryPurpose Linear-quadratic (LQ) state-feedback regulator with output weightingSyntax [K,S,e] = lqry(sys,Q,R)[K,S,e] = lqry(sys,Q,R,N)Des
lsim16-12516lsimPurpose Simulate LTI model response to arbitrary inputsSyntax lsim(sys,u,t)lsim(sys,u,t,x0)lsim(sys,u,t,x0,'zoh')lsim(sys,u,
lsim16-126linear interpolation). By default, lsim selects the interpolation methodautomatically based on the smoothness of the signal U.Finally,lsim(s
lsim16-127H = [tf([2 5 1],[1 2 3]) ; tf([1 -1],[1 1 5])]lsim(H,u,t)Algorithm Discrete-time systems are simulated with ltitr (state space) or filter(tr
lsim16-128w2 = 62.83^2h = tf(w2,[1 2 w2])t = 0:0.1:5; % vector of time samplesu = (rem(t,1)>=0.5); % square wave valueslsim(h,u,t)lsimevaluates th
lsim16-129lsim(hd,us,ts)This response exhibits strong oscillatory behavior hidden from theundersampled version.See Also gensig Generate test input sig
LTI Properties2-29The function set for LTI objects follows the same syntax as its HandleGraphics counterpart. Specifically, each property is updated b
ltimodels16-13016ltimodelsPurpose Help on LTI modelsSyntax ltimodelsltimodels(modeltype)Description ltimodels displays general information on the vari
ltiprops16-13116ltipropsPurpose Help on LTI model propertiesSyntax ltimodelsltimodels(modeltype)Description ltiprops displays details on the generic p
ltiview16-13216ltiviewPurpose Initialize an LTI Viewer for LTI system response analysisSyntax ltiview ltiview(sys1,sys2,...,sysn)ltiview('plottyp
ltiview16-133ltiview(plottype,sys,extras) allows the additional input argumentssupported by the various LTI model response functions to be passed to t
ltiview16-134nichols Nichols responsenyquist Nyquist responsepzmap Pole/zero mapsigma Singular value responsestep Step response
lyap16-13516lyapPurpose Solve continuous-time Lyapunov equationsSyntax X = lyap(A,Q)X = lyap(A,B,C)Description lyap solves the special and general for
lyap16-136 References [1] Bartels, R.H. and G.W. Stewart, “Solution of the Matrix Equation AX + XB=C,”Comm. of the ACM, Vol. 15, No. 9, 1972.[2]Bryson
margin16-13716marginPurpose Compute gain and phase margins and associated crossover frequenciesSyntax [Gm,Pm,Wcg,Wcp] = margin(sys)[Gm,Pm,Wcg,Wcp] = m
margin16-138Example You can compute the gain and phase margins of the open-loop discrete-timetransfer function. Typehd = tf([0.04798 0.0464],[1 -1.81
margin16-139margin(hd)Algorithm The phase margin is computed using theory, and the gain margin bysolving for the frequency .See Also bode Bode frequen
2 LTI Models2-30Finally, you can also use the set command to obtain a listing of all settableproperties for a given LTI model type, along with valid v
minreal16-14016minrealPurpose Minimal realization or pole-zero cancellationSyntax sysr = minreal(sys)sysr = minreal(sys,tol)[sysr,u] = minreal(sys,tol
minreal16-141Algorithm Pole-zero cancellation is a straightforward search through the poles and zeroslooking for matches that are within tolerance. Tr
modred16-14216modredPurpose Model order reductionSyntax rsys = modred(sys,elim)rsys = modred(sys,elim,'mdc')rsys = modred(sys,elim,'del
modred16-143The last three diagonal entries of the balanced grammians are small, soeliminate the last three states withmodred using both matched DC ga
modred16-144step(h,'-',hmdc,'-.',hdel,'--')While hdel accurately reflects the transient behavior, only hmdc gives the tr
modred16-145Next, the derivative of is set to zero and the resulting equation is solved for. The reduced-order model is given byThe discrete-time case
ndims16-14616ndimsPurpose Provide the number of the dimensions of an LTI model or LTI arraySyntax n = ndims(sys)Description n = ndims(sys) is the numb
ngrid16-14716ngridPurpose Superimpose a Nichols chart on a Nichols plotSyntax ngridDescription ngrid superimposes Nichols chart grid lines over the Ni
ngrid16-148ngridSee Also nichols Nichols plots
nichols16-14916nicholsPurpose Compute Nichols frequency response of LTI modelsSyntax nichols(sys)nichols(sys,w)nichols(sys1,sys2,...,sysN)nichols(sys1
LTI Properties2-31To display all of the properties of an LTI model sys (and their values), use thesyntaxget(sys). In this example,get(h)producesnum =
nichols16-150[mag,phase,w] = nichols(sys)[mag,phase] = nichols(sys,w)return the magnitude and phase (in degrees) of the frequency response at thefrequ
nichols16-151The right-click menu for Nichols plots includes the Tight option under Zoom.You can use this to clip unbounded branches of the Nichols pl
norm16-15216normPurpose Compute LTI model normsSyntax norm(sys)norm(sys,2)norm(sys,inf)norm(sys,inf,tol)[ninf,fpeak] = norm(sys)Description norm compu
norm16-153Usage norm(sys) or norm(sys,2) both return the norm of the TF, SS, or ZPKmodelsys. This norm is infinite in the following cases:•sys is unst
norm16-154ninf = 2.5488 fpeak = 3.0844These values are confirmed by the Bode plot of .bode(H)The gain indeed peaks at approximately 3 rad/sec an
norm16-155 8.1268Algorithm norm uses the same algorithm as covar for the norm, and the algorithm of[1] for the infinity norm.sys is first converted
nyquist16-15616nyquistPurpose Compute Nyquist frequency response of LTI modelsSyntax nyquist(sys)nyquist(sys,w)nyquist(sys1,sys2,...,sysN)nyquist(sys1
nyquist16-157[re,im,w] = nyquist(sys)[re,im] = nyquist(sys,w)return the real and imaginary parts of the frequency response at thefrequenciesw (in rad/
nyquist16-158nyquist(H)You have two zoom options available from the right-click menu that applyspecifically to Nyquist plots:•Tight —Clipsunbounded br
nyquist16-159Also, click anywhere on the curve toactivate data markers that displaytherealand imaginary values at a given frequency. This figure shows
iiiTustinwithFrequencyPrewarping ... 3-23MatchedPolesandZeros... 3-23DiscretizationofSystemswithDelays ..
2 LTI Models2-32sys = ss(1,2,3,4,'InputName','u');sys.aand you get the value of the property “a” for the state-space model sys.ans
obsv16-16016obsvPurpose Form the observability matrixSyntax Ob = obsv(A,B)Ob = obsv(sys)Description obsv computes the observability matrix for state-s
obsv16-161MATLAB responds withunob = 0See Also obsvf Compute the observability staircase form
obsvf16-16216obsvfPurpose Compute the observability staircase formSyntax [Abar,Bbar,Cbar,T,k] = obsvf(A,B,C)[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C,tol)Des
obsvf16-163 1 -1 1 -1C = 1 0 0 1by typing[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C)Abar = 1 1 4 -2Bbar = 1
ord216-16416ord2Purpose Generate continuous second-order systemsSyntax [A,B,C,D] = ord2(wn,z)[num,den] = ord2(wn,z)Description [A,B,C,D] = ord2(wn,z)
pade16-16516padePurpose Compute the Padé approximation of models with time delaysSyntax [num,den] = pade(T,N)pade(T,N)sysx = pade(sys,N)sysx = pade(sy
pade16-166You can use scalar values to specify uniform approximation orders, and [] ifthere are no input, output, or I/O delays.Example Compute a thir
pade16-167delay2z Changestransferfunctionsof discrete-timeLTImodelswithdelaystorationalfunctionsorabsorbsFRDdelaysinto the frequency response phase in
parallel16-16816parallelPurpose Parallel connection of two LTI modelsSyntax sys = parallel(sys1,sys2)sys = parallel(sys1,sys2,inp1,inp2,out1,out2)Desc
parallel16-169sys = parallel(sys1,sys2,inp1,inp2,out1,out2) forms the more generalparallel connection.The index vectorsinp1 and inp2 specify which inp
LTI Properties2-33Properties” on page 2-25. For detailed information on the use of InputDelay, OutputDelay,andioDelay, see “Time Delays” on page 2-43.
place16-17016placePurpose Pole placement designSyntax K = place(A,B,p)[K,prec,message] = place(A,B,p)Description Given the single- or multi-input syst
place16-171Algorithm place uses the algorithm of [1] which, for multi-input systems, optimizes thechoice of eigenvectors for a robust solution. We rec
pole16-17216polePurpose Compute the poles of an LTI systemSyntax p = pole(sys)Description pole computes the poles p of the SISO or MIMO LTI model sys.
pzmap16-17316pzmapPurpose Compute the pole-zero map of an LTI modelSyntax pzmap(sys)pzmap(sys1,sys2,...,sysN)[p,z] = pzmap(sys)Description pzmap(sys)
pzmap16-174pzmap(H)Algorithm pzmap uses a combination of pole and zero.See Also damp Damping and natural frequency of system polesesort, dsort Sort sy
reg16-17516regPurpose Form regulator given state-feedback and estimator gainsSyntax rsys = reg(sys,K,L)rsys = reg(sys,K,L,sensors,known,controls)Descr
reg16-176This regulator should be connected to the plant using positive feedback.rsys = reg(sys,K,L,sensors,known,controls) handles more generalregula
reg16-177Example Given a continuous-time state-space modelsys = ss(A,B,C,D) with seven outputs and four inputs, suppose you have designed:• A state-fe
reshape16-17816reshapePurpose Change the shape of an LTI arraySyntax sys = reshape(sys,s1,s2,...,sk)sys = reshape(sys,[s1 s2 ... sk])Description sys =
rlocus16-17916rlocusPurpose Evans root locusSyntax rlocus(sys)rlocus(sys,k)rlocus(sys1,sys2,...)[r,k] = rlocus(sys)r = rlocus(sys,k)Description rlocus
2 LTI Models2-34Sampling time: unspecifiedThe same result is obtained by using the Variable property.h = tf(1,[1 –1],'var','z')In
rlocus16-180the closed-loop poles are the roots ofrlocus adaptively selects a set of positive gains to produce a smooth plot.Alternatively,rlocus(sys,
rlocus16-181rlocus(h)Youcanusetheright-clickmenuforrlocustoaddgridlines,zoominorout,and invoke the Property Editor to customize the plot. Also, click
rss16-18216rssPurpose Generate stable random continuous test modelsSyntax sys = rss(n)sys = rss(n,p)sys = rss(n,p,m)sys = rss(n,p,m,s1,...,sn)Descript
rss16-183 d = u1 u2 y1 -0.87631 -0.32758 y2 0 0 Continuous-time s
series16-18416seriesPurpose Series connection of two LTI modelsSyntax sys = series(sys1,sys2)sys = series(sys1,sys2,outputs1,inputs2)Description serie
series16-185Theindexvectorsoutputs1andinputs2 indicate which outputs of sys1 andwhich inputs ofsys2 should be connected. The resulting model sys hasas
set16-18616setPurpose Set or modify LTI model propertiesSyntax set(sys,'Property',Value)set(sys,'Property1',Value1,'Property2
set16-187get(sys)a = 1 b = 2 c = 3 d = 0 e = [] Nx = 1 StateName = {''} Ts = 0 Input
set16-188Table 16-17: LTI PropertiesProperty Name Admissible Property ValuesTs•0 (zero) for continuous-time systems•Sample time in seconds for discre
set16-189OutputDelayOutput delays specified with•Nonnegative real numbers for continuous-time models (seconds)•Integers for discrete-time models (numb
LTI Properties2-35Input Names and Output NamesYou can use the InputName and OutputName properties (in short, I/O names) toassign names to any or all o
set16-190a, b, c, d, eReal-valued state-space matrices (multidimensional arrays, in the case ofLTI arrays) with compatible dimensions for the number o
set16-191Remark For discrete-time transfer functions, the convention used to represent thenumerator anddenominatordependson the choice of variable (se
set16-192However, if you change the Variable to 'z^-1' (or 'q')byset(h,'Variable','z^-1'),the same commandset(
sgrid16-19316sgridPurpose Generate an s-plane grid of constant damping factors and natural frequenciesSyntax sgridsgrid(z,wn)Description sgrid generat
sgrid16-194See Also pzmap Plot pole-zero maprlocus Plot root locuszgrid Generate z-plane grid lines
sigma16-19516sigmaPurpose Singular values of the frequency response of LTI modelsSyntax sigma(sys)sigma(sys,w)sigma(sys,w,type)sigma(sys1,sys2,...,sys
sigma16-196w = {wmin,wmax}. To use particular frequency points, set w to thecorresponding vector of frequencies. Uselogspace to generate logarithmical
sigma16-197Example Plot the singular value responses ofand .You can do this by typingH = [0 tf([3 0],[1 1 10]) ; tf([1 1],[1 5]) tf(2,[1 6])]subplot(2
sigma16-198sigma(H,[],2)Algorithm sigma uses the svd function in MATLAB to compute the singular values of acomplex matrix.See Also bode Bode plotevalf
sisotool16-19916sisotoolPurpose Initialize the SISO Design ToolSyntax sisotoolsisotool(plant)sisotool(plant,comp)sisotool(views)sisotool(views,plant,c
2 LTI Models2-36s + 2----- sTo leave certain names undefined, use the empty string '' as inH = tf(num,den,'inputname',{ 'tem
sisotool16-200This picture shows the SISO Design Tool.sisotool(plant) opens the SISO Design Tool with plant imported. If yourplant is any SISO LTI obj
sisotool16-201For example sisotool('bode')opens a SISO Design Tool with only the Bode Diagrams on.sisotool(plant,comp,options) allows
size16-20216sizePurpose Provide the output/input/array dimensions of LTI models, the model order ofTF, SS, and ZPK models, and the number of frequenci
size16-203size(sys)3x1 array of state-space modelsEach model has 3 outputs, 2 inputs, and 5 states.See Also isempty Test if LTI model is emptyissiso T
sminreal16-20416sminrealPurpose Perform model reduction based on structureSyntax msys = sminreal(sys)Description msys = sminreal(sys) eliminates the s
sminreal16-205all of the states of sys, including those of sys2 are retained. To eliminate theunobservable states fromsys2, while retaining the states
ss16-20616ssPurpose Specify state-space models or convert an LTI model to state spaceSyntax sys = ss(a,b,c,d)sys = ss(a,b,c,d,Ts)sys = ss(d)sys = ss(a
ss16-207with sample time Ts (in seconds). Set Ts = -1 or Ts = [] to leave the sampletime unspecified.sys = ss(d) specifies a static gain matrix and is
ss16-208sys = ss(A,B,C,D,0.05,'statename',{'position' 'velocity'},...'inputname','force',...'no
ss16-209See Also dss Specify descriptor state-space models.frd Specify FRD models or convert to an FRD.get Get properties of LTI models.set Set proper
LTI Properties2-37c = x1 y1 1.1909 y2 1.1892 y3 0 d =
ss2ss16-21016ss2ssPurpose State coordinate transformation for state-space modelsSyntax sysT = ss2ss(sys,T)Description Given a state-space model sys wi
ssbal16-21116ssbalPurpose Balance state-space models using a diagonal similarity transformationSyntax [sysb,T] = ssbal(sys)[sysb,T] = ssbal(sys,condT)
ssbal16-212Balance this model with ssbal by typingssbal(sys)a = x1 x2 x3 x1 1
ssdata16-21316ssdataPurpose Quick access to state-space model dataSyntax [a,b,c,d] = ssdata(sys)[a,b,c,d,Ts] = ssdata(sys)Description [a,b,c,d] = ssda
stack16-21416stackPurpose Build an LTI array by stacking LTI models or LTI arrays along arraydimensions of an LTI arraySyntax sys = stack(arraydim,sys
step16-21516stepPurpose Step response of LTI systemsSyntax step(sys)step(sys,t)step(sys1,sys2,...,sysN)step(sys1,sys2,...,sysN,t)step(sys1,'PlotS
step16-216All systems must have the same number of inputs and outputs but mayotherwise be a mix of continuous- and discrete-time systems. This syntax
step16-217a = [-0.5572 -0.7814;0.7814 0];b = [1 -1;0 2];c = [1.9691 6.4493];sys = ss(a,b,c,0);step(sys)The left plot shows the step response of th
tf16-21816tfPurpose Specify transfer functions or convert LTI model to transfer function formSyntax sys = tf(num,den)sys = tf(num,den,Ts)sys = tf(M)sy
tf16-219If all SISO entries of a MIMO transfer function have the same denominator,you can setden to the row vector representation of this common denom
2 LTI Models2-38In general, to specify M input groups (or output groups), you need an M-by-2cell array organized as follows.Figure 2-2: Two Column Ce
tf16-220• s = tf('s') to specify a TF model using a rational function in the Laplacevariable,s.•z = tf('z',Ts) to specify a TF mod
tf16-221Transfer function from input "current" to output... p + 1 torque: ------------- p^2 + 2 p + 2
tf16-222To do this, typesys = ss([-2 -1;1 -2],[1 1;2 -1],[1 0],[0 1])tf(sys) Transfer function from input 1 to output: s-------------s^2 + 4 s +
tf16-223The polynomials and are then specified by the row vectors[1 0 0] and [1 2 3], respectively. By contrast, DSP engineers prefer to writethis tra
tf16-224See also filt for direct specification of discrete transfer functions using theDSP convention.Note thattf stores data so that the numerator an
tfdata16-22516tfdataPurpose Quick access to transfer function dataSyntax [num,den] = tfdata(sys)[num,den] = tfdata(sys,'v')[num,den,Ts] = tf
tfdata16-226you can extract the numerator and denominator coefficients by typing[num,den] = tfdata(h,'v')num = 0 1 1 den = 1
tfdata16-227tf Specify transfer functionszpkdata Quick access to zero-pole-gain data
totaldelay16-22816totaldelayPurpose Return the total combined I/O delays for an LTI modelSyntax td = totaldelay(sys)Description td = totaldelay(sys) r
zero16-22916zeroPurpose Transmission zeros of LTI modelsSyntax z = zero(sys)[z,gain] = zero(sys)Description zero computes the zeros of SISO systems an
LTI Properties2-39Similarly, you can add or delete channels from an existing input or outputgroup. Recalling thatinput group channelsare stored in the
zgrid16-23016zgridPurpose Generate a z-plane grid of constant damping factors and natural frequenciesSyntax zgridzgrid(z,wn)Description zgrid generate
zgrid16-231To see the z-plane grid on the root locus plot, typerlocus(H)zgridaxis('square')See Also pzmap Plot pole-zero map of LTI systemsr
zpk16-23216zpkPurpose Specify zero-pole-gain models or convert LTI model to zero-pole-gain formSyntax sys = zpk(z,p,k)sys = zpk(z,p,k,Ts)sys = zpk(M)s
zpk16-233• z = zpk('z',Ts) to specify a ZPK model with sample time Ts froma rationaltransfer function of the discrete-time variable,z.Once y
zpk16-234sys = zpk(z,p,k,'Property1',Value1,...,'PropertyN',ValueN)is a shortcut for the following sequence of commands.sys = zpk(
zpk16-235To do this, typez = {[] ; -0.5}p = {0.3 ; [0.1+i 0.1-i]}k = [1 ; 2]H = zpk(z,p,k,-1) % unspecified sample timeExample 2Convert the transfer
zpk16-236 (z+0.3)^2 Sampling time: 0.1Algorithm zpk uses the MATLAB function roots to convert transfer functions and thefunctionszero and pole to co
zpkdata16-23716zpkdataPurpose Quick access to zero-pole-gain dataSyntax [z,p,k] = zpkdata(sys)[z,p,k] = zpkdata(sys,'v')[z,p,k,Ts,Td] = zpkd
zpkdata16-238Zero/pole/gain from input to output... 1 #1: ------- (z-0.3) 2 (z+0.5) #2: ------------------- (z^2 - 0.2z
zpkdata16-239zpk Specify zero-pole-gain models
2 LTI Models2-40Model ConversionThere are four LTI model types you can use with the Control System Toolbox:TF,ZPK,SS,andFRD.Thissectionshowshow toconv
zpkdata16-240
I-1IndexSymbols16-228Aacker 16-11addition of LTI models 3-11scalar 3-12adjoint. See pertranspositionalgebraic loop 16-77append 3-16, 5-28, 16-13array
IndexI-2crossover frequenciesallmargin 16-12margin 16-137ctrb 16-45ctrbf 16-47customizing plots 9-3SISO Design Tool 9-11Dd2c 16-49d2d 3-26, 16-52damp
IndexI-3Tustin method 3-22zero-order hold 3-20dlqr 16-60dlyap 16-62drmodel 16-63drss 16-63dsort 16-65DSP convention 16-78dss 16-66dssdata 16-68dual. S
IndexI-4Ggain 2-11feedthrough 2-27low frequency (DC) 16-58propertyLTI properties gain 2-27state-feedback gain 16-60gain margins 10-28, 16-21gensig 16-
IndexI-5Kalman estimatorcontinuous 10-36current 16-111discrete 10-50, 16-109innovation 16-111steady-state 16-109time-varying 10-57kalmd 16-113LLFT (li
IndexI-6interconnection functions 3-16inversion 3-13model data, accessing 2-23model order reduction 16-142model order reduction (balanced realization)
IndexI-7multiplication 3-13scalar 3-13Nnatural frequency 16-53ndims 16-146ngrid 16-147Nicholschart 16-147plot (nichols) 16-149nichols 16-149noisemeasu
IndexI-8Ppade 16-165Padé approximation (pade) 2-52, 16-165parallel 16-168parallel connection 3-12, 10-54, 16-168pertransposition 3-14phase margins 10-
IndexI-9root locusdesign 10-9, 10-24plot (rlocus) 16-179See also Root Locus Design GUIrss 16-182building an LTI array with 5-12Ssample time 2-19, 2-25
Model Conversion2-41for discrete-time models.Automatic Conversion Some algorithms operate only on one type of LTI model. For example, thealgorithm for
IndexI-10specification 2-14, 16-206ss 2-14, 16-206transfer functions of 2-40step response 16-215subsystem 2-6, 3-5subsystem operations on LTI modelssu
IndexI-11quick data retrieval (zpkdata) 16-237specification 2-12, 16-232static gain 16-233zpk 2-12, 16-232zeros 2-12computing 16-229pole-zero map 16-1
ivBuildingLTIArraysUsingforLoops ... 5-12BuildingLTIArraysUsingthestackFunction ... 5-15BuildingLTIArraysUsingtf,zpk,ss,andf
2 LTI Models2-42ss(tf(sys))may return a model with different state-space matrices, or even a differentnumber of states in the MIMO case. Therefore, if
Time Delays2-43Time DelaysUsing the ioDelay, InputDelay,andOutputDelay properties of LTI objects,you can specify delays in both continuous- and discre
2 LTI Models2-44•Interconnections of continuous-time delay systems as long as the resultingtransfer function from input to output is of the formwhere
Time Delays2-45This creates the LTI model with the following transfer function.Here is the entry ofNote State-space models with I/O delays have only
2 LTI Models2-46Figure 2-3: Distillation ColumnSchematically, the distillation process functions as follows:•Steam flows into the reboiler and vapori
Time Delays2-47Thegoalistomaximize byadjustingtherefluxflowrate andthesteamflow rate in the reboiler.To obtain a linearized model around the steady-st
2 LTI Models2-48Specifying Delays on the Inputs or OutputsWhileidealforfrequency-domainmodelswithI/Odelays,the ioDelay propertyis inadequate to captur
Time Delays2-49You can also use the InputDelay and OutputDelay properties to convenientlyspecify input or output delays in TF, ZPK, or FRD models. For
2 LTI Models2-50Specifying Delays in Discrete-Time ModelsYou can also use the ioDelay, InputDelay,andOutputDelay properties tospecify delays in discre
Time Delays2-51You can specify this model either as the first-order transfer functionwith a delay of two sampling periods on the inputTs = 1; % sampli
vStylePage... 8-3CharacteristicsPage ... 8-4ParametersPage ...
2 LTI Models2-52sys.iodelayget(sys,'inputdelay')•Use the helper function hasdelay to determine if sys has any delay at all.The syntax ishasd
Time Delays2-53To compute a Padé approximation of H(s)using:•A first-order approximation for the 1 second and 3 second delays•A second-order approxima
2 LTI Models2-54Simulink Block for LTI SystemsYou can incorporate LTI objects into Simulink diagrams using the LTI Systemblock shown below.The LTI Sys
Simulink Block for LTI Systems2-55transfer functions or zero-pole-gain models, as it depends on thechoice of statecoordinates used by the realization
2 LTI Models2-56References[1] Dorf, R.C. and R.H. Bishop, Modern Control Systems, Addison-Wesley,Menlo Park, CA, 1998.[2] Wood, R.K. and M.W. Berry, “
3Operations on LTI ModelsPrecedence and Property Inheritance ...3-3Extracting and Modifying Subsystems ...3-5Referencing FRD Models Through
3 Operations on LTI Models3-2You can perform basic matrix operations such as addition, multiplication, orconcatenation on LTI models. Such operations
Precedence and Property Inheritance3-3Precedence and Property InheritanceYou can apply operations to LTI models of different types. The resulting type
3 Operations on LTI Models3-4•In general, when two LTI models sys1 and sys2 are combined usingoperations such as+, *, [,], [;], append,andfeedback,the
Extracting and Modifying Subsystems3-5Extracting and Modifying SubsystemsSubsystems relate subsets of the inputs and outputs of a system. The transfer
vi10Design Case StudiesYaw Damper for a 747 Jet Transport ... 10-3Open-LoopAnalysis ... 10-5RootLocusDe
3 Operations on LTI Models3-6The following rules apply when modifying LTI models:•sys, the LTI model that has had a portion reassigned, retains its or
Extracting and Modifying Subsystems3-7Next reassign to and modify the second input channel of Tby typingT(1,1) = tf(1,[1 0.5]);T(:,2) = [ 1 ; tf(0.4,[
3 Operations on LTI Models3-8sys2.Frequencyans = 1.1000 1.2000displays the second and third entries in the frequency vector.Similarly, you can u
Extracting and Modifying Subsystems3-9You can reference a set of channels by input or output name by using a cellarray of strings for the names. For e
3 Operations on LTI Models3-10adds a second input to the state-space model sys by appending the B and Dmatrices. You should simultaneously modify both
Arithmetic Operations3-11Arithmetic OperationsYou can apply almost all arithmetic operations to LTI models, including thoseshown below.Addition and Su
3 Operations on LTI Models3-12represents the parallel interconnection shown below.Ifsys1 and sys2 are two state-space models with data and, the state-
Arithmetic Operations3-13MultiplicationMultiplication of two LTI models connects them in series. Specifically,sys = sys1 * sys2returns an LTI model sy
3 Operations on LTI Models3-14•Left division sys1\sys2, which is equivalent to inv(sys1)*sys2•Right division sys1/sys2, which is equivalent to sys1*in
Arithmetic Operations3-15pertranspose of , , is the Hermitian transpose of thefrequency response of : .To obtain the Hermitian transpose of the freque
viiSummary ... 11-17References ... 11-1812GUI Reference13SISO Design Too
3 Operations on LTI Models3-16Model Interconnection FunctionsThe Control System Toolbox provides a number of functions to help with themodel building
Model Interconnection Functions3-17sys = append(sys1,sys2)% block diagonal appendingIn I/O terms, horizontal and vertical concatenation have the follo
3 Operations on LTI Models3-18to specify the block-decoupled LTI model interconnection.Seeappend for more information on this function.Feedback and Ot
Model Interconnection Functions3-19is realized withfeedback(sys1,sys2)This specifies the LTI model with m inputs and p outputs whose I/O map isSee the
3 Operations on LTI Models3-20Continuous/Discrete Conversions of LTI ModelsThe function c2d discretizes continuous-time TF, SS, or ZPK models.Converse
Continuous/Discrete Conversions of LTI Models3-21The signal is then fed to the continuous system , and the resultingoutput is sampled every seconds to
3 Operations on LTI Models3-22---------(z+0.5)^2 Sampling time: 0.1First-Order HoldFirst-order hold (FOH) differs from ZOH by the underlying hold mech
Continuous/Discrete Conversions of LTI Models3-23Tustin with Frequency PrewarpingThis variation of the Tustin approximation uses the correspondenceThi
3 Operations on LTI Models3-24using zero-order hold on the input, and a 10 Hz sampling rate, typeh = tf(10,[1 3 10],'inputdelay',0.25);hd =
Continuous/Discrete Conversions of LTI Models3-25step(h,'--',hd,'-')Note The Tustin and matched pole/zero methods are accurate o
Komentáře k této Příručce