1. Mathematical Modeling ........................................ 1
1.1. Introduction ............................................ 1
1.1.1. Importance of Models ............................. 1
1.2. Derivation of a Mathematical Model ...................... 4
1.3. Difference Equations ................................... 10
1.3.1. Recursive Solutions ............................. 11
1.4. A First Look at Discrete-Time Systems .................. 13
1.4.1. Inherently Discrete-Time Systems ................ 17
1.5. Case Study - Population Dynamics (Single Species) ...... 22
2. Continuous-Time Systems ..................................... 31
2.1. Introduction ........................................... 31
2.2. First-Order Systems .................................... 31
2.2.1. Step Response of First-Order Systems ............ 32
2.3. Second-Order Systems ................................... 38
2.3.1. Conversion of Two First-Order Equations to
a Second-Order Model ............................ 44
2.4. Simulation Diagrams .................................... 48
2.4.1. Systems of Equations ............................ 54
2.5. Higher Order Systems ................................... 58
2.6. State Variables ........................................ 60
2.6.1. Conversion from Linear State Variable Form
to Single Input-Single Output Form .............. 66
2.6.2. General Solution of the State Equations ......... 67
2.7. Nonlinear Systems ...................................... 70
2.7.1. Friction ........................................ 72
2.7.2. Hysterisis ...................................... 74
2.7.3. Sustained Oscillations and Limit Cycles ......... 79
2.8. Case Study - Submarine Depth Control System ............ 86
3. Elementary Numerical Integration ............................ 93
3.1. Introduction ........................................... 93
3.2. Discrete-Time System Approximation of a Continuous-
Time Integrator ........................................ 94
3.3. Euler Integration ...................................... 98
3.3.1. Backward (Implicit) Euler Integration .......... 102
3.4. Trapezoidal Integration ............................... 104
3.5. Numerical Integration of First-Order and Higher
Continuous-Time Systems ............................... 109
3.5.1. Discrete-Time System Models from Simulation
Diagrams ....................................... 110
3.5.2. Nonlinear First-Order Systems .................. 113
3.5.3. Discrete-Time State Equations .................. 117
3.5.4. Discrete-Time State System Matrices ............ 121
3.6. Improvements to Euler Integration ..................... 125
3.6.1. Improved Euler Method .......................... 125
3.6.2. Modified Euler Integration ..................... 129
3.7. Case Study - Vertical Ascent of a Diver ............... 141
3.7.1. Maximum Cable Force for Safe Ascent ............ 147
3.7.1.1. Trial and Error ....................... 147
3.7.1.2. Analytical Solution ................... 148
3.7.2. Diver Ascent with Decompression Stops .......... 149
4. Linear Systems Analysis .................................... 155
4.1. Introduction .......................................... 155
4.2. The Laplace Transform ................................. 155
4.2.1. Properties of the Laplace Transform ............ 156
4.2.2. The Inverse Laplace Transform .................. 163
4.2.3. Laplace Transform of the System Response ....... 164
4.2.4. Partial Fraction Expansion ..................... 165
4.3. The Transfer Function ................................. 172
4.3.1. The Impulse Function ........................... 172
4.3.2. Relationship between Unit Step Function and
Unit Impulse Function .......................... 173
4.3.3. The Impulse Response ........................... 175
4.3.4. Relationship between Impulse Response and
Transfer Function .............................. 179
4.3.5. Systems with Multiple Inputs and Outputs ....... 182
4.3.6. Transformation from State Variable Model
to Transfer Function ........................... 190
4.4. Stability of Linear Time Invariant (LTI)
Continuous-Time Systems ............................... 194
4.4.1. Characteristic Polynomial ...................... 195
4.4.2. A Feedback Control System ...................... 199
4.5. Frequency Response of LTI Continuous-Time Systems ..... 205
4.5.1. Stability of Linear Feedback Control Systems
Based on Frequency Response .................... 215
4.6. The z-Transform ....................................... 220
4.6.1. The Discrete-Time Impulse Function ............. 226
4.6.2. The Inverse z-Transform ........................ 231
4.6.3. Partial Fraction Expansion ..................... 232
4.7. The z-Domain Transfer Function ........................ 240
4.7.1. Nonzero Initial Conditions ..................... 242
4.7.2. Approximating Continuous-Time System Transfer
Functions ...................................... 244
4.7.3. Simulation Diagrams and State Variables ........ 249
4.7.4. Solution of Linear Discrete-Time State
Equations ...................................... 254
4.7.5. Weighting Sequence (Impulse Response
Function) ...................................... 258
4.8. Stability of LTI Discrete-Time Systems ................ 265
4.8.1. Complex Poles of H(z) .......................... 269
4.9. Frequency Response of Discrete-Time Systems ........... 278
4.9.1. Steady-State Sinusoidal Response ............... 278
4.9.2. Properties of the Discrete-Time Frequency
Response Function .............................. 280
4.9.3. The Sampling Theorem ........................... 285
4.9.4. Digital Filters ................................ 291
4.10.The Control System Toolbox ............................ 299
4.10.1.Transfer Function Models ....................... 299
4.10.2.State Space Models ............................. 300
4.10.3.State Space/Transfer Function Conversion ....... 301
4.10.4.System Interconnections ........................ 304
4.10.5.System Response ................................ 306
4.10.6.Continuous-/Discrete-Time System Conversion .... 308
4.10.7.Frequency Response ............................. 310
4.10.8.Root-Locus ..................................... 312
4.11.Case Study - Longitudinal Control of an Aircraft ...... 318
4.11.1.Digital Simulation of Aircraft Longitudinal
Dynamics ....................................... 332
4.11.2.Simulation of State Variable Model ............. 333
4.12.Case Study - Notch Filter for Electrocardiograph
(ECG) Waveform ........................................ 336
4.12.1.Multi-notch Filters ............................ 339
5. Simulink ................................................... 347
5.1. Introduction .......................................... 347
5.2. Building a Simulink Model ............................. 347
5.2.1. The Simulink Library ........................... 348
5.2.2. Running a Simulink Model ....................... 351
5.3. Simulation of Linear Systems .......................... 355
5.3.1. The Trans fer Fen Block ........................ 355
5.3.2. The State-Space Block .......................... 361
5.4. Algebraic Loops ....................................... 370
5.4.1. Eliminating Algebraic Loops .................... 371
5.4.2. Algebraic Equations ............................ 374
5.5. More Simulink Blocks .................................. 378
5.5.1. Hysterisis ..................................... 383
5.6. Subsystems ............................................ 388
5.6.1. PHYSBE ......................................... 389
5.6.2. A Car-Following Subsystem ...................... 390
5.6.3. Subsystem Using Fen Blocks ..................... 393
5.7. Discrete-Time Systems ................................. 397
5.7.1. Simulation of an Inherently Discrete-Time
System ......................................... 397
5.7.2. Discrete-Time Integrator ....................... 400
5.7.3. Centralized Integration ........................ 404
5.7.4. Digital Filters ................................ 406
5.7.5. Discrete-Time Transfer Function ................ 408
5.8. MATLAB/Simulink Interface ............................. 414
5.9. Hybrid Systems - Continuous- and Discrete-Time
Components ............................................ 423
5.10.Monte Carlo Simulation ................................ 427
5.10.1.Monte Carlo Simulation Requiring Solution
of a Mathematical Model ........................ 430
5.11. Case Study - Pilot Ejection .......................... 440
6. Intermediate Numerical Integration ......................... 447
6.1. Introduction .......................................... 447
6.2. Runga-Kutta (RK) (One-Step Methods) ................... 447
6.2.1. The Taylor Series Method ....................... 448
6.2.2. Second-Order Runga-Kutta Method ................ 449
6.2.3. Truncation Errors .............................. 451
6.2.4. High Order Runga-Kutta Methods ................. 456
6.2.5. Linear Systems - Approximate Solutions Using
RK Integration ................................. 457
6.2.6. Continuous-Time Models with Polynomial
Solutions ...................................... 459
6.2.7. Higher Order Systems ........................... 461
6.3. Adaptive Techniques ................................... 471
6.3.1. Repeated RK with Interval Halving .............. 471
6.3.2. Constant Step Size (T = 1 min) ................. 476
6.3.3. Adaptive Step Size (Initial T = 1 min) ......... 476
6.3.4. RK-Fehlberg .................................... 477
6.4. Multistep Methods ..................................... 483
6.4.1. Explicit Methods ............................... 484
6.4.2. Implicit Methods ............................... 486
6.4.3. Predictor-Corrector Methods .................... 490
6.5. Stiff Systems ......................................... 494
6.5.1. Stiffness Property in First-Order System ....... 495
6.5.2. Stiff Second-Order System ...................... 497
6.5.3. Approximating Stiff Systems with Lower Order
Nonstiff System Models ......................... 500
6.6. Lumped Parameter Approximation of Distributed
Parameter Systems ..................................... 518
6.6.1. A Nonlinear Distributed Parameter System ....... 522
6.7. Systems with Discontinuities .......................... 527
6.7.1. Physical Properties and Constant Forces
Acting on the Pendulum Bob ..................... 535
6.8. Case Study - Spread of an Epidemic .................... 545
7. Simulation Tools ........................................... 553
7.1. Introduction .......................................... 553
7.2. Steady-State Solver ................................... 554
7.2.1. The trim Function .............................. 556
7.2.2. Equilibrium Point for a Nonautonomous System ... 557
7.3. Optimization of Simulink Models ....................... 568
7.3.1. The Gradient Vector ............................ 577
7.3.2. Optimizing Multiparameter Objective
Functions Requiring Simulink Models ............ 580
7.3.3. Parameter Identification ....................... 583
7.3.4. Example of a Simple Gradient Search ............ 584
7.3.5. Optimization of Simulink Discrete-Time
System Models .................................. 591
7.4. Linearization ......................................... 602
7.4.1. Deviation Variables ............................ 603
7.4.2. Linearization of Nonlinear Systems in State
Variable Form .................................. 611
7.4.3. The 1 inmod Function ........................... 615
7.4.4. Multiple Linearized Models for a Single
System ......................................... 620
8. Advanced Numerical Integration ............................. 631
8.1. Introduction .......................................... 631
8.2. Dynamic Errors (Characteristic Roots, Transfer
Function) ............................................. 631
8.2.1. Discrete-Time Systems and the Equivalent
Continuous-Time Systems ........................ 632
8.2.2. Characteristic Root Errors ..................... 635
8.2.3. Transfer Function Errors ....................... 645
8.2.4. Asymptotic Formulas for Multistep Integration
Methods ........................................ 651
8.2.5. Simulation of Linear System with Transfer
Function H(s) .................................. 653
8.3. Stability of Numerical Integrators .................... 662
8.3.1. Adams-Bashforth Numerical Integrators .......... 662
8.3.2. Implicit Integrators ........................... 669
8.3.3. Runga-Kutta (RK) Integration ................... 674
8.4. Multirate Integration ................................. 684
8.4.1. Procedure for Updating Slow and Fast States:
Master/Slave = RK-4/RK-4 ....................... 688
8.4.2. Selection of Step Size Based on Stability ...... 689
8.4.3. Selection of Step Size Based on Dynamic
Accuracy ....................................... 690
8.4.4. Analytical Solution for State Variables ........ 694
8.4.5. Multirate Integration of Aircraft Pitch
Control System ................................. 695
8.4.6. A Nonlinear Dual Speed Second-Order System ..... 698
8.4.7. Multirate Simulation of Two-Tank System ........ 706
8.4.8. Simulation Tradeoffs with Multirate
Integration .................................... 707
8.5. Real-Time Simulation .................................. 712
8.5.1. Numerical Integration Methods Compatible
with Real-Time Operation ....................... 715
8.5.2. RK-1 (Explicit Euler) .......................... 716
8.5.3. RK-2 (Improved Euler) .......................... 717
8.5.4. RK-2 (Modified Euler) .......................... 717
8.5.5. RK-3 (Real-Time Incompatible) .................. 717
8.5.6. RK-3 (Real-Time Compatible) .................... 718
8.5.7. RK-4 (Real-Time Incompatible) .................. 718
8.5.8. Multistep Integration Methods .................. 718
8.5.9. Stability of Real-Time Predictor-Corrector
Method ......................................... 720
8.5.10.Extrapolation of Real-Time Inputs .............. 723
8.5.11.An Alternate Approach to Real-Time
Compatibility - Input Delay .................... 728
8.6. Additional Methods of Approximating Continuous-Time
System Models ......................................... 736
8.6.1. Sampling and Signal Reconstruction ............. 736
8.6.2. First-Order Hold Signal Reconstruction ......... 741
8.6.3. Matched Pole-Zero Method ....................... 741
8.6.4. Bilinear Transform with Prewarping ............. 744
References .................................................... 751
Index ......................................................... 755
|