Professional Documents
Culture Documents
SIMULINK and
Control System Toolbox
A practical approach
Alberto Cavallo
Roberto Setola
Francesco Vasca
Prentice Hall
London New York Toronto Sydney Tokyo Singapore
Madrid Mexico City Munich
Contents
Introduction
MATLAB
2 Fundamentals
2.1 Keyboard input
2.2 Input from external files
2.3 Utility commands
2.4 Exercises
7
7
9
13
14
15
15
17
18
19
20
21
21
4 Scalar operations
4.1 Arithmetic operations
4.2 Elementary and transcendental functions
4.3 Examples
.
4.4 Logical and relational operators
4.5 Exercises
25
26
26
30
31
32
vi
Contents
35
35
36
37
40
42
50
51
Matrix operations
5.1
5.2
5.3
5.4
5.5
5.6
5.7
Transpose
Algebraic operations
Matrix functions
Logic operations
Complements on matrices
More special matrices
Exercises
Polynomials
6.1
6.2
6.3
58
58
61
63
Basic operations
Interpolation
Exercises
7 Graphics
7.1 2D graphics
7.2 Multiple plots
7.3 Axis scaling
7.4 Complex data
7.5 More 2D graphs
7.6 Plotting more graphs on the same window
7.7 3D graphics
7.8 Functions of two variables
7.9 Color in MATLAB
7.10 Parametric plots
7.11 Revolution surfaces
7.12 Printing graphics
7.13 Exercises
-~
66
66
70
73
73
74
75
76
77
79
83
84
84
87
8 Programming in MATLAB
8.1 Basic programming structures
8.2 Script files
8.3 Functions
8.4 Debugging programs
8.5 Exercises
91
91
93
94
99
103
9 Numeric analysis
9.1 Infinitesimal analysis
9.2 Nonlinear equations and optimization
9.3 Differential equations
9.4 Exercises
111
112
113
115
117
Contents
II
SIMULINK
vii
121
10 Fundamentals
10.1 Building a SIMULINK scheme
10.2 Analysis of the scheme
10.3 Exercises
123
124
127
129
11 SIMULINK schemes
11.1 Using the mouse
11.2 Structural properties of the blocks
11.3 A nonlinear example
11.4 Sources and sinks
11.5 Some nonlinear blocks
11.6 Exercises
131
131
134
136
139
142
145
12 Simulation in SIMULINK
12.1 Simulation problems
12.2 Integration methods
12.3 System with discontinuities
12.4 Time-varying systems
12.5 Exercises
.'
153
153
157
159
161
163
13 Multi-variable systems
13.1 Multi-variable schemes
13.2 Connections
13.3 An example: a planar manipulator
13.4 Exercises
167
167
170
172
174
14 Group operation
14.1 Using the group option
14.2 Exercises
179
179
182
15 Discrete-time systems
15.1 An example: the repopulation of a lake
15.2 Exercises
185
185
188
16 Hybrid systems
16.1 Hybrid schemes
16.2 Exercises
17 Advanced topics
17.1 System analysis
"
17.2 Using Mask
17.3 Customizing SIMULINK
193
193
196
.^
198
198
203
207
viii
Contents
17.4 Exercises
207
18 Blocks library
18.1
18.2
18.3
18.4
18.5
18.6
18.7
III
Sources
Sinks
"
Discrete
Linear
Nonlinear
Connections
Extras
209
209
213
216
219
222
229
230
235
^
"
278
280
281
283
284
285
237
237
242
247
254
258
261
265
270
'
289
290
292
293
297
300
306
306
310
Contents
23 State feedback
23.1 Feedback gain design
23.2 The observer
23.3 Linear quadratic optimal control
23.4 Kalman
23.5 Separation principle
23.6 Exercises
313
314
315
317
321
324
324
filter-
24 Discrete functions
24.1 Discrete to continuous conversion
24.2 Properties
24.3 Model reduction
24.4 Time domain response
24.5 Frequency domain response
24.6 State feedback design
24.7 Exercises
25 Utility functions
25.1 Modeling
25.2 Time response
25.3 Frequency response
25.4 Lyapunov and Riccati equations
IV
343
343
343
344
345
349
349
353
354
355
358
360
361
361
363
363
376
379
B.I Controls
B.2 Menu
B.3 Using the mouse
S-function
C.I Writing an S-function
C.2 Continuous-time systems
328
328
329
331
331
334
339
340
347
Appendices
A.I
A.2
A.3
A.4
A.5
A.6
A.7
A.8
ix
~vx
386
386
389
Contents
C.3 Discrete-time systems
C.4 Hybrid systems
C.5 Observations
390
391
392
References
393
Index
397