632
.. .. B. Wayne Bequette Process Dynamics Modeling, Analysis, and Simulation Prentice Hall International Series in the Physical and Chemical Engineering Sciences

Modeling analysis and_simulation

Embed Size (px)

Citation preview

  • 1. .... B. Wayne BequetteProcess DynamicsModeling,Analysis,andSimulationPrentice Hall International Seriesin the Physical and ChemicalEngineering Sciences

2. PRENTICE IIALL INTERNATIONAL SERIESIN THE PHYSICAL AND CHEMICAL ENGINEERING SCIENCESNEAL R. !ilUNDSON, SE!{IES liDITOR, Un/verst!.' t?!1foIlS!OflAnVISORY E1JJTORSAN[)J{l~AS ACRIVOS, S{(l!!(oI'r! Unil-'ersifyJOHN DMII,ER, University (d'IVlillllesO{{/H. SC'(rlT FOGIJ]{, Unil'CI"sity (~rMichigan'T'1l0MAS J. IIANKATTY, University (?( fllil/oi,'JOHN M. P[~AUSN[TZ, Univcrsily (?FCa!i;(omiaL. E::. SCRIVEN, University 1?(Minl/csotaBiLZlllSER, S;:-'IUEJ.S, Mm 1-::l.uASSEN Chemical !'.lIgilleaing ThennodYl/tllllicsBr',QUFTrl:: Process Oynamics: A1odcling, Analysis, and Simulatio/lBWUU.:R, CiROSS-iNN, AND WESTERBERG Sy.l"tcmafh' iHethods rd' Chemica! Process J)esij{11CROWL and 1,()(JVA1{ Chemica! Process Sq(etyDFNN Process' Fl/lid lvlec!wlI/c"S[;'OGLER {:lemcfI!s q(Cllcmical Rcaction Engineering, 2nd I~'ditionHANNA AND SANDA[J COll/putatiolla! Methods ill ChclIIical EngineeringI-IJ~IMI~LBLAU Basic Principles {{lid C(llcl/larions ill Chemical Engincering, 6th editiollHINES i!>il) MADDOX Mass Tnl/lsjt'rKYLE Chemical and Proces..,. '1henllodyl1amics, 2nd editionNEWMAN Efectmchc/Ilical Systcms, 2nd editionPR;tJSNll/., LICIITFNTI-lMJ',R, and DL A/.l'VEDO Molecular Thermodynamics(~rFlllid-PIUlse Eqlli/ihria, 2nd cditionPHrNTlC:E Elec!rochcmical Ellgincering PrinciplesSTEPHANOI'OULOS Chemical Process COlltrolTI~STER AND MOllF.!J. Thermodynamics (lnd Its /pplicatio/ls, 3rd editionTURTON Analysis, SrI/thesis, and Design (~rChell/iCflI Processes 3. PROCESS DYNAMICSModeling, Analysis, and SimulationB. Wayne BequetteRensselaer Polytechnic InstituteTo join a Prentice Hall PTR Internet mailing list, point to:http://www.prenhall.com/maiUists/Prentice Hall PTRUpper Saddle River, New Jersey 07458 4. 97 36053elPLibrary of Congl'l'ss Catalogil1g~il1-PllblicatitmDataBequette, B, Wayne.Process dynamics: modeling, analysis, and simulation / B, WayneBequette.p. ern.Includes bibliographical references and index,ISBN O,-11-206889~31. Chemical procc%es. I. Tille.TPI55,7.B45 1998(j6()',2X4'OI185---dc21Acquisitions editor: Bernard M. CoodwinCover design direcloc Jerry VottaManufacturing manager: Alexis R. Heydtlvlilfketing Jnanllger: tvli1es WilliamsCompositor/Production services: Pinc Tree Composition, Inc.(D 1998 by Prentice Hall PTRPrentice-Hall, Inc.A Simon & Schuster CompanyUpper S,ddc River, Nnv Jersey 07458 .Prentice Hall books arc widely"used by corporations anugovel'lllllent agencies for training, marketing, and resale.The publisherofkrs discoullts on this hook when orderedin bulk quantities. For more information contact:Corporate Sales DepartmentPhone: 800-382-3419Pax: 201-236-7141E-mail: [email protected] write:Prentice I-fall PTRCorp. Sales DeptOne Lake SircetUpper Saddle Rivcr, New Jersey 07458AI! rights reserved. Nl.J part of this book mily be rcpf(l(luced, ill any forlllor by any means, without permission in writing from the publisher.Printed in the United St,l!cs of Alllerica10 9 8 7 6 5 4 J 2ISBN: 0-13-206889-3Prentice-Hall Intcrnational (UK) Limited, LOlldollPrcnticc-Hall oj" Australia Ply. Limited, SydlleyPrenlice-Hall Canada Inc.. TorontoPrcntiee--Flall HispanOimlcricana, 5.A., MexicoPrentice-Hall of India Private Limited. N(', IJdhiPrenlice-Hall of Japan, Inc" lilkyoSimon & Schuster Asia Pte. Ltd., SingaporeEditora Prcnticc--Hall do Brasil. LtdH., Rio de .falleiro 5. CONTENTSPreface XVIISECTION I PROCESS MODELING 11 Introduction 31.1 Motivation 31.2 Models 41.2.1 How Models Are Used 51.3 Systems 101.3.1 Simulation 101.3.2 Linear Systems Analysis 111.3.3 A Broader View of Analysis 111.4 Background of the Reader 121.5 How To Use This Textbook 121.5.1 Sections 121.5.2 Numerical Solutions 131.5.3 Motivating Examples and Modules 131.6 Courses Where This Textbook Can Be Used 13Summary 14Further Reading 14Student Exercises 15vii 6. viii2 Process Modeling 162.1 Background 172.2 Balance Equations 172.2.1 Integral Balances 182.2.2 Instantaneous Balances 202.3 Material Balances 202.3.1 Simplifying Assumptions 252.4 Constitutive Relationships 272.4.1 Gas Law 272.4.2 Chemical Reactions 272.4.3 Equilibrium Relationships 282.4.4 Flow-through Valves 292.5 Material and Energy Balances 302.5.1 Review of Thermodynamics 312.6 Distributes Parameter Systems 342.7 Dimensionless Models 352.8 Explicit Solutions to Dynamic Models 362.9 General Form of Dynamic Models 372.9.1 State Variables 372.9.2 Input Variables2.9.3 Parameters 382.9.4 Vector Notation 38Summary 40Further Reading 40Student Exercises 41SECTION II NUMERICAL TECHNIQUES 493 Algebraic Equations 513.1 Notations 513.2 General Form for a linear System of Equations 513.3 Nonlinear Functions of a Single Variable 543.3.1 Convergence Tolerance 553.3.2 Direct Substitution 553.3.3 Interval Halving (Bisection) 583.3.4 False Position (Reguli Falsi) 603.3.5 Newton's Method (or Newton-Raphson) 603.4 MATLAB Routines for Solving Functions of a Single Variable 633.4.1 fzero 633.4.2 roots 643.5 Multivariable Systems 643.5.1 Newton's Method for Multivariable Problems 663.5.2 Quasi-Newton Methods 69Contents 7. Contents3.6 MATlAB Routines for Systems of Nonlinear Algebraic Equations 70Summary 71Further Reading 72Student Exercises 73Appendix 784 Numerical Integration 804.1 Background 804.2 Euler Integration 814.2.1 Explicit Euler 814.2.2 Implicit Euler 824.2.3 Numerical Stability of Explicit and Implicit Methods 834.3 Runge-Kutta Integration 884.3.1 Second Order Runge-Kutta 894.3.2 Fourth-Order Runge-Kutta 934.4 MATlAB Integration Routines 944.4.1 ode23 and ode45 95Summary 97Further Reading 97Student Exercises 98SECTION III LINEAR SYSTEMS ANALYSIS 1035 linearization of Nonlinear Models: The State-Space Formulation 1055.1 State Space Models 1065.5.1 General Form of State Space Models 1085.2 Linearization of Nonlinear Models 1095.2.1 Single Variable Example 1095.5.2 One State Variable and One Input Variable 1105.2.3 Linearization of Multistate Models 1125.2.4 Generalization 1145.3 Interpretation of Linearization 1175.4 Solution of the Zero-Input Form 1195.4.1 Effect of Initial Condition Direction(Use of Similarity Transform) 1205.5 Solution of the General State-Space Form 1275.6 MATlAB Routines step and initial 1275.6.1 The MATLAB step Function 1295.6.2 The MATLAB initial Function 129Summary 130Further Reading 131Student Exercises 131ix 8. x Contents6 Solving Linear nth Order ODE Models 1426.1 Background 1436.2 Solving Homogeneous. Linear ODEs with Constant Coefficients 1456.2.1 Distinct Eigenvalues 1466.6.2 Repeated Eigenvalues 1486.2.3 General Result for Complex Roots 1526.3 Solving Nonhomogeneous. Linear ODEs with Constant Coefficients 1526.4 Equations with Time-Varying Parameters 1546.5 Routh Stability Criterion-Determining Stability Without CalculatingEigenvalues 1576.5.1 Routh Array 157Summary 160Further Reading 161Student Exercises 1617 An Introduction to laplace Transforms 1687.1 Motivation 1687.2 Definition of the Laplace Transform 1697.3 Examples of Laplace Transforms 1707.3.1 Exponential Function 1707.3.3 Time-Delay (Dead Time) 1727.3.4 Derivations 1737.3.5 Integrals 1737.3.6 Ramp Function 1747.3.7 Pulse 1747.3.8 Unit Impulse 1767.3.9 Review 1777.4 Final and Initial Value Theorems 1777.5 Application Examples 1787.5.1 Partial Fraction Expansion 1797.6 Table of Laplace Transforms 185Summary 187Further Reading 187Student Exercises 1878 Transfer Function Analysis of First-Order Systems 1908.1 Perspective 1918.2 Responses of First-Order Systems 1918.2.1 Step Inputs 1938.2.2 Impulse Inputs 1988.3 Examples of Self-Regulating Processes 2008.4 Integrating Processes 206 9. Contents8.5 Lead-Lag Models 2088.5.1 Simulating Lead-Lag Transfer Functions 209Summary 211Student Exercises 2119 Transfer Function Analysis of Higher-Order Systems 2159.1 Responses of Second-Order Systems 2169.1.1 Step Responses 2179.1.2 Underdamped Step Response Characteristics 2219.1.3 Impulse Responses 2229.1.4 Response to Sine Inputs 2249.2 Second-Order Systems with Numerator Dynamics 2269.3 The Effect of Pole-Zero Locations on SystemStep Responses 2289.4 Pade Approximation for Deadtime 2309.5 Converting the Transfer E;unction Model to State-Space Form 2329.6 MATLAB Routines for Step and Impulse Response 2349.6.1 step 2349.6.2 impulse 236Summary 236Student Exercises 23710 Matrix Transfer Functions 24710.1 A Second-Order Example 24810.2 The General Method 25110.3 MATLAB Routine ss2tf 25210.3.1 Discussion of the Results from Example 10.2 255Summary 257Student Exercises 25711 Black Diagrams 26111.1 Introduction to Block Diagrams 26211.2 Block Diagrams of Systems in Series 26211.3 Pole-Zero Cancellation 26311.4 Systems in Series 26711.4.1 Simulating Systems in Series 26711.5 Blocks in Parallel 26911.5.1 Conditions for Inverse Response 27111.6 Feedback and Recycle Systems 27311.7 Routh Stability Criterion Applied to Transfer Functions 27611.7.1 Routh Array 27711.8 SIMULINK 278xi 10. xii ContentsSummary 279Student Exercises 28012 Linear Systems Summary 28212.1 Background 28312.2 Linear Boundary Value Problems 28312.3 Review of Methods for Linear Initial Value Problems 28712.3.1 Linearization 18712.3.2 Direction Solution Techniques 28812.3.3 Rewrite the State-Space Model as a Single nth Order OrdinaryDifferential Equation 28912.3.4 Use Laplace Transforms Directly on the State-Space Model 29012.4 Introduction to Discrete-Time Models 29012.4.1 Discrete Transfer Function Models 29112.5 Parameter Estimation of Discrete Linear Systems 295Summary 297References 297Student Exercises 298SECTION IV NONLINEAR SYSTEMS ANALYSIS 30113 Phase-Plane Analysis 30313.1 Background 30413.2 Linear System Examples 30413.3 Generalization of Phase-Plane Behavior 31113.3.1 Slope Marks for Vector Fields 31313.3.2 Additional Discussion 31513.4 Nonlinear Systems 31613.4.1 Limit Cycle Behavior 323Summary 324Further Reading 324Student Exercises 32414 Introduction Nonlinear Dynamics: A Case Study of the Quadratic Map 33114.1 Background 33214.2 A Simple Population Growth Model 33214.3 A More Realistic Population Model 33414.3.1 Transient Response Results for the Quadratic(Logistic) Map 33514.4 Cobweb Diagrams 33914.5 Bifurcation and Orbit Diagrams 34214.5.1 Observations from the Orbit Diagram (Figure 14.14) 342 11. Contents14.6 Stability of Fixed-Point Solutions 34414.6.1 Application of the Stability Theoremto the Quadratic Map 34414.6.2 Generalization of the Stability Resultsfor the Quadratic Map 34614.6.3 The Stability Theorem and Qualitative Behavior 34614.7 Cascade of Period-Doublings 34814.7.1 Period-2 34814.7.2 Period-4 35114.7.3 Period-n14.7.4 Feigenbaum's Number 35314.8 Further Comments on Chaotic Behavior 354Summary 354References and Further Reading 355Student Exercises 356Appendix: Matlab M-Files Used in This Module 35815 Bifurcation Behavior of Single ODE Systems 36015.1 Motivation 36015.2 Illustration of Bifurcation Behavior 36115.3 Types of Bifurcations 36215.3.1 Dynamic Responses 365Summary 376References and Further Reading 376Student Exercises 377Appendix 37916 Bifurcation Behovior of Two-State Systems 38116.1 Background 38116.2 Single-Dimensional Bifurcations in the Phase-Plane 38216.3 limit Cycle Behavior 38416.4 The Hopf Bifurcation 38816.4.1 Higher Order Systems (n > 2) 391Summary 392Further Reading 392Student Exercises 39217 Introduction to Chaos: The Lorenz Equations 39517.1 Introduction 39617.2 Background 39617.3 The Lorenz Equations 39717.3.1 Steady-State (Equilibrium) Solutions 398xiii 12. xiv Contents17.4 Stability Analysis of the Lorenz Equations 39917.4.1 Stability of the Trivial Solution 39917.4.2 Stability of the Nontrivial Solutions 40017.4.3 Summary of Stability Results 30117.5 Numerical Study of the Lorenz Equations 40217.5.1 Conditions for a Stable Trivial (No Flow) Solution 40217.5.2 Stable Nontrivial Solutions 40317.5.3 Chaotic Conditions 40517.6 Chaos in Chemical Systems 40717.7 Other Issues in Chaos 409Summary 410References and Further Reading 410Student Exercises 411Appendix 412SECTION IV REVIEW AND LEARNING MODULES 413Module 1 Introduction to MATlAB 415M1.1M1.2M1.3M1.4M1.5M1.6M1.7M1.8M1.9M1.10M1.11M1.12M1.13M1.14Background 416Using This Tutorial 416Entering Matrices 417The MATLAB Workspace 419Complex Variables 421Some MATLAB Operations 421Plotting 422More Matrix Stuff 426FOR Loops and IF-THEN Statements 427m-files 428Diary 430Toolboxes 430Limitations to Student MATLAB 431Contacting Mathworks 431Student Exercises 432Module 2 Review of Matrix Algebra 435M2.1 Motivation and Notation 436M2.2 Common Matrix Operations 436M2.3 Square Matrices 440M2.4 Other Matrix Operations 448Summary 450Student Exercises 450 13. ContentsModule 3 Linear Regression 452xvM3.1M3.2M3.3M3.4M3.5Motivation 452Least Squares Solution for a Line 454Solution for the Equation of a Line UsingMatrix-Vector Notation 455Generalization of the Linear Regression TechniqueMATLAB Routines polyfit and polyval 458456Module 4 Introduction to SIMUlINK 464M4.1M4.2M4.3Introduction 464Transfer Function-Based SimulationPrinting SIMULINK Windows 469466Module 5 Stirred Tank Heaters 471M5.1M5.2M5.3M5.4M5.5M5.6M5.7Introduction 471Developing the Dynamic Model 472Steady-State Conditions 475State-Space Model 475Laplace Domain Model 477Step Responses: Linear versus Nonlinear ModelsUnforced System Responses: Perturbationsin Initial Conditions 483478Module 6 Absorption 490M6.1 Background 490M6.2 The Dynamic Model 491M6.3 Steady-State Analysis 495M6.4 Step Responses 496M6.5 Unforced Behavior 501Module 7 Isothermal Continuous Stirred Tank Chemical Reactors 506M7.1M7.2M7.3Introduction 506First-Order Irreversible ReactionVan de Vusse Reaction 516507Module 8 Biochemical Reactors 529M8.1 Background 529M8.2 Modeling Equations 530M8.3 Steady-State Solution 534M8.4 Dynamic Behavior 535 14. xviM8.5 linearization 536M8.6 Phase-Plane Analysis 539M8.7 Understanding Multiple Steady-States 540M8.8 Bifurcation Behavior 549Module 9 Diabatic Continuous Stirred Tank Reactors 559ContentsM9.1M9.2M9.3M9.4M9.5M9.6M9.7M9.8M9.9Background 560The Modeling Equations 561Steady-State Solution 563Dynamic Behavior 565linearization of Dynamic Equations 567Phase-Plane Analysis 571Understanding Multiple Steady-State BehaviorFurther Complexities 580Dimensionless Model 584572Module 10 Ideal Binary Distillation 597M10.1 Background 597M10.2 Conceptual Description of Distillation 599M10.3 Dynamic Material Balances 601M10.4 Solving the Steady-State Equations 603M10.5 Solving the Nonlinear Dynamic Equations 605M10.6 State-Space Linear Distillation Models 606M10.7 Multiplicity Behavior 608Index 617 15. PREFACEAn understanding of the dynamic behavior of chemical processes is ilnportant from bolhprocess design and process control perspectives. It is easy to design a chemical process,based on stcady~state considerations, which is practically uncontrollable when the processdynamics arc considered. The current status of computational hardware and software hasmade it easy to interactively simulate the dyoXIK(X,) + (I - XI) = 0f,(x"x,) = j3XIK(X,) + (I + o)x, = 0where K(X ) = exp (_X2 ..)2 1 + x,I'YUscft(x['X2) to solve for xl in terms of x2 and substitute intoh(xl,x2) to obtain thesingle equationI ) IX,) - (1 + o)x, = 0 ~ .Consider the parameter values ~ :::: 8, (V :::;: 0.072, 'Y :::: 20, 0 = 0.3. Determine thenumber of solutions to this problem (graphically), Find the xI and .x2 values for eachsolution, using the single variable Newton's method. 90. AppendixMultivariable Methods7713. Use the multivariabJe Newton's method to solve the following problem. Solve this asa two-variable problem. Do not reduce it to a single-variable problem via substitution.f,(x) = 2x,-x2 -5 = 0J;(x) =-x, -x2 + 4 .~ 0How many iterations docs it take to converge to the solution? Explain this resultconceptually.14. A simple bioreactor model (assuming stcady~statc operation) iswhere JJ..mi]Xkmk,c::::: 0.53= 0.12::::: 0.4545::::: 0.4::::: 4.0Xl is the biomass concentration (mass of cells) and xl is the substrate concentration(food source for the cells).Find the steady-state values for xI and x2 if f)::::: 0.3 (There are three solutions).X,,,(xz) + (1 - x,) = 0j;(x"x,) = l3q,x,,,(x,) - (1 + I)xz .c. 0where ,,(x,) = exp (. ..)I j- x,hand the following parameters arc used13 = 8 (I' = 0.072'Y = 20 1 = 0.3 91. 78 Algebraic Equations Chap.3APPENDIXStability of Numerial Solutions-Single EquationsIf the iterates (xk) from a numerical algorithm converge to a solution, we refer to thal solutionns being stable.-----._----------~----_.. _--~-~--~---~-_._--------~Definition 3.1Let x''' represent the solution (fixed point) of x* =: S(x'''), or get''') yO" =: O.--------~-Theorem 3.1x~' .IS a stahle soIuUon'01 x':': 0::.K(.r""), 1'li-1-~---g--- l - I I .. II I' I' < eva llatcd at -r"'r';' IS an 11llsta) c SO utHlll (),- ~ g(,"'). if lu t evaluated at x* gl (JXIf 1~lgl !, then no conclusions can be drawn. For simplicity in notation, we generally uscrJxf (jv g to represent 1.':>1_dxllxVc continue with Example 3.2 to illustrate the numerical stability of direcl substitution.--------- -------._--.._---EXAMJ'LE 3.2 Contimlcd. Stability of din~ct substitutionConsider the Case I formulation,x ~ g(x) x+1which has the derivativeag . g' - ax- Ix I 1III II, then x*' is a stable solutioH.O.X090 I.Sox''':=O.6ISisaO.61X +- I1. For xo;' := 0.618, we find that lex ") :::;0stable solution, that is, all initial "guess" for Xo close to 0.618 will convergc 10 xO;o 0:::: 0.618.-I0.30(]O,' 1. So _y*' :::; ....~ 1.618 should.618 f J2. [-'or x'" 0:::: -1.618, wc find I g'(x"') I 0::::be a stable solution, that is, an initial "guess" frw Xu close to - 1.61 g should converge tox'" 0:::: -1.618.c 92. Appendix 79Question: Why did we find previollsly that an Initial guess close to -1.61 Xdid not converge?Observation: We must realize that the square root of a positive number has two values. Forexample, the square rooL of I call either be + I or -I (after all (-1)2 ::0:: In.---------You may be questioning the utility of a stability test for the direct substitution method,which requires that the solution be known to apply the test. Our purpose is mainly to showthat the direct substitution method can he unstable. Newlon's rncthod guarantees stablesolutions, if the "guess" is close to the solution.Stability of Newton's Method for Single EquationsHere we use 'rhcorcm 3.1 to show that Newton's method is stable. 'to/e see that NewLon'slllcthod can be written in the form ofwherefix,)f'(x,JThen we can find that tbe derivative, //Ctk) isorAt the solution, x"" we sec thatg'(x,) ~g' (x*)lex,) n,)II' (,J I'/(x*) r(x"')II'(x*)]'And sincc.f(x*') ::::: 0, we find that the stability constraint is satisfiedg'(x*) = ()as long as/ex"~') *- O. This shOvs that Newlon's method will converge to the solution, providedan initial guess close to the solution. 93. NUMERICAL INTEGRATION 4Most chemical process models arc nonlinear and rarely have analytical solutions. Thischapter introduces numerical solution techniques for the integration of initial value ordi~nary differential equations. After studying this material, the student should be able to:Understand the difference between explicit and implicit Euler integration.Write MATLAB code to implement fixed step size Euler and Runge-Kutta techniques.Usc thcMATLAB ode45 integration routine.The major sections or this chapter arc:4.1 Background4.2 Euler Integration4.3 Runge-Kulla Integration4.4 MATLAB Integration Routines4.1 BACKGROUNDThus far we have developed modeling equations (Chapter 2) and solved for the steadystates (Chapter 3). One purpose of developing dynamic models is to be able to perform"what if' types of studies. For example, you may wish to determine how long a gas storagetank will take to reach a certain pressure if the outlet valve is closed. This requires in-80 94. Sec. 4.2 Euter Integration 81tegrating the differential equations from given initial conditions. If the dynamic equationsare linear, then we can generally obtain analytical solutions; these techniques will be presentedin Chapters 6 and 8 through 10. Even when systems are linear, we may wish to usenumerical methods rather than analytical solutions.At this point itis worth reviewing the difference between linear and nonlinear differentialequations. An example of a linear ordinary differential equation is:dxdt = -rsince the rate of change of the dependent variable is a linear function of the dependentvariable. An example of a nonlinear differential equation is:dx = 2 ~-xdtsince the rate of change of the dependent variable is a nonlinear function of the dependentvariable. Although this particulary nonlinear equation has an analytical solution, this willnot normally be the case, particularly for sets of nonlinear equations. Notice that the followingequation is linear:since the only nonlinearity is in the independent variable (t).The purpose of this chapter is to introduce you to numerical techniques for integratinginitial value ordinary differential equations. The first numerical integration techniquethat we will present is the Euler integration. In the next section we discuss two algorithms,the explicit and the implicit Euler methods.4.2 EULER INTEGRATIONConsider a single variable ODE with the formdx. ( )dl = x =f x (4.1 )We consider two different approximations to the derivative. In Section 4.2, I we considera forward difference approximation, which leads to the explict Euler method, In Section4.2.2 we consider a backwards differences approximation, which leads to the implicitEuler method.4.2.1 Explicit EulerIf we use a forward difference approximation for the time derivative of (4, I), we finddx=dl+ I _.t(k + I) ~ t(k)(4.2) 95. 82 Numerical Integration Chap. 4where k represents the kth discrete time step of the integration. Now, assume that)(.:) isevaluated at x(k). We will refer to this fuuclion ast(x(k)), and can write (4.1) and (4.2) asx(k+ 1)...- x(k) = j(x(k))I(k + 1) - 'rk)(4.3)Normally we will use a fixed increment of time, that is, t(k + 1) - t(k) ~ at, where!:;;'/ isthe integration step size. Then we write (43) asSolving t{)r x(k + I)x(k + 2t-x(k) Cc J(x(k))x(k + I) = x(k) + D.tJ(x(k)) K,plicit Euler(43)(44)We can view (4.4) as a prediction of x at k + 1 based on the value of x al k and theslope at k, as shown in Figure 4.1.Equation (4.4) is the expression for the explicit Euler method for a single variable.The general statement for a lllultivariable prohlcm isx(k + 1) = x(k) + 6.lf(x(k)) (45)Where x(k) is a vector of state variable values at time step k and f(x(k is a vectorof functions evaluated at step k. Equations (4.4) and (4.5) are explicit because the statcvariable value at time step k + 1 is only a function of the variahle values at step k. 'I'hismethod is straightforward and easy to program on either a handheld calculator or a cornputer.A major disadvantage is that a small step size must he llscd for accuracy. llowevcr.if too small of a step size is used, then numerical truncation problems may result. ExplictEuler is not often used in practice, but is covered here for illustrative purposes.4.2.2 Implicit EulerThis method uses a backwards difference approximation for the derivative in (4.1). Thefunction (or vector of functions) is evaluated at time step k + 1 rather than time step k:x(k)+I)-x(k)6.1' = j(x(k + 1))x(k+1) based on x(k) and f(x(k))----~ slope, f(k),evaluated at step k(46)k k+1 FIGURE 4.1 Pictorial representationof the explicit Euler method. 96. Sec. 4.2 Euter Integration 83which can be writtenx(k + J) = x(k) + Iltf(x(k + 1)) Implicit Euler(4.7)Equation (4.7) is implicit because the value x(k + I) must be known in order to solve forx(k + 1). What this generally requires is a nonlinear algebraic solution technique, slIch asNewton's method. For a linear system, equation (4.7) can be explicitly solved to obtainthe formx(k + 1) = g(x(k))The following section compares the explicit and implicit methods for a single linear ordinarydifferential equation. In particular, we compare how the integration step size (At) affectsthe stability of each method.4.2.3 Numerical Stability of Explicit and Implict Euler MethodsConsider the tank height problem covered in Example 2.1. There was no inflow, and theoutlet flowratc was assumed to be linearly related to height, which gave us the followingequation:dxdt1x co Ax = f(x)T(4.8)where 'T = A/13, A=- lIT and the state variable x is the tank height. Since the variablesare separable, the reader should show that the analytical solution is:x(t) = x(O)e,j = x(O)e" (4.9)Next, we compare this analytical solution with the explicit and irnplicit Euler solutions.EXPLICIT EULERThe function value at step k is:Jf(x(k) Oc - x(k)Tand the state variable value at the next time step is:Ilt (t1t) x(k + J) = x(k) + - T x(k) = J - .~. x(k)IMPLICIT EULERThe implicit Euler method evaluates the function at k + 1 rather than k:II(x(k + 1)) = - x(k + 1)Tand the state variable at slep k + lis:(4.10) 97. 84 Numerical Integrationillx(k + I) ~ x(k) + - x(k + I)TChap. 4(4.1 J)Notice that, since this is a linear problem, a nonlinear algebraic equation solver is notneeded for (4.11). We can rewrite (4.11) asx(k + I) ~1ill x(k)+T(412)In the next section we compare the numerical stability of the explicit and implicit Eulermethods.NUMERiCAL 5TABILITYThe explicit Euler solution, written in terms of the initial condition, is (from (4.10):x(k + I) ~ (1 - fTlt)" Ix(O)which will be stable if 11- AlIT 1< 1. This is the same re~Htlt if we usc the representation:x(k + i) = g(x(k)) ~ (I -~1)X(k)and the stability requirement that Ig' I< I. The explicit Euler method is then stable if:ill-1 0,L[A] = ;s5;tepNotice that the same expression is used for the Laplace transform of a constant.AStep Functionot = 0FIGURE 7.2 Step function. 183. 172 An Introduction to Laplace Transforms Chap. 77.3.3 Time-Delay (Dead Time)This is important for systems with transport delays (flow through pipes, etc.), or delaysdue to measurements. l"ct ttl represent the time delay. If the undclayed time domain functionisj(t), then the delayed function is/(t - l I"and we can write the Laplace transform as:, Af A e" dl + fOe" dl- ~ [e"I'"o ~ s 0'file usc of A::::: I is the unit pulse.175F(s) = f/(l) e" dl .c f/(I) e" dl + ff(l) e'" dl(lOll'A. AF(s) = ~ [e""~ I] = [I ~e "'Is sSec. 7.3Llunit pulse of duration 'pi ,-- I [1 e-II"1sUnit PulseA SECOND METHODConsider that the pulse is simply the sum of two step changes, as shown in Figure 7.6.1'hat is, it is the sum of a positive step change at f = 0 and a negative step change att ::::: tv Lctfl(t) fcprCScllt the step change at t :::: 0, and lit) represent the negative stepchange at I :::: If!>f(l) , .1;(1) + NI)F(s) F,(s) + F,(s) .c L[I(I)] ,,- Llt;(I) + f,(I))+/, (I)but notice thatl2(t) = ~f,(t ~ II')ATLoFIGURE 7.6 Pulse function. 187. 176and that (from the stcp fUBction):and (from the delay function):An Introduction to Laplace TransformssChap. 7-(' 1.-" A.I'SO VC call vrite 1'(.1')/1[] .. e'']svhich is consistent vith the previous derivation.7.3.8 Unit ImpulseIn Figure 7.7, consider the pulse function as the pulse time is decreased, but the pulse arearemains the same, as ShOVv'1l by the dashed lines below.l'he unit impulse fUllction is a special case of the pulse function, with zero width(t/J -t 0) and unit pulse area (so A ::::. llt/,'!. Taking the limit and applying L' llnpiLa]'srule:~, ,~ :- ..~ .~,-'-'--'------'-----------FIGURE 7.7 Impuhc function. 188. Sec. 7.4 Final and Initial Value TheoremsL[o] lim11')0- c".'] .... lim(!'--.,o-I I -sc "1"1S177Unit Impulse7.3.9 Review'rhus far we have derived the Laplace transform of a number of functions. f:;'or example,we found:LIe "'] ~s+aIf we have a LapJace domain function, such asl/(s + a), we can "invert" it to the time domain.For example,LII, I al.~e'"Althollgh the student should he able to derive Laplace transforms of any lillle domainfUllction, that is not our major objective. Our major objective is to usc Laplace transforrnsas a tool to solve clynarnic problems. The l-,aplacc transforms of many time-domain functionshave been derived and compiled in various tables and handbooks. Already, we canconstruct a table of eight (exponential, step, time-delay, derivative, integral, ramp, pulse,and impulse) time-domain functions along with their Laplace domain functions. AdditionalLaplace transforms aJ'e provided in Table 7.1 in Section 7.6.7.4 FINAL AND INITIAL VALUE THEOREMSThe following theorems arc useful for determining limiting values in dynamics studies.They will be used frequently to find the shortAenn and long-term behavior. The 1011g term(final valuc) of a timc domain function can be found hy analyzing the Laplace domain behaviorin the limit as the s variable approaches zero. Thcinilial value of a time domainfunction can be found by analyzing the Laplace domain behavior in the limit as s approachesinfinity.Final Value Theoretl1Initial Volue Theoremlim Is F(s)],1',0(7.3)lim f(t) ~ lim is 1'(.1')]{-)O )' __Pc(7.4) 189. 178 An Introduction to Laplace Transforms Chap. 7If we have lransforlncit,- ()Jim c!l" ()ovbich checks with t- II~IIlln !t t) ."which is safisfied for any fillite (/.lim e'"'". ... --~~----------~--------~~~~~~One pOJl1lnot often made in texthouks is that the final value theorem only hold", for stahlesy,'",tems (0 > 0).7.5 APPLICATION EXAMPLEScrhe following is a checklist for solving dynamics probkms using Laplace transt'onns.Stcp I.Stcp 2.Start vith a linear ordinary differential equatioll and initial conditiolls.Transform each of the tiJle domain fUllctions to the Laplace dumain. gen~erally by using a tabk of Laplace transforms. 190. Sec. 7.5 Application Examples 179Step 3. Usc algebraic manipulations to solve for the transformed variable. Thepartial fraction expansion approach is particularly useful.Step 4. "Invert" to the time domain, by using a table of Laplace transforms.7.5.1 Partial Fraction ExpansionThe partial fraction expansion approach is based on representing a ratio of two polynomialsas a sum of simpler terms. L,ct N(s) and D(s) represent numerator and denominatorpolynomials, respectively.N(s)D(s)CD,(s)+ +D,(s) .. UJs)Ci arc constants and Di are lower order (typically J) polynomials.The [our-step procedure is llsed in each of the following examples. The partial fractionexpansion is first used in [~xample 7.3.gXAMPI.J~ 7.2 Homogeneous First-order ProblemStep 1. Consider the simple IwmogeneotlJ' (unforced) first-order problem:dx + 2x ~ 0dtsubject to the initial condition:x(O) ~ 4Step 2. Rccall the following transforms:II:';;] ~ s X(s) x(O)"iilxj ~ al jxl c. 1/ Xes)Then wc (an take the Laplace transform of (7.3) aud (7.4) as:II~;I+ 2Lix] ~ 0s Xes) - x(O) + 2 Xes) -, 0s X(s) - 4 I 2 X(s) ~ 0Step 3. Solving (7.7) for Xes):4X(.,) -.I' j-- 2(7.5)(7.6)(7.7)(7.8) 191. 180 An Introduction to Laplace Transforms Chap.7Step 4. Inverting each clement back to the time domain:L '[Xes)) crt)CII 41 ~4e".s+ 2.and the solution isx(t) 4 e"(79117.10)(7. II)Indeed, using the lllcl!lod in Example 7.2, VC can show that the general first-orderequation:dr+ax cc;:()titwith initial condition x(O)has the solution x(t) cc x(O) e '"which, of course, is the same solution ohtained by separating the variables and integrating.The real power of Laplace transfonns is in solving heterogeneous problems, as illustratedin Example 7.3.EXAMPLE 7.3 Illustration of the Partial Fradion Expansion Tc(~hnitlucStep 1. Consider the simple heterogeneous first-order problem:dx-+- 2x = 4.5dtwith the initial conditionx(O) ~ 4Step 2. Taking the Laplace transform of each c1cmcnt:4.5s X(s)- x(O) + 2 Xes) ~swhich can be written (since -,_-(0) "'" 4):4.5(sl 2) Xes) -c 4'sStep 3. Solving for the transformed varlahle4 4.5Xes) ~ +s f 2 s(s + 2)(7.12)17.11(7.14) 192. We would like to invert (7.14) to the time domain, however we do not know how to invert thelast term 4.5/s(s + 2).We will use the approach known as apartialFaetion expansion. That is, write:A Iis(s2)A ~ 2.25then set s:::o;: 0 and solve for A:181+ (7.15).' S + 2Application Examples4.54.5 lis"C A +s-+-2 s+ Ito find A, finit multiply (7.15) by s:To find fl, first lllUltiply (7.15) by s + 2:4.5 A(s + 2) + IJs sSec. 7.5and set s = -2 to solve for B:IJ ~. 2.25which yields:4.5.I(S + 2)2.25 - 2.25+s s -+- 2(7.16)and We can write (7.15) as:4Xes) ~s +- 22.25 - 2.25+s s + 2(7.17)Step 4. Inverting element by clement ill (7. J7) we findx(t) = 4 C- 21 +- 2.25 +- - 2.25 ellorX(I) ~ 1.75 e" + 2.25 (7.1 ~)the reader should verify that this solution satisfies the initial conditions and the differential equation.Examples 7.4 and 7.5 provide additional illustration of the partial fraction expansion technique.EXAJtlPLE 7.4 Find the Inverse Laplace Transform of lI(s + ales +b)Write1(s ' ales + b)A B+ s+a s+b(7.19)Multiply (7.19) by s + a, set s =:: -0 to find: 193. Chap.717 ..2UI(7..~ IIThe Illl'thod in the prciou" ci1lllple failed ir the rouLS n( the LttpLICC domain rlll1l~!i()l1were equal. "fhc ldhming carnplc "IH''" hO 10 pl~rrorll1 a partial fraction C"KlIbioll furI"Cj)('(lfcd I"oofs.(7,231An Introduction to Laplace Transforms182lultil'l;. 7.19) hy. -+- f), ~l'l s --/1 tu find:1h ~ "II, I "I 1u I h II, I h IEX';IPLE 7.5 Consider the Following Transfer Function with Repealed Roofs(Here we C,lll!lU{ llluitiply b;.-+- (I ,p1(1 set S =-i1, because we 'luld find 11l1buUlllkd (nULS. Fir"Lmultiply 0,20)1 by (s -+- (1)2.C(sI' --'-- hhi(s-+-i!11 (/10 ~ hi,(/ - h01Ii--u h.(1)(0, h)(1)(. - 101](s ([) :'{.101i( ,I. L(slultiply 17.23 hy , -+- hand -;ct s 0::: b 10 filld--------------------- ....and C;d , ;:c: -u lu find 194. Sec. 7.5 Application Examples 183Notice that we have solved for two of the coefficients of (7.23). Now, we can solve for olleequation in one unknown, by setting s:;:;: any valuc-. For simplicity, choose s = O. Froln (7.23):-IAa (b -we can reduce the solution for A to A =1(a-b)'I(a bJ'hWe have solved for A, H. and C' in (7.23), So we can perform an clcmcilt-by-clemcnt inversion of(7.23) to find the time domain function:L ,[.I(a=;))2] + l(b~a),1 + l(a~b)'I] ~(s + a) (s + a)' (s + h)- I e"l _j J t em -+- I ... e hi(a, h-a (a_b)'(7.24)(725)then expand the numerator and solve for the coeJTicienls A, lJ, and C such that the righthand sideis equal to the Ie-niland side. See student exercise 13.L.- ~ . , ~The previous examples were for ODEs with real roots. This next example is a problemwith complex roots.(7.26)( , ,,11/(a-b)'t c--il' -+b~ae"l -+L + b) I (il ' 'I (, +As an alternativc-, we tan JJnd a COllUllon denominator for the righthand side of (7.23) and write:A(s+ a)(s + b) + B(s 1 b) I e(s + (I)'+ b) (s + a)'(s 1 b)and VC call write:EXA1lPLE 7.6 A Second~ordcr System vith Complex RootsStep 1. Consider the homogeneous problem:d~r dxi+ +x~Odt' dtwith the initial conditions:(0) ,(0) (7.27)Step 2. From the table of Laplace transforms:LI d"xi ~ s" Xes) _ S"IX(O) _ S" 2.'(0) - ... - S Xl" 2'(0) - xl" "(0).. dtil. 195. 184So, for a second derivative:and, for a first derivative:An Introduction to Laplace TransformsLId'",J ~ S2 XeS) - ,' x(O) - x(O)dtdx L [.. l = sX(s)-x(O)df ..Chap,7We can now write the Laplace transform of (7.26) as:s' Xes) - s x(O) -teO) + s Xes) - x(O) + Xes) = 0Step 3. Attempting to isolate Xes) on the LHS:(S' + s + I) Xes) ~ s x(O) + x(O) + x(O)dividing by (,52 + S + 1):X(s) S x(O) x(O) + x(O) =----- + --------.'2+ s +1 s2+."+1and from the initial conditions:Xes) = ,'+s++2+s+(7,28)the roots of (."2 + s + I) are - J/2 V3]2j (from the quadratic fOl1TIula):Notice another way that we can write (s2 + S+ 1) is:( I)' (Vi)2 (S2 + s + 1) ~ s + '2 + -Z'-which means that we can write (7.28) as:s 2Xes) 1); ((3)-; -(-'1-)2(/3); = ( + s+'+--- s+-+2 2 2 2Step 4. Notice from a table of Laplace transforms that:L[e-/JI sill wt] = --------~-----;(s + Ii)' + ",'Lle-'" cos wI} = --------~--~~----(s + Ii)' + ",2and we should maneuver (7.28) into the form of (7.29) and (730).Notice that we can write (7.30) as:(729)(7,111) 196. Sec. 7.6 Table of Laplace Transforms 185(7.31)I.S(SI i)'1 (~7and we invert each clement of the RHS of (7.31), using (7.29) and (7.30):v3 e 'I:'. sin V3 (2which has the lime domain response shovll in Figure 7.8. As we Iloticcdin Chapter 6, complexroots give oscillatory responses. We see in Chapter 9 that this type of response is called llndcrdamped.6 8 102time4s+2'I) V"3e ~cos. 2 l2l ' /3 J.5 Ii' /3x(t)=el"cos t+ e-""sin t2 2ttl)X(S)1.5:..:: 0.5o-0.5oFIGURE 7.8 ()sciJlatory response due to complex roots.7.6 TABLE OF LAPLACE TRANSFORMSFor your convenience, selected Laplace transforms arc presented in Table 7.1. If yOll desireto transform a function from the time domain to the Laplace domain, then look for thetime dOlnain ('unction in the first column (j(t and write down the corresponding Laplacedomain function in the second column (F(s)). Similarly, if you arc trying to "invert" aLaplace domain function to the time domain, then look for the Laplace domain functionin the second column and write down the corresponding time domain function from thefirst column. 197. 186 An Introduction to Laplace Transforms Chap, 7TABLE 7.1 Laplace Transforms for Selected Time-Domain Functionsfit) 1'(.1')(j(t) (unit impulse), {Ofoft 0A (constant)f(t--O) (time delay)t (ramp)df(derivative)dtd'~fdtile--il !(e--Oll -- e- Ojl)a j - {/2~~L_=~lJ c,,,,r +~lJ - (12 e"/(J2~al al~a2sin wtcos wte-Il! cos (UI1 + (1'1 e-t / T, ~ 1'2 e---Il,,)1'2 - 1'1(1 _ 1where w :c:.:cI + _'l"~-_:'l"1 e-I/T) +'l"J .---'1"2 e liT,Tl~T2 1'2-1'11- (1 -::J e--t!'d7,I'Ahcos F(s)1-I.v".1'1'(.1') -.1(0)sllFCs) ~ SIl-l.!W) - s"-2j'(I)(())- .1./,"-21(0) -.I''' "(0)s + aI(.I' + "')(.1' + "2)s -J-Cs-+- llj)(S -+- (/2)Is(n + I)Ws2 +S+(,)(.I' C [J)' +s+a(.I' + f1.1'(7,.1' + 1)(7,.1' + I)I+ 2;; 7S + I),(V = tan---- 1+1.1'(7,.1' + 1)(7", + I)Til.' --j-- 1.1'(7".1' j- I)___________________ TtII'" 198. Student ExercisesSUMMARY187We have defined the Laplace transform and applied it to several functions that commonlyappear in the solution of chemical process dynamics problems. Although the Laplacetransform concept seems quite abstract at this point, in the chapters that follow you willfind it extremely llseful in solving differential equation models. The final (7.3) and initialvalue (7.4) theorems will be useful for checking the long-term (steady-state) behavior andthe initial conditions for a particular problem.A number of examples were provided to illustrate the power of the Laplace transformtechnique for solving ordinary differential equations. We noted that the tcchnique allowsus to convert the ODE problem to an algebraic problem, which is casier for liS tosolve. After performing algebraic manipulations in the Laplace domain, often with the uscof a partial fraction cxpansion, we then look up inverse transforms to obtain thc time domainsolution.In the chapters that follow, we use Laplace transforms to analyze the dynamic behaviorof different types of linear process models.FURTHER READINGMany differential equations and process control textbooks provide details on Laplacetransforms. Some examples arc:Boyce, W. & R. DiPrima. (1992). Ordinary Differential Eqaatiolls alld BOlll/daryValue Problems, 5th cd. New York: Wiley.l~uyben, W.L. (1990). Process Modeling, Simulation and Controlf(Jr Chernical En"R;,/{:ers, 2nd cd. New York: McGraw-HilI.Seborg, I).E., T.P. Edgar, & D.A. Mellichamp. (1989). Process D.vnmnics {{nd Confrol.New York: Wiley.Stephanopoulos, G. (J 984). Chemical Process Control: An Introduction 10 ThcOf)land Practice. Englewood Cliffs, NJ: Prentice Hall.STUDENT EXERCISES1-5. The student should derive the Laplace InmsfoJ'm for the following functions;d'~lLdt"2, '/(1) ~ bl3, '/(1) ~ t2 199. 188 An Introduction to Laplace Transforms Chap.75. ttt):::; cos (I)!(flilll: Although you can solve question:) using integration by pans. you may vish10 usc the Euler identity cos (I){:::; 1/2 (ei'dl + e-F'II).)6. Find the Laplace transform, u(sL o!' the following input function:2u(11oo 10 20 357. Find the Laplace transform of the function y(l) lhal satisfies the differential equation,md initial conditions:d d"4 .) -'- 2y 2dt' dl dl,(OJd(O) d(O)0dt dt,18. Solve the dlllcrcntial equation: (0) 2.09. A process input has the following Laplace transform:2 6u(s) ~ CS SVhat is the lillle domain input. It(t)? Find this analytically".Sketch the time domain Input.10. Find the tillle dornain solution yO) for the Laplace domain transfer function ('ilh~ -ltC) 'fhi" rule is alo O)WiOllS b> 1()O~in~;l1l:i~lll'C S.3: hCll/I.:::: I, (lllk~L!:::: O.6.r2.You "Iwuld 1)(' ('~HdtI. Ik'l';HIS(' t11l'; is onl) trllc fur firsl un!.:'r jll)(:>SI.:''' Iith Ill) tillll'-lkl;l) ~Illd :1I 0 and T > O. This implies that the real portionsof PI ancljJz arc negative and, therefore, the system is stable. The three possible cases arcshown in Table 9.1.9.1.1 Step Responses: + : 1V:2_ I1', ~ -_.._-----T 272T T: v:' .. IfJ 2...T T(9.5)(9.6)Now, we consider the dynamic response of second-order systems to step inputs (U(s) :::;!>u/s):k !>uYes) ~, , .TT + 2:TS + I s(9.7)where Llu represents the magnitude of the step change.Since '> 1, we can see that the two roots will be rcal and distinct. Also, since we assumed thatT :> 0, the system is stable (the roots arc less than zero, since we are assured that /~2~--J< ').We btctor the polynomial T2S2 + 2'TS + 1 into the following form;(:ASE 1 Ovcrdamped (t ~" 1)(98)We sec immediately from (9.8) that the poles (values of s where the polynomial,;: 0) arc;1',from (9.5), (9.6) and (9.g) we find:1', -liT, ~ .. (iT + V((' 1)/T(9.9)which gives the following value for the first time constant: 229. /hu. l~ find lhe :--ccond pole( - -I_~c(9.10)which gin:::-- the following allle fur the second time cunstant-Trpanding the rlghthand side of (9,S).(911 )T,-'e call ,Tile:2~ TS t- (9.12 )lllCh lead to the relatiollshipsTT 1 "2 Oi"',,'(i). 1.:1-)Ve call derivc (sec student excrcisc la) the fuIIO'ing solution 1'01 step ["eSpll!1SeS ()fllVenlalllpcdSystClllSfhcnlmnpl'cl. S> ]If unll f) 1'1(' " cTft). I 5 )v,here "and T,--( - TNlltc thaL as in thl' case llf first-order systems. we can divide hy k":'l1 to develop a dimensionlessUUlpUL Also, the dimctlioliJcss timc is th and we can plu( Cllr'es f(n dimellsionless outPUl as afUllction of i;. Thi:-- IS donc III Figure 9. I. v-hich includes the critically damped l:asc. as discllssedncxt. los( chcmical processes t'xhihit ovcnJalllped behav-ior. The critIcally dampl'd .step l'eSpUIlSCis also .ShUV..-rl ill ['igurc 9.1 (curn: with ~:::: I).0.80.60.2oo1.55Various values 01 damping factor10t/laui5FIGLRE 9.1 Step ''''I,onse of a second-order rller"damped system. 230. Sec. 9.1 Responses of Second-Order Systems 219CASI-: 2 Critically Damped (~ = I)The transition between ovcrdampcd and underdmnpcd is known as critically damped. We canderive the following for the step response of a critically damped system (see student exercise I b)Critically (hlmpcd, ~ := I [Repeated polesl(9.16)Notice that the main difference between overdampcd (or critically damped) step responses andfirst-order step responses is that the second-order step responses have an "S" shape with a rnaximumslope at an inflection point, whereas the first-order responses have their maximum slopeinitially.The initial behavior for a step change is rcally dictated hy the relative order of the system.The relative order is the difference betwccn the orders of the numcralor and denominatorpolynomials. If the relative order is I, then output response has a non-zero slope at thelinle of the stcpinput; the step response of a system wilh a relative order greater than Ihas a zero slope at the time of the step input.CASE 3 Undcrdamped (~ < 1)For StimeFIGURE 9.12 Comparison of step responses for pure time-delay with rirst~order and second-order Pade approximations. Dcadtimc::: 5,The first-order Pad6 arr)foxil1lation isBs0-,= 2e0+ s2(9.29)The second-order Padc approxilnation isc 0,,=1 +o 02, ' + y' 2 12o 02,. + " 2. 12'(9.30)A comparison of the step responses of first and second-order Padc approximations withpure time delay arc shown in r"igurc 9.12,EXAiVIPLE 9.5 Comparison of the Pade Appmximations for DcadtimcConsider the foUowing first~order + deadtimc transfer functione Ssxes) ~5s -+- I 243. 232 Transfer Function Analysis of Higher-Order Systems Chap.9The first.-order P,ldc appruximatioll yields tht' fullowill(! lnulsfcr functiol-- 2.Ss7.Ssand the second-order Pade approi11latio/l .yields2.0SJJ: -- 2S11041 j 1-1-.58.3,' -+ 7.51'a cOlllparison {If the step response.s (If ~(s). gl(s) and g~l(S) is "llUwn in [:igurc 9.] J. Notice tllatthe first-urdcr aPllWllllati(Hl has an inverse response. while the sl'l'())Jd~ordcr appmximatill)l hasa "double inverse 1'l:.'SP(1!1"t'." The reader should I'ind that th,'I' 1 it sin,!,'Jc Iloitin,' len) fur NI{S)and there arc t'() po.siti 'c. complex-conjugate lcros of the J111I11Cra(lr tr,lIlSfcr functi(lI1 )f g~(.).0.5yo 5 10 15 20 25FIGURE 9.13 Cumparisun uf first-urdcr + tlcadtill1c rcspulhC with fll'st- and L ~ '_c_c_"_n_r1_-,_"_.d_c_r_l'_a_r1_c approximations 101- dcadtimcMost ordinary dirferenti,ll equation llurllcrical illtcgrat()rs (including c)(le4~-)) fCCjU1IT purediffercntialcquations (with no time-delays). II' yCIl! h,H-e a system of differential equationsvhich has time-delays, the Pack approximation call bc used to convert them tll delay-frecdillerentiaI equations, vhieh call then be numerically inll'grmed. See studeIlt exercise 2Sas an example.One urthe mallY advant'hether a tntl1.';fcr function or statc space rnodel is used by lllC step function, and whetherthe lime('c(X has hel-'ll specified or not.9.6.2 impulseThe output and time veclors arc generated lIsing:[y,x,tJ = impul~;e(num,clcn);the plot is obtained fromplot (t,Y)'rhe plot is SIl0Vll in Figure 0, 15 above. Notice that an impulse has an immediate (disl'(HltitlllOlIS)dfcct Oil the output. because this is a relative order olle sy'slcm.Vc could also supply an equally spaced time Vl'([Or and usc:[y,x] = impulse(num,den,t);SUMMARYThe step responses of the classical seconu order system (o'erdampcd, critically' damped,and undcrdampedl were presented. In addition. ve shoved the effect of ll11rncrator dynamics(and particularly right-half-plane zeros) 011 the rc-"ponse or a sccond-order sy'stenLThe Pad0 approxilnations for dL',,_//17 , ............. --Step response of a physical system, in deviation variables.241150 200 250 300time (min)50 10040302010ooa. Pind the period of oscillation, rise time, and time to first peak, for this system.11(.1')Show your work.h. Find parameters (show the units) in the transfer function, g(s) :::::: k/(T2S2 + 2~TS+ I), by using the dimensionless plot, Figure 9.2. Show your work.IS. Consider the following third-order transfer function, where ~ is a parameter. Findthe conditions on the parameter [3 that will give an inverse response.(2.1'2+.1'+/3)g(s)c(5.1' I- 1)(3.1' + 1)(2.1' + I)Show your work and explain your answcr.16. Consider the following transfer function:S2 + s - 2s2+4s+3a. Find the poles and zeros for this transfer function.b. A unit step change is made at f = O. Find thc value of the outpul, using the finaland initial value theorems:i. After a long timc.ii. Immediately after the step change.c. Verify your results in b by finding (analytically) the time domain solution.d. Verify the results in h using the MATLAB function step.17. Consider the following state-space model:I~; I I-6.542.511 X'I + 10.00155111- 6.5 x, 0.00248ESCOLA Dc ENGE~~HARIAB I BL I 01 cCA 253. 242 Transfer Function Analysis of Higher-Order SystElms Chap. 9Find the lrallsfn l"unctiulls n.lating the input tu c B. The modelingequations are:dC (F) F A~_ +kCA + CArdl V VdC" Fdl ~ k C" ~ V CIIThe following parameters and steady-state input values characterize this system:F= 0.2 min- lVk cc-c: 0.2 min-- 'gmol1.0literThe input is CAl and the output is Cn. You should be able to show that the stcadystatevalues of (~ and CjJ arc 0.5 gmolliitcr.a. Show that the transfer function relating the feed concentration of A to the COIlcentrationof B is:0.5y(.I") =(5.1" + 1)(2.5.1" + I). . gmol B/lilcr ....where the gam 15---------------, and the tllne lIl11! IS Il1lIlutcs.gmol A/lilerb. At time t :;:0 0, the input begins to vary in a sinusoidal fashion with amplitude0.25 and frequency 0.5 min -J; that is,1/(1) ~, 0.25 sin(O.s I)Using Laplace transforms, find how the output varies with time.c. Compare your results in b with the integration of the modeling equations usingthe MATLAB integration routine ode45. Remember to use the correct initialconditions. Also, remember that the transfer function results arc in deviationvariable form and must be converted back to physical variable values.d. Discuss how the amplitude of the output changes if thc input frequcncy ischanged to 5 mitr-- t .25. Oftcn higher-order process transfer functions arc approximated by lower-ordertransfer fUllctions. Considcr the following sccond-order transfer function: 256. Student Exercises11)(11 1)245Find the value of 'T in a first-order transfer function, Ij('TS + 1), which best approximatesthe step response of this second-order transfer function, in a least-squares sense.(Hint: Define an error as a function of time as e(t):::: Y2(t) - YI(I), where }'2 andYI are the step responses of the second- and first-order responses respectively. Find Ivhich minimizes e2(t) when t --> inf'.)26. Consider a criticaIJy damped second-order system:1~() "" (71 + 1)(TI + 1)a. POI' a unit step input change (Au = 1), find the time at which the rate of changeof the output is greatest (i.e., find the inflection point).b. Compare this rate of change with a unit step response of a first-order systelllwith the following transfer function:1g(l) ~ (27,V + I)c. Plot the step responses for a and h, for 'T = I. COinpare and contrast the n>sponses.27. Pharmacokinetics is the study of how drugs infused to the body are distributed toother parts of the body. The concept of a cOinpartmental model is often used, whereit is assumed that the drug is injected into compartment 1. Some of the drug is eliminated(reacted) in compartment I, and some of it diffuses into compaltment 2 (therest accumulates in compartment I). Similarly, some of the drug that diffuses intocompartment 2 diffuses back into compartment I, while some is eliminated by reaclionand the rest acculllulates in compartment 2. Assuming that the rates of diflu~sion and reaction are directly proportional to the concentration of drug in the COI11partmentof interest, the following halance c denl [2 1] jnum2 [3]; den2 - [4 l];the series command generates the llurucrator and denominator polynomials for the transferfunction g(s):[num,den]Dum :::o 0 4.5000den :::::8 6 1which iildicatcs thatcony:'3cries (numi, denl, num2, den2)4.5M(s) ~ 0gs~ 1- 6s 1- 1cony is llsed to multiply two polynomials. Using the previous example, we multiply the numeratorpolynomials to find: numnwn -cony (nwnl J num2)4.5000and the denominator polynomials to find: den = COIlV (deni , den2 )den ~86111.5 BLOCKS IN PARALLELSometimes the behavior or a chemical process can be modeled by transfer functions inparallel as shown in Figure 11.6. 281. 270 Block Diagrams Chap. 11u(s)y, (5)9, (5)++9, (5)Y2 (5)Y(5)FIGLREI1.6 System" In parallcl.For this sy.'stem 'C can Tite the total output. r(sL as the sum of two outputs, '1(.1) +Y:::(.I),or,1"(S) g(s) u(s)'here:Consider the case vhere gl(s) and g2(s) arc fir'>t-ordcr lramJcr functions:'loS -+ 1so(II ,I){1112}{ I I .11}( 11 ,3~1(1115)( II,ft)g(s)TjSfl..(1117)Developing a common denominator. 'C find:Notice that (11.38) has the form (sec Chapter 9):kiT,s i I)g(s) = _ ',I(T, + 1) (T,S + I)(] J .38)( 111')) 282. 5ec.11.5where:Blocks in Parallel"~ ", I 1, O. Thegoal of this section is to show a system where inverse response (discussed in Chapter 9and Example 9.3) behavior can occur.11.5.1 Conditions for Inverse ResponseRecall that a transfer function will have inverse response only if there is a right-half-plane(positive) zero. Since the zero is "-117/1' this system will have inverse response only ifTil < O. We find that Til 0, which means that k2 tr(A)2.Remcmbcr that the different behaviorsresulting from Al and A2 are:Sinks (stable nodes):Saddles (unstable):Sources (unstable nodes):Spirals:Rc (A,) < 0 and Rc (A2 ) < ()Rc (A,) < 0 and Rc (A2) > ()Rc (A I) > 0 and Re (Az) > 0Al and A2 arc complex complex conjugates. If Re(AI)< 0 then stable, i r RC(A,) > () then unstable.We can then usc Figure 13.7 to find the phase-plane behavior for second-order linear ordinarydifferential equations as a function of the trace and detenninanl of A. In Figure 322. 312 Phase-Plane Analysis Chap. 13nodesinkde1(A)saddlespiralsourceCenternodesource(tr At= 4 det AFIGURE 13.7 DYllarnic behavior diagram for second-order linear systems,Thcx = 4.0x b 0.3692Lineari/.ing (13.30) and (13.31) we find the following Jacohian matrix:where we have defined I-l'E()uilihrium t (Trivial)The Jacobian matrix is:/-L,X:!.( kIll f x1.J- 1.286408 o I -IIAA ~ I 0.114563with eigenvalues of; ~l = 0.114563 and A] == -0.4indicating that the steady-state is unstable (it is a saddle point).The unstahle eigenvector is: SlThe stable eigenvector is:I 0.3714]. - 0.9285I~IThis steady-state is known as the "wash-out" steady-state, because no hiomass is produced andthe suhstrate concentralion in the reactor is equal to the feed suhstrate concentratioll. 331. Sec. 13.4 Nonlinear Systems 321Equilibrium 2 (Nontrivial)The Jacobian matrix is: A ~ 1 - 13.215929]8.439832with eigenvalues of 0.4 andindicating 1hal the stcady-state is a stable node.The "slow" stable eigenvector isThe "fast" stable eigenvector is10.99241~, ~ - 0.11234[..37140.92851 The phasr>plunc plot of Figure 13.15 sbows that the trajectories leave unstable point I (0,4) andgo to stable point 2 (1.4523,0.3692). More detal! of the phase-plane around the unstable point isshoVn in Figure 13. J 6, while Figure 13.17 shows more detail around the stable point.s4.03.02.01.01.0 2.0xFIGURE 13.15 Phase--planc for bioreactor with Monnd kinetics. x is biomassconcentration and s is substrate concelltration.ESCOLA Dc ENCEi'JHARIABIB L 10 'I L '"" 1 332. 322 Phase-Plane Analysis Chap. 130.0 ---------- --------- 0.05FIGUIU~ 13.16 Phase~planc behavior ncar the unstable point (0,4) (L:quiJibritlln1).0.40.31.4---------- 1.5FIGURE 13.17 Phase-plane behavior ncar the stable point (1.4523, 0.36(2)(Equilibrium 2). 333. Sec. 13.4 Nonlinear Systems0.5x, 0-0.511.51 0X2323FIGURE 13.18 Example of centerbehavior.In the previous examples the system trajectories "left" an unstable point and were "at~tracted" to a stable point. Another type of behavior that call occur is limit cycle or periodicbehavior. This is illustrated in the following section.13.4.1 Limit Cycle BehaviorIn Section 13.2 we noticed that linear systems that had eigenvalues with zero real portionformed centers in the phase plane. The plwsc-planc trajectories of the systems with celltel'sdepended on the initial condition values. An example is shown in Figure 13.18. Asomewhat related behavior that can occur in nonlinear sYStCll1S is known as limit cycle behavior,as shown in Figure J3.19.The major difference in center (Figure 13.1 R) and limit cycle (Figure 13.1 Iif ex;::: IThe population decreases during each lime period (converging to 0).The population increases during each time period (-----+ 00).The population remains constant during each time period.These results arc also shown in Figure 14.132.5Ddcalhs, and births ==deaths for the three cases. The result for 0: > I is consistent with Malthus. who in the nineteenthcentury predicted an exponential population growth.The result that the population increases to ex) for (X > J is a bit unrealistic. In practice,the amount of natural resources available will limit the total population (for the bacteriacase, the mnounl of nutrients or the size of the Petri dish will limit the maximumnumber of bacteria that can be grown). In the next example, we show a simple model that"constrains" the maximum population.14.3 A MORE REALISTIC POPULATION MODELA common model that has been used to predict population growth is known as the logisticequation or the quadratic map (May, 1976).( 14.9)Here, .r" represcnts a scaled population variablc (sec student excrcise 3).Note the similarity of (14.9) with the numerical methods presented in Chapter 3:X k , I ~ g(xk ) ( 14.10)Recall that direct substitution is sometimes used to solve a nonlinear algebraic equation.The next guess (iteration k+ 1) for the variable that is being solved for (x) is a funetioll ofthe current guess (iteration k). Equation (14.9) shows how the population changes fromtime period to time period----that is, it is a discrete dynamic equation. Since (J4.9) is thesame f011n as (14.10), we will learn a lot about the quadratic map frOTH analysis of the directsubstitution technique and vice versa. You will also note that many numerical integrationtechniques (Euler, Rungc-Kutla) have the fOHn of (14. [0).Since (14.9) is a discrete dynamic equation, we can determine the steady-state behaviorby finding the solution as k ------;. 00. Writing (14.9) ill a more explicit form,(X xlc.as we approach a steady-state (/Lred-poillt) solution, xk+l ::::: xk- so we can write:Xs 0' .:r, - (X .Y./"which can be written:"X,' - (" - I) x, ~ (JWe can use the quadratic formula to find the steady-state (fixed-point) solutions:(14.11 )(14.12)(14.13)ux, ~ 0 and(y1(14.14)It is easy to see from (14.9) that if the initial population is zero, it will renwin at zero. Fora n0I1-2erO initial condition, one would expect convergence (steady-state) of the populationto (0.' - l)/cl'_. We will use a case study approach to show that the actual long-term 345. Sec. 14.3 A More Realistic Population ModelTABLE 14.1 Parameters and Nonzero Solutions for Four CasesCase " XI,-I 2.95 0.66102 3.20 0.68753 3.50 0.71434 3.75 O.n33335(stcady~statc) behavior can be quite complex. Table 14.1 shows the (X parameter and thenon-zero stcady~stalc that is expected from (14.14).14.3.1 Transient Response Results for the Quadratic (Logistic) MapEach case presented in Table 14.1 has distinctly different dynamic behavior. As shown inthe following sections, case 1 illustrates asymptotically stable hehavior, cases 2 and 3 illustrateperiodic behavior, and case 4 illustrates chaotic behavior.ASYMPTOTICALLY STABLE BEHAVIORLet Xo represent the initial condition (the value of the population at the initial time) and .tkrepresent the population value at time step k. For case I we find the following values,using the relationship xk+l := 2.95 -'-"k (1 - l"k):Stepk xk Xk+!0 0.1 0.26551 0.2655 0.57532 0.5753 0.72083 0.7208 0.59374 0.5937 0.71165 0.7116 0.6054w 0.6610 0.6610The transient response for case 1 is plotted in Figure 14.2 for an initial condition of 0.1.Notice that the responsc converges to the predicted steady-state of 0.6610. This type of rcsponsefor continuous models is usually called asymptotically stable hehavior since theoutput converges to the steady-state (fixed-point) solution.PERIODIC BEHAVIORThe transient response curve forcase 2 is shown in Figure 14.3. The curve oscillates between0.513 and 0,800, while the predicted resull (equation 14.14 and Table 14.1) is 346. Introduction to Nonlinear Dynamics: A Case Studypopulation model, alpha 2.95Chap. 145010 20 30 403360.80.7c0.~ 0.6-S0-0 0.5 0-mm"0.4 C0.~c"0.3 E'50.2010time stepFIGlJllE 14.2 crransicnt population response, easel; cOllverges to singlesteady-state.population model, alpha::: 3.20.80.7c0.6 0~-S0- 0 0.50-mm" 0.4 C0.~c"E 0.3'50.20.10 10 20 30 40 50time stepFIGURE 14.3 Transienlpopulation response, case 2; oscillates between (,0values (pcriod-2 hehavior). 347. Sec. 14.3 A More Realistic Population Model 3370.6875. 'This type of response is known as pcriod-2 behavioL In case 3 the transient responseoscillates between 0.383, 0.827, 0.501, and runs as shown in r'igurc 14.4. This isknown as pcriod-4 behavior, since the system returns to the same slale value every fourthtime step.CHAOTIC BEHAVIORFor Case 4, the transient response never settles to a consistent set of values, as shown inFigure 14.5; rather the values appear to be somewhat "random" although a dctcnninislicequation has been used to solve the problem. Figure 14.6 shows that a slight change ininitial condition from 0.100 to O. J0 J leads to a significantly different poinHo-poinl rcsponsc--this is known as sensitivity to initial conditions and is characteristic of chaoticsystems.WHERE WE ARE HEADINGAt this point, you arc probably wondering how to predict the type of behavior that thcquadratic map is going to have. Changes in the (X parameter have led to many differenttypes of behavior. The purpose of Section J4.4 is to show how to predict the type of bc~haviorthat will he observed using cobweb diagrams. Section 14.5 will thcn introduce bifurcationplots, which reduce the long-term result.s from many transient plots to a singleplot. Section 14.6 introduces linear stability theory for discrete systems. Section 14.7shows how to find the period~l1 points.population model, alpha == 3.50.90.8co 0. 0.7.~"5 0.6 0.0.0.w 0.5 wC'"0. 0.4 .~coE'" 0.3'60.20.10 10 20time step30 40 50FIGURE 14.4 Transient population responsc,case 3; oscillates between fourvalues (periodA belmvior). 348. 338 Introduction to Nonlinear Dynamics: A Case Studypopulation model, alpha:o= 3.75Chap. 140.8c0~"30.00. 0.6""il''lC0iiic 0.4 illE'50.2oo 20 40time step60 80 100FIf;LJRE 14.5 Transient population response, case 4; chaotic behavior,population model, alpha:;;;: 3.751c 0.80 :g"30. 0.6 00.""il''lC 0.4 0iiicillE 0.2 '5075 80 !!!IIII 1IIIIII , 1/i85time step90! I'II95I" "100FIGURE 14.(j Transient population response, case 4; chaotic behavior (SolidLine-- -initial condition of Xo ;:;:: O. L Dashed Iinc----initial condition of Xo ::;0;0.10 I). 'This illustrates the sensitivity to initial conditions. 349. Sec, 14.4Xn+ 11Cobweb Diagrams 3390,7550,25"'- -L --'- -' --' x n 0,25 5 0,75 114.4 COBWEB DIAGRAMSFIGlJRE 14.7 Cobweb diagram forthe quadratic map problem. The initialpoint is -'0::;:;; 0.1.Insight to the behavior of discrete singlc~variablc systems can be obtained by constructingcobweb diagrams. Cobweb diagrams are generated by plotting two curves: (i) g(x) versus.r and (ii) x versus x; the solution (fixed-point) is at the intersection of the two curves. Forexampic, consider the case 1 parameter value of (y ::::: 2.95 and an initial guess, ):0 ::: 0, I,The xlI+1 =g(x) = 2.95 .tll (I -.1:) curve is shown as the inverted parabola in IillCgif>CillEi3Bifurcation and Orbit Diagramspopulatfon model, alpha ;:= 3.833430.1o 20 40time step60 80 100FIGURE 14.15 Period-3 behavior (after inllial transient) for Ci. =0 3.83, initialcondition;;:;; 0.1. Periodic values are x;:;;: 0.15615,0.50466, and 0.957417.!I ' + i' t t t +1 'I I, ," I Ii I / I' ' c 0.8 I I 0. I II I ~I I I I / I S I I I 0. f I 0. I I / 0. 0.6if> II I I I +,+ if>i I + '" +, + ill C / / / // / 0. 0.4 II I II II ijjI I I I C IIII I ill I I I I I I E / I I /"/ / i3 / /f / " I'I Y"/ I' 0.2 " I ~ t + + + + 4-075 80 85 90 95 100time stepFIGlJRE 14.Hj Pcriod-3 behavior for (~ ::;: 3.lB. Values arc x ;:;: 0.15615,0.50466, and 0.957417. 354. 344 Introduction to Nonlinear Dynamics: A Case Study Chap. 14Xn +l10.75050.25o &L__--' -'- -'-__---' Xn o 0.25 05 0.75 1FIGURE 14.17 Pcriod-J bclwvior at(X 0;:: 3.83. Values arc x:;:::; 0.156 S.0.50466. and 0.957417.Figure 14.15 plotted between 75 and 100 time ;.;tcps. The cobweb diagranl of Figure 14.17also shows the pcriod-3 behavior. Research has shown that pcriod-:, behavior implieschaotic hehavior.14.6 STABILITY OF FIXEDPOINT SOLUTIONSWhen we performed our case study, we found that case I converged to the predicted fixedpoint, while the other cases had periodic (or chaotic) solutions that were not attracted tothe fixed points. We wish now to usc an analytical method to determine when the solutionswill converge to the fixed-point solution ~ -that is, when is a fixed-point stable? Thefolloving stability theorem is identical to the stability theorem used for the numericalanalysis in Chapter 3.'~~"'-'--"Definition Let x'~ represent theJixed-fJoillf solution of x'o: :;::: g(x*'), or g(x''') -- x~':;::: O.Theorem .:r* is a stable solution of x* :;::: g(x*), if Ii_lg I O. There are now two real solutions; we will analyze the stability of each one.a. For solution J;the eigenvalue iswhich is stable.b. For solution 2:the eigenvalue isX= JlO.~,>,---2 Jl 0.5The bifurcation diagram (saddle-node) is shown in Figure 15.5..1l>.bleuns1l>.ble,which is unstable.xL,Jl = aFIGURE 15.5 Saddle-node bifurcation diagram, Example 15.2. 378. 368 Bifurcation Behavior of Single ODE Systems Chap. 15Notice that there are actually two steady-state solutions for .:re throughout the entire range of f.-l'For f.-l < 0 both solutions for xI' arc complex; for f.-l;;;; 0 both solutions for xI' flrc 0; for f.-l > () bothsolutions for xl' arc real.Dynamic Responses. Transient response curves for /L:= 1 are shown in Figure 15.6, for twodifferent initial conditions. Initial conditiolls .ro > -1 converge to a steady-slate of x;;;; I, vhilc.:ro < ~-1 approach x = ~oo. It should he noted that a consistent physical (or chemit:al) ~bascdmodel will not exhibit this sort of unbounded hehavior, since the variables will have some physicalmeaning and will therefore be bounded.Example 2. Jl = 1"0= - 0.990 1 _I-2 i"0=- 1.01-30 2 3 4 5timeFIGURE 15.6 Transient response for Example 15.2, !L;;;: 1. Initial conditionsor Xo > -I converge to a steady-state of x;;;: 1, while Xo < -I "blows up",EXAIVIl']"E 15.3 Transcritical BifurcationConsider the single variable system:.r ~ !(x,p.) ~ p.x - x'The equilibrium point is:The solutions arcThe Jacobian is( loY) 379. Sec. 15.3 Types of Bifurcations 369The eigenvalue is alsoA ~ jJ.-2x,.The bifurcation point is !(x, .....) = df/dx = 0, which occurs at fJ, = xe = O. The second derivative is:-2 * 0which indicates that there are two equilibrium 1'>0Iu60I1s. Now, we can find the stabil1ty of thesystem, as a function of the bifurcation parameter, IJ-.a. One solution is:with an eigenvalue:A = fl. - 2 x,. fl.,which is stable (since IJ-" is negative).b. This equilibrium solution is:which has the eigenvalue:A = IJ- - 2x" = J...le - 2IJ-e = -2!J..ewhich is unstable (since I-te is negative).II. jJ. > 0a. One solution iswhich has the eigenvalue:which is unstable.b. Another solution is:which has the eigenvalueA = JJ.. - 2 x" = fJ.,. - 2 IJ-"which is stable.-2 }L"These results are shown in the bifurcation diagram of Figure J5.7, which illustrates that the numberof real solutions has not changed; however, there is an exchange of stability at the bifurcationpoint. 380. 370 Bifurcation Behavior of Single ODE Systems Chap. 15xL, x= j!,, =-j!,stablex=o x=o----------of------------------ ,=j!,UIl.'ltable,=j!,stable, =-j!,UIl.'ltableFIGIJRE 15.7 Transcritical bifurcation, Example 15.3.Dynamic Responses. Transient response curves for the transcritical bifurcation arc shownin Figures 15.g and 15.9. Notice that the transient behavior is a strong function of the initial conditionfor the slate variable. For some initial conditions the state variable eventually settles at astable steady-state, while for other initial conditions the state variable blows up.Example 3. j!, = -I"0=- 0.991 -0.5-1iX -1.5-2-2.5-30"0 = - 1.012 6 8 10timeFlf;(JRE 15.8 Transient response for Example 15.3, J.-Limportance of initial conditions.---I. Notice the 381. 371timeTypes of Bifurcations-1FIGUH.E 15.9 Transient response for Example 15.3, fJ. ;:;;; 1. Notice the importanceof initial conditions.Sec. 15.3The next example is significantly dille-rent from the previolls examples. Here we allow Iwo parametersto vary and determine their effects on the system behavior.EXAMPLE 15.4 Hysteresis BehaviorConsider the system:( 15.9)which has Iwo parameters (u and /1-) that can be varied. We think of If as an adjustable input(manipulated variable) and f.L as a design-related parameter. We will construct steady-stateinput-output curves by varying II and maintaining /1. constant. We will then change /L and see ifthe character of the input-output curves (x versus II) changes. We first work with the casefL ~-1.I. fJ-;:;;; -1. The equilibrium point (steady-state solution) is:!(X,. fL) ~ 0 ~ II - x,. - x,: (15.10)The steady-state input-output diagram, obtained by solving (15.10) is shown in Figure 15.10.This curve is generated easily by first generating an x" vector, then solving If = xl' ,I x~.The stability of each point is found from:ill Iax XJlcwhich is always negative, indicaling that there arc no bifurcation points and that all equilibriumpoints are stable for this system. Contrast this result with that for /L 0;;; I, shown next. 382. 372 Bifurcation Behavior of Single ODE Systems,pie 3. )l = 101Chap. 15time6 8 10FIGURE 15.10 InpllHJUtput diagram 1,[ Example 15.41",, =-1.II. IJ-;:;;; 1. The equilibrium point (steady-state solution) is:f(X,,,ll) ~ 0 ~ II + x, - x; (15.11)Notice that this is a cubic equation that has three solutions for xI' for each value of ll. For example,consider u ;:;;; O.At u;:;;; 0:so,x" = 1,0, or I.The stability of each solution can be determined from the Jacobian:The eigenvalue is thcn A = 1 - 3 x;. For the three solutions, we find:XI';:;;; "-I,XC = 0,x,,= 1,A= 1-3=-2A=IA= 1-3=-2which is stable.which is unstable.which is stable.Now we can vary the input, If, ovcr a range of values and construct a steady-state input-outputcurve. These results are shown on the diagram of Figure 15.10 (the easiest way to generate thisfigure is to create an Xc vector, and then solve Itt' = ~xc + x;. See student exercise 2). 383. Sec. 15.32Types of Bifurcationsmu ~ 1-~-- ---- ---,. r----------T---- - --------.------- .. - ----,----- .. - ~-------....-.-----.--------373'" O -1 / ~~-2 .~-4 -3 -2 -1 0 2 3 4uFIGUrU~ 15. t I Input-output diagram for Example 15.4 with l-t 0= r.Notice that r O.The eigenvalues for the nontrivial solutions (Iii) are:andSo the nontrivial solutions arc stable for f.L> O. This means that a saddle point (trivial solution)is bounded by two stable nodes for this case, since the three solutions are:x, = [:;;] = [ - :~] with ~ = [~;] = [ ~2tj = stable nodex,. = Ixx""1 IO0 JW1It = 1 ~ =~I~2'J = [J_.LI,] = saddle pom. tIX.",.j IV~]W.[~I' = Ith A = 11,= -2_J.L1 = stable nodex 2,< 0 ~2, IWe notice the following phase-plane diagrams (Figure 16.1) as f.L goes from negative topositive. 394. 384 Bifurcation Behavior of Two-State Systems Chap. 16mu= --1 mu= 10.5 0.5~~ a ~~ a-0.5 -0.5-1 -1x, x,a. IJ < a b. u > aFIGURE 16.1 Pitchfork bifurcation behavior in the plane. There is a singlestahle node for /L < 0, and two stable (0) nodes and a saddle point (+, unstable)for 1-1 > 0,16.3 LIMIT CYCLE BEHAVIORIn Chapter 13 we noticed that linear systems that had eigenvalues with zero real portionformed centers in the phase-plane. The phase-plane trajectories of the systems with celltersdepended on the initial condition values, as shown in Figure 162 below. Differentinitial conditions lead to different closed-cycles.In this section, and the rest of this chapter, we are interested in limit cycle behavior,as shown in Figure 16.3. The major difference in conter (Figure 16.2) and limit cycle0.5x,-0.5-1-1.5-1 ax,FIGURE 16.2 Example of center behavior. 395. Sec. 16.3 Limit Cycle Behavior0.5x,0-0.5-1-1.51 0x,FIGURE 16.3 Example of limitcycle behavior.385(Figure 16.3) behavior is that limit cycles are isolated closed orbits. By isolated, we meanthat a perturhation in initial conditions from the closed cycle eventually returns to tbeclosed cycle (if it is stable). Contrast that with center behavior, where a perturhation ininitial condition leads to a different closed cycle.EXAMPLE 16.1 A Stable Limit CycleConsider the following system of equations, based on polar coordinates:j. ~ ,. (I - ,.')II ~(16.3)(16.4)Notice that these equations are decoupled, that is, the value of ret) is not required to find OCt) andvlee versa. The second equation indicates that the angle is constantly decreasing. The stability ofthis system is then determined frotH an analysis of the first equation.The steady-state solution of the first equation yields two possible values for r. The trivialsolution is r;o;; () and the nontrivial solution is r"'" 1.The Jacobian of the first equation is:ofar I - 3 r'We see then that tbe trivial solution (r:::;: 0) is unstable, because the eigenvalue is positive (+1).The nontrivial solution is stable, because the eigenvalue is -~2. Any trajeeto'y that starts outclose to r"'" 0 will move away, while any solution that starts out close to r;o;; I wiH move towardsr;o;; I. The time domain behavior for x [ is shown in Figure 16.4, Notice that we have convelicdthe states to rectangular coordinates (XI ;0;; r cos 0, x2 "'" r sin 0). The phase-plane behavior isshown in Figure 16.5. Initial conditions that are either "inside" or "outside" the limit cycle convergeto the limit cycle. 396. 386 Bifurcation Behavior of Two-State Systems1.5Chap. 160.5-1o 10 20time30 401.50.5.;;: 0-0.51FIGVRl 16.4 Stable limit cycle behavior (Example 16.1).X,F1GUH.E 1().5 Stahle limit cyclebehavior (Exi1mpleI6.1).The previous example was for a stable limit cycle. It is also possible for a limit cycle to beunstable, as shown in Example 16.2.EXAMPLE 16.2 An Unstable Limit C)'cleConsider the following system of equations, based on cylindrical coordinatesr(jr(l-r')I(16.5)(16.6)Again, notice that these equations are decoupled. The second equation indicates that the angle isconstantly decreasing. The stability of this system is then determined 0"0111 an analysis of thefirst equation. 397. Sec. 16.3 Limit Cycle Behavior1.53870.5-0.5-1.................../l ~! ---..~.~ ....-1.5-1 ox,FIGURE 16.6 Phase~plancbchaviorfor all unstable limit cycle.The steady-state solution of the first equation yields two possible values for r. The trivialsolution is r ::;: 0 and the nontrivial solution is r::;:: I.The Jacobian of the first equation is:iif()r~1+3r2We sec then that the trivial solution is stable, because the eigenvalue is negative (--1). The nontrivialsolution is unstable, because the eigenvalue is positive (+2), Any trajectory that stalts oulless than r = I will converge 10 the origin, while any solution that starts out greater than r ::::1will increase at an exponential rate. This leads to the phase~planc behavior shown in Figure 16.6.The time domain behavior is shown in Figure 16.7.1.5 --0.5oo_-------1...--._ .. L L..2 3time4 5 6FIGURE 16.7 Time domain behavior for an ullstable limit cycle. An initialcondition of 1'(0) = 0.9 converges 10 0, while an initial condition of r(O) = 1.05blows up. 398. 388 Bifurcation Behavior of Two-State Systems Chap. 16Examples 16.1 and 16.2 have shown the existence of two different types of limit cycles.Tn the first case (16.1) the limit cycle was stahle, meaning that all trajectories were "attracted"to the limit cycle. In the second case (16.2) the limit cycle was stahle, and all trajectorieswere "repelled" from the limit cycle. Although hoth of these examples yieldedlimit cycles that were circles in the plane, this will not normally be the casco Usually thelimit cycle forms morc of an ellipse. Now that we have covered limit cycle behavior, wearc rcady to determine what types of system parameter changes will cause limit cycle behaviorto occur. That is the subject of the next section.16.4 THE HOPF BIFURCATIONIn Chapter 15 we studied systems where the number of steady-state solutions changed asa parameter was varied. The point where the number of solutions changed was called thebifurcation point. We also found that an exchange of stability generally occurred at the bi~furcation point.A Hop/hifurcation occurs when a limit cycle forms as a parameter is varied. In thenext example we show a supercritical Horf bifurcation, where the system moves from astahle steady~slatc at the origin to a stable limit cycle (with an unstable origin) as a paramcteris varied.EXAMPLE Hi.3 SupercriticallIopf BifurcationConsider the systern:i] = Xl + Xl (p" - xf - xi). 0 the origin becomes unstable, but a stable limit cycle(with radius r::::: /iL) emerges.Here we analyze this system ill rectangular (xI - coordinates. The only' steady~stalc (fixed-pointor equilibrium) solution to (16.7) and (16.8) 15:Linearizing (16.7) and (16.8):atl _ 2 2 __~~1-l-3Xl-X2dX j ax,~ 2 Xl {,=-1-2xJx;dX)We find the Jacobian matrix:[ ~-' -xL-1-2:I,X'1J -2xl"X2,l-l-x~,.--3which is, for the equilibrium solution of the origin:The characteristic polynomiaL from det(,l- A) ::: 0, is:,'- 2~' + ~' + 1 ~ 0lhich has the eigenvalues (roots):2 401. 391Sec. 16.4 The Hopf Bifurcation+++We see that when ~ < 0, the complex eigenvalues are stable (negative real portion); when f.L::::: 0,the eigenvalues lie on the imaginary axis; and when f.L> 0, the complex eigenvalues are unstable(positive real portion). The transition of eigenvalues from the left~half plane to the right-halfplane is shown in Figure 16.10.~ < 0 ~ = 0 ~ > 0FIGURE 16.10 Location of eigenvalues in complex plane as a function of fL.A Hopf bifurcation occurs as the eigenvalues pass from the lefthand side to therighthand side of the complex plane.Example 16.3 was for a supercritical Hopf bifurcation, where a stable limit cycle wasformed. We leave it as an exercise for the reader (student exercise 6) to show the formationof a subcritical Hopt" bifurcation, where an unstable limit cycle is formed.We have found that the Hopf bifnrcation occurs when the real portion of the complexeigenvalues became zero. In Example 16.3 the eigenvalues crossed the imaginaryaxis with zero slope, that is, parallel to the real axis. In the general case, the eigenvalueswill cross the imaginary axis with non-zero slope.We should also make it clearer how an analysis of the characteristic polynomial ofthe Jacobian (A) matrix can be used to identify when a Hopf bifnrcation can occur. For atwo-state system, the characteristic polynomial has the form:a2(fl.) ),,2 + a,(fl.) )" + ao(fl.) = 0where the polynomial parameters, ai' are shown to be a function of the bifurcation parameter,fl. (It should also be noted that it is common for a2 = I). Assume that the a/fl.) parametersdo not become 0 for the same value of fl.. It is easy to show that a Hopf bifurcationoccurs when a,(fl.) = 0 (see student exercise 7).16.4.1 Higher Order Systems (n > 2)Thus far we have discuss Hopf bifurcation behavior of two-state systems. Hopf bifurcationscan occur in any order system (n ;:::: 2); the key is that two complex eigenvalues crossthe imaginary axis. while all other eigenvalues remain negative (stable). This is shown inFigure 16.11 for the three state case. 402. Bifurcation Behavior of Two-State Systems+ ~f--Chap. 16~t := a p > 0oop < 0FIGURE 16.U Locatioll of eigenvalues in complex plane as a function of /-L.A Ilop!" bifurcation occurs ns the eigenvalues pass from the lefthand side 10 therighthand side of the complex plane.392SUMMARYIn this chapter we have shown that the same bifurcations that oeemed in single-state sys~tems (saddle-node, transcritical, and pitchfork) also occur in systems with two or morestates. We have also introduced the Hopf bifurcation, which occurs when cmnplcx cigcn~values pass from the left-half plane to the right-half plane, as the bifurcation parameter isvaried. A HopI' bifurcation can also occur ill systems with more than two stales. F,'or a SllpcrcriticalHopfbifurcation, two complex conjugate eigenvalues cross from the left-hall' tothe right-hall' plane, while all of the other eigenvalues remain stable (in the left-half plane).FURTHER READINGThe following sources provide general introductions to bifurcation theory:Hale, 1., & H. Kocak (1991). DYl/mnics and H{flfrcatiol1s. Ncv York: SpringerVerlag.Strogatz, S.H. (1994). Nonlinear Dynamics and Chaos. Reading, MA: AddisonWesley.'I'he following textbook shows a complete exmnplc of the occurance of I[opf bifurcationsin a 2-state exothermic chemical reactor model:Varma, A., & M, Morhidclli. (1997). Mathematical Methods in Chemical Engineering.New York: Oxford University Press.STUDENT EXERCISES1. Show that the two-variable system1 ~ J;(x,f.l-) IL - xi.r, ~t;(x,f.l-) - -x,exhibits saddle-node behavior in the phase plane. 403. Student Exercises2. Show that the two-variable systemx, = f,(x,fL) = /LX, - xlx, = f,(x,fL) = -x,exhibits tnmscritical behavior in the phase plane.3. Show that the two-variable system:x, = f,(x,fL) = Ii + x, - xix, = J;(X,fL) = -x,393exhibits hysteresis behavior in the xl state variable. This means that, as u is varied,xe folJows an S-shaped curve, which exhibits the ignition/extinction behaviorshown in Chapter 15.4. Show that:can be written:;. = ,. (fL - r')0=-1if Xl = r cos () and x2 = r sin O.5. Consider a generalization of Example 16.3, which was a supercritical HopI' bifurcation(a stahle limit cycle);;. = r (fL - r')e= (f) + b r 2Discuss how w affects the direction of rotation. Also, discuss how b relates the frequencyand amplitude of the oscillations.6. Consider the following system, which undergoes a subcritical Hopi' bifurcation:r = /-L r + ,3 - r5Ii = w + b,.'Show that, for IJ- < 0 an unstable limit cycle lies in between a stable limit cycle anda stahle attractor at the origin. What happens when fL = 0 and fL > O'!7. Show that the condition for a HopI' bifurcation for the f()Uowing characteristic equationis al (!J-) = O. This is easy to do if you realize that a HopI' bifurcation occurs whenthe roots have zero real portion and write the polynomial in factored t~)rll1. 404. 394 Bifurcation Behavior of TWQ+State SystemsRelate this condition to the Jacobian matrix, A(/-t), realizing that:),2 _ tr(A(fL) ), + dct(A(fL = 0Chap. 16s. Consider a Hopf bifurcation of a three-state system. Realizing that one pole is negative(and rcal) and that the other two poles arc on the imaginary axis, relate the Hopfbifurcation to the coefficients of the characteristic polynomial of the Jacobian matrixarc:You can assume, without loss of generality, that a3(/-L) = 1. How do the conditionson the polynomial coefficients relate to the conditions on the Jacobian matrix (trace,determinant, etc.)? 405. INTRODUCTION TO CHAOS:THE LORENZ EQUATIONS 17The objective of this chapter is to present the Lorenz equations as an example of a systemthat has chaotic behavior with certain parameter values. After studying this chapter, thereader should be able to:Understand what is meant by chaos (extreme sensitivity to initial conditions) Understand conceptually the physical system that the Lorenz equations attempt tomodel.Understand how the system behavior changes as the parameter r is varied.'fhe major sections in thi:-; chapter arc',17.1 Introduction17.2 BackgroundJ7.3 The Lorenz EquationsJ7.4 Stability Analysis of the Lorenz EquationsJ7.5 Numerical Study of the Lorenz Equations(7.6 Chaos in Chemical Systems17.7 Other [ssucs in Chaos395 406. 39617.1 INTRODUCTIONIntroduction to Chaos: The Lorenz Equations Chap. 17In Chapter 14 we presented the quadratic ll1i:lp (logistic equations) and found that the tran~sient behavior of the population varied depending on the growth parameter. Recall thatwhen the qualitative behavior of a system changes as a function of a certain parameter, werefer to the parameter as a b(lurcalion parameter. As the growth parameter was varied, thepopulation model went through a series of period-doubling behavior, finally becomingchaotic at a certain value of the growth parameter. At that time we noted that chaos is pos~sible with onc discrete nonlinear equation, but that chaos could only occur in continuous(ordinary differential equation) models with three or more equations (assuming the modelis autonomous). In this chapter we study a continuous model that has probably receivedthe most attention in the study of chaos-the Lorenz equations. Before we write the equations,it is appropriate to give a brief historical perspective on the Lorenz model. For amore complete history, sec the book Chaos by James Cjlcick (1987).17.2 BACKGROUNDIn 1961, Edward Lorenz, a professor of Meteorology at MIT', Was simulating a reducedordermodel of the atmosphere, which consisted of twelve equations. Included werefunctional relationships between temperature, pressure, and wind speed (and direction)among others. He performed numerical simulations and found recognizable patterns tothe behavior of the variables, but the pattel11s would ncver quite repeat. One day he de~cided to examine a particular set of conditions (parametcr values and initial conditions)for a longer period of time than he had previously simulated. Instead of starting the entiresimulation over, he typed in a set of initial conditions based on results from midwaythrough thc previous run, started the simulation and walked down the hall for a cup ofcoffee. When he returned, he was shocked to find that his simulation results tracked theprevious run for a period of time, but slowly began to diverge, so that after a long periodof time there appcnred to be no conclation between the runs. His first instinct was tocheck for a computer error; when he found none, he realized that he had discovered avery important aspect of certain types of nonlinear systems~-that of extreme sensitivityto initial conditions. When he had entered the new initial conditions, he had done soonly to a few decimal places, whereas several more decimal places were carried inter~nally in the calculations. This small difference in the initial conditions built up over a periodof time, to the point where the two fUllS did not look similar. This discovery led tothe realization that long-term prediction of certain systems (such as the weather) willnever bc possible, no matter how many equations are used and how many variables aremeasured.In order to learn more about the behavior of these types of systems, he reduced hismodel of the atmosphere to the fewest equations that could describe the bare essel1tials~this required three equations. Here we discuss the "physics" of the three equations, whileSection 17.3 presents the equations and discusses the equilibrium solutions and stabilty ofthe equations. 407. 397Sec. 17.3 The Lorenz EquationsConsider a Huid maintained between two parallel plates, as shown in Figure 17.1.When the top plate temperature (T2) is equal to the hottom plate temperature (T,), there isno flow and the system is in equilibrium. Now, slowly increase the bottom temperature.At low temperature di ffcrcnces, there is still no llow because the viscous forces are greaterthan the buoyancy forces (the tendency for the less dense Huiet at the bottom to move towardthe top and the more dense lluid to move toward the bottom). Finally, at some criti(al temperature difference, the buoyancy forces overcome the viscous forces and the nuidbegins to move and form convection rolls. As the temperature difference is increased, thefluid movement becomes more and more vigorous. Although the following point may beless clear to the reader, for some systems there 1sa value of temperature difference thatwill cause the smooth convection rolls to break up and become turbulent or chaotic-.One can think of the speed of these convection rolls as wind speed in a miniature"weather model" and the direction of the convection rolls as wind direction.In the next section, we analyze the Lorenz equations, which attempt to model theilow pattern of Figure 17.1.FIGURE 17.1 Convection rolls dueto a temperature gradient in a fluidwhere density decreases as a functionof temperature (1'1 > 72),T,T,17.3 THE LORENZ EQUATIONSThe Lorenz equations are:x, = 1 (Ra> Rae) the temperature difference is large enough to cause motion.17.3.1 Steady-State (Equilibrium) SolutionsThe Lorenz equations have three steady-state (equilibrium) solutions under certain condi~tions. First, we present the trivial solution, then the nontrivial solutions. In Section 17.4we will determine the stability of each equilibrium solution.TRIVIAL SOLUTIONBy inspection we find that the trivial solution to (17.1 )-(17.3) is XL, = x2, = Xl.> = 0 (17.4)The trivial condition corresponds to no convective flow of the fluid.NONTRIVIAL SOLUTIONSFrom (17.1) we find that:(175)Substituting (17.5) into (17.3), we find thatx" = ~ xi" or:(17.6) 409. Sec. 17.4 Stability Analysis of the Lorenz Equations 399TABLE 17.1 Summary of the Equilibrium SolutionsState Variable Trivial SolutionoooNontrivial I(r> 0 required)Vb (r ~ I)Vj)~r -- INontrivial 2(I' > 0 required)Vh(r~ 1)-Vb(~-~ I)r 1Substituting (17.6) into (17.2) at steady~statc, we find',and substituting (17.7) into (17.6) and using tbe results of (17.5):x,," x2, =1 V';(r - I)For rcal solutions to (17.8), condition r ~ I must be satisfied. This Incans that for r < 1,there is only one real solution (the trivial solution), while for r > I there arc three rcal solutions.This is an example or a pitchfork bifurcation. For Ra < Rae' there is no convectiveflow. The equilibrium behavior is slIlllllwrizcd in Table 17.1.(17.7)(17.8)17.4 STABILITY ANALYSIS OF THE LORENZ EQUATIONSLinearizing (17.1 )-(17.3) around the stcady-statc j we find the following Jacobian matrix:( 17.9)which we will analyze to determine the stability of the equilibrium solution.17.4.1 Stability of the Trivial SolutionFor the trivial solution, XIs =x2.,:::: x:h:::: 0 , the Jacobian matrix is:(17.10)and the stability is determined by finding the rooIs of dCl(A1 ~ A):::: O. 410. 400 Introduction to Chaos: The Lorenz Equations Chap. 17(17.11 )IooA+h"-A o I':,"--- O. It is also easy to show that