B. Wayne Bequette
Process Dynamics
Modeling, Analysis, and Simulation
Prentice Hall International Series in the Physical and Chemical Engineering Sciences
PRENTICE IIALL INTERNATIONAL SERIES IN THE PHYSICAL AND CHEMICAL ENGINEERING SCIENCES
NEAL
R.
AnVISORY E1JJTORS
AN[)J{l~AS ACRIVOS,
S{(l!!(oI'r! Unil'ersify
JOHN DMII,ER,
'T'1l0MAS
University (d'IVlillllesO{{/
J.
IIANKATTY,
L.
Bi\LZlllSER, S;\:'IUEJ.S, Mm 1::l.uASSEN
E::. SCRIVEN,
Chemical !'.lIgilleaing ThennodYl/tllllics Process Oynamics: A1odcling, Analysis, and Simulatio/l BWUU.:R, CiROSS\\i\NN, AND WESTERBERG Sy.l"tcmafh' iHethods rd' Chemica! Process J)esij{11 CROWL and 1,()(JVA1{ Chemica! Process Sq(ety DFNN Process' Fl/lid lvlec!wlI/c"S [;'OGLER {:lemcfI!s q(Cllcmical Rcaction Engineering, 2nd I~'dition HANNA AND SANDA[J COll/putatiolla! Methods ill ChclIIical Engineering IIJ~IMI~LBLAU Basic Principles {{lid C(llcl/larions ill Chemical Engincering, 6th editioll HINES i\!>il) MADDOX Mass Tnl/lsjt'r KYLE Chemical and Proces..,. '1henllodyl1amics, 2nd edition NEWMAN Efectmchc/Ilical Systcms, 2nd edition PR;\tJSNll/., LICIITFNTIlMJ',R, and DL A/.l'VEDO Molecular Thermodynamics (~rFlllidPIUlse Eqlli/ihria, 2nd cdition PHrNTlC:E Elec!rochcmical Ellgincering Principles STEPHANOI'OULOS Chemical Process COlltrol TI~STER AND MOllF.!J. Thermodynamics (lnd Its /\pplicatio/ls, 3rd edition TURTON Analysis, SrI/thesis, and Design (~rChell/iCflI Processes
Br',QUFTrl::
PROCESS DYNAMICS
Modeling, Analysis, and Simulation
B. Wayne Bequette
Rensselaer Polytechnic Institute
To join a Prentice Hall PTR Internet mailing list, point to: http://www.prenhall.com/maiUists/
Library of Congl'l'ss
Catalogil1g~il1Pllblicatitm Data
Bequette, B, Wayne. Process dynamics: modeling, analysis, and simulation / B, Wayne Bequette.
p.
ern.
Includes bibliographical references and index, ISBN O,11206889~3 1. Chemical procc%es. I. Tille. TPI55,7.B45 1998 (j6()',2X4'OI185dc21
97 36053 elP
Acquisitions editor: Bernard M. Coodwin Cover design direcloc Jerry Votta Manufacturing manager: Alexis R. Heydt lvlilfketing Jnanllger: tvli1es Williams Compositor/Production services: Pinc Tree Composition, Inc.
(D 1998 by Prentice Hall PTR PrenticeHall, Inc. A Simon & Schuster Company Upper S,\dd\c River, Nnv Jersey 07458 .
Prentice Hall books arc widely"used by corporations anu govel'lllllent agencies for training, marketing, and resale. The publisherofkrs discoullts on this hook when ordered in bulk quantities. For more information contact: Corporate Sales Department Phone: 8003823419 Pax: 2012367141 Email: corpsalcs@prenhall.com
Or write:
Prentice Ifall PTR Corp. Sales Dept One Lake Sircet Upper Saddle Rivcr, New Jersey 07458 AI! rights reserved. Nl.J part of this book mily be rcpf(l(luced, ill any forlll or by any means, without permission in writing from the publisher. Printed in the United St,l!cs of Alllerica 10 9 8 7 6 5 4 J 2
ISBN: 0132068893
PrenticeHall Intcrnational (UK) Limited, LOlldoll PrcnticcHall oj" Australia Ply. Limited, Sydlley PrenliceHall Canada Inc.. Toronto PrcntieeFlall HispanOimlcricana, 5.A., Mexico PrenticeHall of India Private Limited. N('\\, IJdhi PrenliceHall of Japan, Inc" lilkyo Simon & Schuster Asia Pte. Ltd., Singapore Editora PrcnticcHall do Brasil. LtdH., Rio de .falleiro
CONTENTS
Preface
XVII
1.4 1.5
1.6
Motivation 3 Models 4 1.2.1 How Models Are Used 5 Systems 10 1.3.1 Simulation 10 1.3.2 Linear Systems Analysis 11 1.3.3 A Broader View of Analysis 11 Background of the Reader 12 How To Use This Textbook 12 1.5.1 Sections 12 1.5.2 Numerical Solutions 13 1.5.3 Motivating Examples and Modules 13 Courses Where This Textbook Can Be Used 13 Summary 14 Further Reading 14 Student Exercises 15
vii
viii
Contents
Process Modeling
16
2.1 2.2
2.3 2.4
2.5
Background 17 Balance Equations 17 2.2.1 Integral Balances 18 2.2.2 Instantaneous Balances 20 Material Balances 20 2.3.1 Simplifying Assumptions 25 Constitutive Relationships 27 2.4.1 Gas Law 27 2.4.2 Chemical Reactions 27 2.4.3 Equilibrium Relationships 28 2.4.4 Flowthrough Valves 29 Material and Energy Balances 30 2.5.1 Review of Thermodynamics 31 Distributes Parameter Systems 34 Dimensionless Models 35 Explicit Solutions to Dynamic Models 36 General Form of Dynamic Models 37 2.9.1 State Variables 37 2.9.2 Input Variables 2.9.3 Parameters 38 2.9.4 Vector Notation 38 Summary 40 Further Reading 40 Student Exercises 41
SECTION II
NUMERICAL TECHNIQUES
49
Algebraic Equations
51
3.4
3.5
Notations 51 General Form for a linear System of Equations 51 Nonlinear Functions of a Single Variable 54 3.3.1 Convergence Tolerance 55 3.3.2 Direct Substitution 55 3.3.3 Interval Halving (Bisection) 58 3.3.4 False Position (Reguli Falsi) 60 3.3.5 Newton's Method (or NewtonRaphson) 60 MATLAB Routines for Solving Functions of a Single Variable 3.4.1 fzero 63 3.4.2 roots 64 Multivariable Systems 64 3.5.1 Newton's Method for Multivariable Problems 66 3.5.2 QuasiNewton Methods 69
63
Contents
ix 70
3.6
MATlAB Routines for Systems of Nonlinear Algebraic Equations Summary 71 Further Reading 72 Student Exercises 73 Appendix 78
80
4.3
4.4
Background 80 Euler Integration 81 4.2.1 Explicit Euler 81 4.2.2 Implicit Euler 82 4.2.3 Numerical Stability of Explicit and Implicit Methods RungeKutta Integration 88 4.3.1 Second Order RungeKutta 89 4.3.2 FourthOrder RungeKutta 93 MATlAB Integration Routines 94 4.4.1 ode23 and ode45 95 Summary 97 Further Reading 97 Student Exercises 98
83
SECTION III
103 105
linearization of Nonlinear Models: The StateSpace Formulation 5.1 5.2 State Space Models 106 5.5.1 General Form of State Space Models 108 Linearization of Nonlinear Models 109 5.2.1 Single Variable Example 109 5.5.2 One State Variable and One Input Variable 5.2.3 Linearization of Multistate Models 112 5.2.4 Generalization 114 Interpretation of Linearization 117 Solution of the ZeroInput Form 119 5.4.1 Effect of Initial Condition Direction (Use of Similarity Transform) 120 Solution of the General StateSpace Form 127 MATlAB Routines step and initial 127 5.6.1 The MATLAB step Function 129 5.6.2 The MATLAB initial Function 129 Summary 130 Further Reading 131 Student Exercises 131
110
5.3 5.4
5.5 5.6
Contents
142
6.1 6.2
Background 143 Solving Homogeneous. Linear ODEs with Constant Coefficients 145 6.2.1 Distinct Eigenvalues 146 6.6.2 Repeated Eigenvalues 148 6.2.3 General Result for Complex Roots 152 Solving Nonhomogeneous. Linear ODEs with Constant Coefficients 152 Equations with TimeVarying Parameters 154 Routh Stability CriterionDetermining Stability Without Calculating Eigenvalues 157 6.5.1 Routh Array 157 Summary 160 Further Reading 161 Student Exercises 161 168
Motivation 168 Definition of the Laplace Transform 169 Examples of Laplace Transforms 170 7.3.1 Exponential Function 170 7.3.3 TimeDelay (Dead Time) 172 7.3.4 Derivations 173 7.3.5 Integrals 173 7.3.6 Ramp Function 174 7.3.7 Pulse 174 7.3.8 Unit Impulse 176 7.3.9 Review 177 Final and Initial Value Theorems 177 Application Examples 178 7.5.1 Partial Fraction Expansion 179 Table of Laplace Transforms 185 Summary 187 Further Reading 187 Student Exercises 187 190
8.1 8.2
8.3 8.4
Perspective 191 Responses of FirstOrder Systems 191 8.2.1 Step Inputs 193 8.2.2 Impulse Inputs 198 Examples of SelfRegulating Processes 200 Integrating Processes 206
Contents
xi
8.5
LeadLag Models 208 8.5.1 Simulating LeadLag Transfer Functions Summary 211 Student Exercises 211
209
215
Responses of SecondOrder Systems 216 9.1.1 Step Responses 217 9.1.2 Underdamped Step Response Characteristics 221 9.1.3 Impulse Responses 222 9.1.4 Response to Sine Inputs 224 SecondOrder Systems with Numerator Dynamics 226 The Effect of PoleZero Locations on System Step Responses 228 Pade Approximation for Deadtime 230 Converting the Transfer E;unction Model to StateSpace Form MATLAB Routines for Step and Impulse Response 234 9.6.1 step 234 9.6.2 impulse 236 Summary 236 Student Exercises 237
232
10
247
A SecondOrder Example 248 The General Method 251 MATLAB Routine ss2tf 252 10.3.1 Discussion of the Results from Example 10.2 Summary 257 Student Exercises 257 261
255
11
Black Diagrams 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8
Introduction to Block Diagrams 262 Block Diagrams of Systems in Series 262 PoleZero Cancellation 263 Systems in Series 267 11.4.1 Simulating Systems in Series 267 Blocks in Parallel 269 11.5.1 Conditions for Inverse Response 271 Feedback and Recycle Systems 273 Routh Stability Criterion Applied to Transfer Functions 11.7.1 Routh Array 277 SIMULINK 278
276
xii
Contents
280
12
282
12.4 12.5
Background 283 Linear Boundary Value Problems 283 Review of Methods for Linear Initial Value Problems 287 12.3.1 Linearization 187 12.3.2 Direction Solution Techniques 288 12.3.3 Rewrite the StateSpace Model as a Single nth Order Ordinary Differential Equation 289 12.3.4 Use Laplace Transforms Directly on the StateSpace Model 290 Introduction to DiscreteTime Models 290 12.4.1 Discrete Transfer Function Models 291 Parameter Estimation of Discrete Linear Systems 295 Summary 297 References 297 Student Exercises 298 SECTION IV NONLINEAR SYSTEMS ANALYSIS
301
13
303
13.4
Background 304 Linear System Examples 304 Generalization of PhasePlane Behavior 311 13.3.1 Slope Marks for Vector Fields 313 13.3.2 Additional Discussion 315 Nonlinear Systems 316 13.4.1 Limit Cycle Behavior 323 Summary 324 Further Reading 324 Student Exercises 324
14
Introduction Nonlinear Dynamics: A Case Study of the Quadratic Map 14.1 14.2 14.3 Background 332 A Simple Population Growth Model 332 A More Realistic Population Model 334 14.3.1 Transient Response Results for the Quadratic (Logistic) Map 335 Cobweb Diagrams 339 Bifurcation and Orbit Diagrams 342 14.5.1 Observations from the Orbit Diagram (Figure 14.14)
331
14.4 14.5
342
Contents
xiii
14.6
14.7
14.8
Stability of FixedPoint Solutions 344 14.6.1 Application of the Stability Theorem to the Quadratic Map 344 14.6.2 Generalization of the Stability Results for the Quadratic Map 346 14.6.3 The Stability Theorem and Qualitative Behavior Cascade of PeriodDoublings 348 14.7.1 Period2 348 14.7.2 Period4 351 14.7.3 Periodn 14.7.4 Feigenbaum's Number 353 Further Comments on Chaotic Behavior 354 Summary 354 References and Further Reading 355 Student Exercises 356 Appendix: Matlab MFiles Used in This Module 358
346
15
Bifurcation Behavior of Single ODE Systems 15.1 15.2 15.3 Motivation 360 Illustration of Bifurcation Behavior 361 Types of Bifurcations 362 15.3.1 Dynamic Responses 365 Summary 376 References and Further Reading 376 Student Exercises 377 Appendix 379
360
16
381
382
Background 381 SingleDimensional Bifurcations in the PhasePlane limit Cycle Behavior 384 The Hopf Bifurcation 388 16.4.1 Higher Order Systems (n > 2) 391 Summary 392 Further Reading 392 Student Exercises 392
17
395
Introduction 396 Background 396 The Lorenz Equations 397 17.3.1 SteadyState (Equilibrium) Solutions
398
xiv
Contents
17.4
17.5
17.6 17.7
Stability Analysis of the Lorenz Equations 399 17.4.1 Stability of the Trivial Solution 399 17.4.2 Stability of the Nontrivial Solutions 400 17.4.3 Summary of Stability Results 301 Numerical Study of the Lorenz Equations 402 17.5.1 Conditions for a Stable Trivial (No Flow) Solution 17.5.2 Stable Nontrivial Solutions 403 17.5.3 Chaotic Conditions 405 Chaos in Chemical Systems 407 Other Issues in Chaos 409 Summary 410 References and Further Reading 410 Student Exercises 411 Appendix 412
402
SECTION IV
Module 1
413
Introduction to MATlAB M1.1 M1.2 M1.3 M1.4 M1.5 M1.6 M1.7 M1.8 M1.9 M1.10 M1.11 M1.12 M1.13 M1.14
Background 416 Using This Tutorial 416 Entering Matrices 417 The MATLAB Workspace 419 Complex Variables 421 Some MATLAB Operations 421 Plotting 422 More Matrix Stuff 426 FOR Loops and IFTHEN Statements 427 mfiles 428 Diary 430 Toolboxes 430 Limitations to Student MATLAB 431 Contacting Mathworks 431 Student Exercises 432
Module
435
Motivation and Notation 436 Common Matrix Operations 436 Square Matrices 440 Other Matrix Operations 448 Summary 450 Student Exercises 450
Contents
xv
Module 3
452
Motivation 452 Least Squares Solution for a Line 454 Solution for the Equation of a Line Using MatrixVector Notation 455 Generalization of the Linear Regression Technique MATLAB Routines polyfit and polyval 458
456
Module
464
466
Module 5
Stirred Tank Heaters M5.1 M5.2 M5.3 M5.4 M5.5 M5.6 M5.7
471
Introduction 471 Developing the Dynamic Model 472 SteadyState Conditions 475 StateSpace Model 475 Laplace Domain Model 477 Step Responses: Linear versus Nonlinear Models Unforced System Responses: Perturbations in Initial Conditions 483
478
Module
490
Background 490 The Dynamic Model 491 SteadyState Analysis 495 Step Responses 496 Unforced Behavior 501
Module 7
Isothermal Continuous Stirred Tank Chemical Reactors M7.1 M7.2 M7.3 Introduction 506 FirstOrder Irreversible Reaction Van de Vusse Reaction 516 507
506
Module 8
529
Background 529 Modeling Equations 530 SteadyState Solution 534 Dynamic Behavior 535
xvi
Contents
linearization 536 PhasePlane Analysis 539 Understanding Multiple SteadyStates Bifurcation Behavior 549
540
Diabatic Continuous Stirred Tank Reactors M9.1 M9.2 M9.3 M9.4 M9.5 M9.6 M9.7 M9.8 M9.9
559
Background 560 The Modeling Equations 561 SteadyState Solution 563 Dynamic Behavior 565 linearization of Dynamic Equations 567 PhasePlane Analysis 571 Understanding Multiple SteadyState Behavior Further Complexities 580 Dimensionless Model 584
572
Module
10
Ideal Binary Distillation M10.1 M10.2 M10.3 M10.4 M10.5 M10.6 M10.7
597
Background 597 Conceptual Description of Distillation 599 Dynamic Material Balances 601 Solving the SteadyState Equations 603 Solving the Nonlinear Dynamic Equations 605 StateSpace Linear Distillation Models 606 Multiplicity Behavior 608
Index
617
PREFACE
An understanding of the dynamic behavior of chemical processes is ilnportant from bolh process design and process control perspectives. It is easy to design a chemical process, based on stcady~state considerations, which is practically uncontrollable when the process dynamics arc considered. The current status of computational hardware and software has made it easy to interactively simulate the dyo<:unic behavior of chemical processes.
xvii
xviii
Preface
An important feature of this text is the usc of MATLAB software. A set of Infiles used in many of the examples and in the learning nlodules is available via the world wide wcb at the following locations: http:/wwwhpi.cdu/hel}ueb/Process_Dynamics hHp:/www.mathworks.com/education/thirdparty.htm I Additional learning modules will also be available at the RPI location. A few acknowledgments arc in order. A special thanks to Professor Jim Turpin at the University of Arkansas, who taught me the introductory course in process dynamics and control. Ilis love of teaching should be an inspiration to us all. Many thanks to one of my graduate students, Lou Russo, who not only made a numher of suggestions to improve the text, but also sparked an interest in many of the undergraduates that h;:lVe taken the course. The {(Isk of developing a solutions manual has heen carried out by Venkatcsh Natarajan, Brian Aufderheide, l<amcsh Rao, Vinay Prasad, and Kevin Schott. Prelinllnary dratls of' many chapters werc developed over cappuccinos at the Daily Grind in Albany and Troy, Bass Ale served at the El Dorado in ~rroy promoted discussions about tcaching (and other somewhat unrelated topics) with my graduate students; the effect of the many Buffalo wings is still unclear. Final revisions to the textbook were done under the influence of cappuccinos at Cafe Avanti in Chicago (while there is a lot or effort in devcloping interactive classroom environments at Rensselaer, my ideal study environment looks much like a cofree shop), Teaching and learning should be dynamic processes. r would appreciate any comments and suggestions that yOll have on this textbook. I will use the WWW site to provide updated examples, additional problems with solutions, and suggestions for teaching and studying process dynamics.
B, Wayne RequeUe
SECTION
I
PROCESS MODELING
INTRODUCTION
This chapter provides a motivation for process modeling and the study of dynamic chemical processes. It also provides an overview of the structure of the textbook. After studying this chapter, the student should he able to answer the following questions: What is a process model?
Why develop a process model?
What is the difference between lumped parameter and distributed parameter systoms? What numerical package forms the basis for the examples in this text? What arc the major objectives of this textbook? The major sections arc: 1.1 1.2 1.3 1.4 1.5 Moti valion Models Systems Background or the Reader How to Use This Texthook
1.1
MOTIVATION
Robert Reich in Work {~lNations has classified three broad categories of employment in the United States. In order of increasing educational requirement these categories are:
3
nze
Introdu ction
Chap. 1
tic services. To diroutine production services, inperson services, and symboli canaly rectly quote from Reich:
l1ng symbols. They sim"Symbo lic analysts solve, identify, and broker problem s by manipula COlllabstract inmges that call be rearranged, juggled, experim ented with, plify reality into hack into reality. The mamunicat cd to other spc<:iaJists, and then, eventual ly, transfor med ce. The tools Illay be nipulatio ns arc done with analytic tools, sharpene d by experien lts, financial gimmick s, .rcief/rifle princiules, psycho lIlathematical algorithms, legal argmllcl n or deductio n, or any logical insights ahoUl how to persuade or to amuse, systems of inductio for emphasi s) other sct of techniqu es for doing conceptu al puulcs. " (italics added
. Process enginee rs Engineers (and particularly process enginee rs) are s)'mholic analysts that charact erize usc fundamental scientif ic principles as a hasis for mathem atical models physical variables, such the behavio r of a chemic al process. Symbol s are used to represe nt d and numerical alas pressure, tempera ture or concentration. Input informa tion is specifie . Process: enginee rs gorithm s arc llsed to solve the rnodels (simula ting a physical system) endatio ns regarding analyze the results of these simulat ions to make decisions or recomm the design or operation of a process. es in one way Most chemic al enginee rs work with chemic al manufactUling pmcc:':is l troubles hooting in or another. Often they arc process ergince rs responsible for technica ~Ire respons ible 1'01' dethe daytndeiY operatio ns nf a particld ar chemic al process. Some as tempera ture or pre.ssigning feedback control systems so that process variables (such ihle for redesigning a .sure) can he maintai ned at desired values. Others may be respons ibilities require an unchemica l process to provide more profitahility. All of these respons processes. derstan ding of the timede penden t(dynam ic) behavio r of chemic al
1.2
MODELS
an underst anding of 'fhe primary objectiv e of this textboo k is to assist you in develop ing g the dynami c bethe dynami c behavio r of c1\<?mical processes. A require ment for assessin under conside rahavior is a time~dcpendent mathematical model of the chemic al process ries for a def'inition. Before proceed ing, it is worth consult ing with two differen t dictiona tion of !nodel.
Didiona ry Definitions:
Mode!
as a noun, it means "a small Model is derived fro1l11he Latin modus, which means a measure . Used r's New World Dictiof/w y). represen tation of a pl<lIllled or existing object" (Webste ns, whose behavio r is "/\ mathema tical or physical system, obeying certain specified conditio it is analogou s in some used to understa nd a physical , biologic al, or social system to which way" (McGra wlIill Dietiof/ar.v (~f,)'cie1/t!fic and Techn;cal Tl~rms),
Sec. 1.2
Models
Notice that both definitions stress that a model is a representation of a system or ohject. In this textbook, when we usc the term model, we will be referring to a mathematical model. We prefer to usc the following definition f~)r model (more specifically, a process model).
Working Definition:
Pmccss Model
A process model is a set of equations (including the necessary input data to solve the equations) that allows us to predict the behavior of a chemical process system.
The emphasis in this text is on the development and lise offundamental or firstprinciples models. By fundamental, we mean models that are based on known physicalchemical rc~ lationships. This includes the conservation of mass and conservation of energy, I as well as reaction kinetics, transport phenomena, and thermodynamic (phllse equilibrium, etc.) relatiomdlips. Another common model is the empirical model. An empirical model might be used if the process is too complex for a fundamental model (either in the fonnulation of the model, or the numerical solution of the model), or if the empirical model has satisfactory predictive capability. An example of an empirical model is a simple least squares fit of an equation lo experimental data. Generally, we would prefer to use models based on fundamental knowledge of chemicalphysical relationships. Fundamental models will generally he accurate over .a mueh larger range of conditions than empirical models. Empirical models may be useful for "interpolation" but are generally not useful lilr "extrapolation"; that is, an empirical model will only be useful over the range of conditions used for the "fit" of the data. It should be nOled that it is rare for a single process model to exist. A model is only an approximate representation of an actual process. The complexity of a process model will depend on the final usc of the model. If only an approximate answer is needed, then a simplified model can often be lIsed.
1.2.1
As we have noted, given a set of input data, a model is used to predict the output "response." A model can be used to solve the following types of problems: Marketing: If the price of a product is increased, how much will the demand decrease? Allocation: If we have several sources for raw materials, and several manufacturing
101' course, the real conservalioll law is that of massenergy, but we will neglect the interchange of mass and energy due to nuclear reactions.
Introduction
Chap. 1
plants, how do we distrihute the raw materials among the plants, and decide what products each plant produces?
Synthesis: What process (sequence of reactors, separation devices, etc.) can he used
to manufacture a product? Design: What type and size of equipment is necessary to produce a product? Operation: What operating conditions willmaxirnizc the yield of a product? Control: How can a process input be manipulated to maintain a measured process output at a desired value? Safety: If an equipment failure occurs, what will he the impact on the operating personnel and other process equipment? Environmental: IIow long will it take to "biodegrade" soil contaminated with hazardolls waste? Many or the rnodels cited above arc based on a steadystate analysis. This book will cxtend the steadystate material and energy balance concepts, generally prescnted in an introductory textbook on chemical engineering principles, to dynamic systems (systems where the variables change with time). As an example of the increasing importance of knowledge of dynamic behavior, consider process design. In the past, chemical process design was based solely on steadystatc analysis. A problem with performing only a steadystate design is that it is possible to design a process with desirable steadystate characteristics (minimal energy consumption, etc.) but which is dynamically inoperable. Hence, it is important to consider the dynamic operability characteristics of a process during the design phase. Also, batch processes that arc commonly used in the pharmaceutical or specialty chemicals industries arc inherently dynamic and cannot bc simulated with steadystate models. In the previous discussion we have characterized models as stcadystate or dynamic. Another characterization is in ter111s 01" lumped porarneter system.) or distributed parameter systems. A lumped parameter systcm assumes that a variable or interest (temperature, for example) changes only with one independent variable (time, For cxamjJlc, but not space). A typical example of a lumped parameter system is a perfectly mixed (stirred) tank, where the temperature is uniform throughollt the tank. A distrihuted parameter system has more than one independent variable; for example, temperature may vary with both spatial position and time.
EXAMPLE 1.1
A Lumped Parameter System Consider a perfectly insulated, wellstirred tank where a hot liquid stream at 60 uC is mixed with a cold liquid stream at lone (Figure 1.1). The wc11~mixed assumption means that the fluid temperature in the tank is uniform and equal to the temperature at the exit from the t<mk. This is all example of a lumped parameter system, since the temperature docs not vary with spatial pOSition.
Sec. 1.2
Models
Hot Cold
iii
Outlet
FIGURE 1.1
Stirred lank.
Consider now the ~leadystale behavior of this process. If the only stream was the hot fluid, thell the outlet temperature wOl/ld be eqllal to the hot fluid temperature if the tank were perfectly insulated. Similarly, if the only stream was the cold stream, then the outlet temperature would be equal to the cold lluid temperature. A combination of the two streams yields an outlet tClJlpcrutufc that is intermediate between the cold and hot temperatures, as shown in Figure ] .2.
60
o
'0
f?
~
50
@
.2 40
'"
l
Q.
~ 30
8 20
10
_~~.l.l~~~~~~~~
ID
0.2
0.4
0.6
0.8
FIGURE 1.2
We sec that there is a linear steadystate relationship between the hot flow (fraction) and the outlet temperature. Now we consider the dynamic response to a change in the fraction of hot flow. Figure 1.3 compares outlet temperature responses for various step changes in hot flow fraction at t :::: 2.5
Introduction
Chap. 1
minutes. We sec that the changes afC symmetric, with the same speed of response. We will find later that these responses afC indicative of a lincar system.
45
+20%
o
E
ci:
40
20%
25
20
, ..
,.'
10
15
time, min
20
25
30
FIGlJRE 1.3
EXAMPLE 1.2
A simplified representation of a counterflow heat exchanger is shown in Figure lA. A cold water stream flows through one side of the excbanger and is heated by energy transfcrcd fro!ll a condensing steam ,,,trcam. This is a distributed parameter systcnl because the tClnperature of the water stream can change with lime and position.
Water in
~IF=:
FIGURE 1.4 Counterflow heat exchanger.
Steam in
The steady~slate tell1perature profile (water temperature as a function of position) is shown in Figure 1.5. Notice that rate of change of the water temperature \vith respect to distance decreases as the water tcmpenlturc approaches the steam teinpcrature (I OOOe). This is because the tcmper
Sec, 1,2
Models
ature gradient rOf heat transfer decreases as the water temperature increases. The outlet water temperature as a function of inlet water temperature is shown in Figure 1.6.
100
80
0
60
40
20
0.2
0.4
Z,
0.6
distance
it
0.8
Flf;LJlU: 1.5
W::tter temperature as
function of position.
100 98 96
0
94 92 90 88 86
20
40
60
80
100
FIGURE 1.6
10
Introduction
Chap. 1
Mathematical models consist of the following types of equations (including combinations) Algebraic equations Ordinary differential equations Partial differential equations The emphasis in this textbook is on developing models that consist of ordinary differential equations. These equations generally result from macroscopic balances around processes, with an assumption of a perfectly mixed system. To find the steadystate solution of a set of ordinary differential equations, we must solve a set of algebraic equations. Partial ditTerential equation models result from microscopic b<tlanccs and arc not covered in this textbook. One of the main techniques for solving partial differential equations is !:nlsed on converting a partial differential equation to a set of ordinary differential equations. Techniques deYeloped in this textbook can then be lIsed to solve these problems,
1.3
SYSTEMS
We have been using the term system yery loosely. Consider the following definition.
Dctinition:
Svstem
A combination of several pieces of equipment integrated to perform a specific function; thus a fire (arlillery) control system may include a tracking radar, computer, and gun (McGrawHill Dictiolimy (?f5;ciellt!fic and Technical Tenns).
The example in the definition presellted is of interest to electrical, aeronautical, and rnilitary engineers. I'or our purposes, a system witl be composed of chemical unit operations, such as chemical reactors, heat exchangers, and separation devices, which arc used to producc a chemical product. Indeed, we will oftcn consider a single unit operation to be a system composed of inputs, states (to be defined later) and outputs. A series of modules in Section V of this textbook cover the behavior of a number of specific unit operations.
1.3.1
Simulation
One of the goals of this textbook is to develop numerical analysis techniques that allow liS to "simulate" the behavior of a chemical process, Typically, steadystate simulation of a lumped parameter system involves the solution of algebraic equations, while dynamic simulation involves the solution of ordinary differential equations. We must be careful when using computer simulation. First of all, we must he able to say, Do the results of this
Sec. 1.3
Systems
11
simulation make sense? Common sense and "back of the envelope" calculations will tell us if the numerical results arc in the ballpark.
1.3.2
The mathematical tools that arc lIsed to study linear dynamic systems problems me known as linear systems analysis techniques. Traditionally, systems analysis techniques have been based on linear systems theory_ Two basic approaches arc typically used: (i) Laplace transforms afC lIsed to analyze the behavior of a single, linear, nth order o("ciinary differential equation, and (ii) state space techniques (based on the linear algebra techniques of eigenValue and eigenvector analysis) arc used to analyze the behavior of multiple firstorder linear ordinary differential equations. If a system of ordinary difreren~ tial equations is nonlinear, they can be linearized at a desired steadystate operating point.
1.3.3
In this textbook we usc analysis in a broader context than linear systems analysis that may be applied to a model with a specific vallie for the pararnetcrs. Analysis means seeking a deeper understanding of a process than simply performing a simulation or solving a set of equations for a particular set of parameters and input values. Often we want to understand how the response of system variablc (tempera.ture, for example) changes whcn a parametcr (c.g., heat transfer coefficient) or input (fJowrate or inlet temperature) changes. Rather than trying to obtain the understanding of the possible types of behavior hy merely running many simulations (varying parameters, etc.), we must decide which parameters (or inputs or initial conditions) are likely to vary, and use analysis techniques to determine if a qualitative change ofhehavior (number of solutions or stability of a solution) can occur. This qualitative change is illustrated in l';'igure 1.7 below, which shows possihle steadystate behavior for ajackcled chemical reactor. In l<'igure 1.7a there is a monotonic
Jacket Temperature
Jacket Temperature
a. Monotonic
b. MUltiplicity
FIGlJRE l.7 Two qualitatively differclll types of input/output behavior. Steadyslale reactor temperature as a function of steadystate jackct lelnperalurc.
12
Introduction
Chap. 1
relationship between jacket temperature and reactor temperature, that is, as the s(cady~ state j;:lckct temperature increases, the steadystate reactor temperature increases. Figure 1.7b illustrates behavior known as output multiplicity, that is, there is a region of stcadystate jacket temperatures where a single j'H.:kct temIJcraturc can yield three possible reactor temperatures. In Chapter 15 (and module 9) we show how to vary a reactor design pa~ wllleter to change from one type of behavior to another. Engineering problem solving can be a comhination of art and science. 'rile complexity and accuracy of a solution will depend on the information available or what is dc~ sired in the final solution. If you arc simply performing a rough (back of the envelope) cost estirnatc for a process design, perhaps a simple stcady~state material and energy bal~ ance will suffice. On the other hand, if an optimum design integrating several unit operations is required, then a more complex solution will be involved.
1.4
1.5
1.5.1
Sections
In Section I (Chapters ] and 2) we show how to develop dynamic models for simple chemical processes. Numerical techniques for solving algebl'<ric and differential equations are covered in Section II (Chapters 3 and 4). Much of the textbook is based on linear system analysis techniques, which arc presented in Section III (Chaptcrs 5 through l2). Nonlinear analysis techniques are prescnted in Section IV (Chapters 1317). Section V (Mod~
Sec. 1.6
13
uks 1 through lO) consists or a number of learning modules cussed in Sections I through IV.
1.5.2
Numerical Solutions
It is much casier to learn a new topic by "doing" rather than simply reading about it. To understand the dynamic behavior of chemical processes, one needs to he able 10 solve differential equations and plot response curves. We have used the MATLAB numerical
analysis package to solve equations in this text. AMATL.AB learning module is in the set
l~ulliliar
with or need to be
reintroduced to MATLAB. MATLAB routines arc detailed within the chapter that they arc used. Many of the examples haveMA"rLAB mfiles associated with them. It is recom~ mended that the reader modify these Illfiles to understand the effect of parameter changes
1.5.3
This textbook contains III any process examples. Often, new techniques arc introduced in the examples. You are c.ncouraged to work through each example to understand how a palticular technique can be applied. There is a limit to the complexity of an example that can he used when introducing a new technique; the examples presented in the chapters tend to be short and illustrate one or two numcricaltcchniqucs. 'fhere is a set of modules of t11odeb, in Section Y, that treats process examples in much more dclail. The objective of these modules is to provide a more complete treatment of modeling and simulation of a specific process. In each process modehng module, a numher of the techniques introduced in various chapters of the text arc applied to the problem at hancL
1.6
14
Introduction
SUMMARY
At this point, the reader should be able to define or characterize the following Process model Lumped or distributed parameter system
Analysis Simulation
FURTHER READING
The textbooks listed below are nice introductions to material and energy balances. The Russell and Denn book also provides an excellent introduction to models dynamic systems.
or
Felder, R.M., & R. ROllsseau. (1986). Processes, 2nd cd. New York: 'Wiley.
ElementalY Principles
ql Chemica!
Hinmlclblau, D.M. (1996). Basic Principles and Colclllation.'; ill Chemical E'/lJ;i/leering, 6th cd. Upper Saddle River, NJ: PrenticeHall. Russell, T.R.F., &M.M. Denn. (1971). Introduction to Chemico! !'.'nginecrin/!.
n.M. (199]). Engineering ProlJlem Soh'ing Ivilh MATLAB. Upper Saddle River, NJ: PrenticcIlall.
E~tter,
D.M. (t096). Introduction to MA TLAU ,Ii)r engineers (/nd c)'CiCllfists. Uppcr Saddle Rivcl', NJ: Prenticerlalt.
The following book by Dcnn is a graduatelevel text that discusses the more philosophical issues involved in process modeling.
Denn, M.M. (1986). Process iV/odcling. New York: Longman. An undergraduate control textbook with significant modeling and sitnulation is by Luyben. Numerous FORTRAN examples are presented.
Luyben, \V.L. (1990). Process Modeling, 5'imulatioll alld Control for Chemical EI1Rineers, 2nd cd. New York: McGrawHilL
Student Exercises
15
[~xal11p1cs
include:
Seborg, D.E., TJ'. Edgar, & D.A. Mellichamp. (1989). Process Dynamics and COIltrol. New York: Vhley. Stephanopmdos, G. (l9X4). Chemical Process Control: An Introduction to Theory and Pract{(e. r':nglewood Clift's, NJ: PrenticeHall. The following book by Rameriz is more of all advanced undergraduHtelfirstycar graduate student text on numerical methods to solve chemical engineering problems. The emphasis is on FORTRAN subroutines to be used with the IMSL nmlleriea! package. Rameriz, W.F, (1989). Computational 111ethods for Process SiJllulalioJl. Boston: Butterworths. Issues in process modeling are discllssed by IIimlllelblau in Chapter :1 or the following book: Bisio, A., & R.I.. Kabel. (1985). S'c'oleujJ
(~l ('hemicol
The following book by Reich provides an excellent perspective on the glohal ecollomy
and role played by U.S. workers Reich, R.B. (1991). The Work qFNatiolls. New YOJ'k: Vintage Books,
STUDENT EXERCISES
1. Review the matrix operation:; module (Section V).
2. \Vork through the MATLAB module (Section V),
3. Consider example 2. If there is a sudden increase in stearn prc.l;surc (and therefore, temperature) sketch the expected eoJd~sjde temperature profilel; at 0, 25, 50, 75, and loor;;;) or the distance through the heat exchanger.
PROCESS MODELING
In this chapter, a methodology for developing dynamic models of chcmicL11 processes is presented. After studying this chapter, the student should be able to: \Vritc balance equations using the integral or instantaneous methods. Incorporate appropriate constitutive relationships into the equations. Determine the state, input and output variables, and parameters for a particular model (set of equations). Determine the necessary in!~)tmatjon to solve it system of dynanlic equations. Define dinlcnsionlcss variables and parameters to "scale" equations. 'file major sections arc: 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 Background Balance Equations Material Balances Constitutive Relationships Material and Energy Balances DistribulcdParamclcr Systems DimcllsionlcssModels Explicit Solutions loDynamic Models General ItOI'm
or Dynamic Models
16
Sec. 2.2
Balance Equations
17
2.1
BACKGROUND
Many reasons for developing process modeLs were given in Chapter 1. Improving or unm(~jor overall objective for developing a dynamic process model. These models arc often used for (i) operator training, (ii) process design, (iii) safely system analysis or design, or (iv) control system design.
Operator Training. The people responsible for the operation of a chemical manufacturing process arc known as process operators. A dynanlic process model catl be lIsed to perform simulations to train process operators, in the same fashion that flight sjm~ ulators arc used to train airplane pilots. Process operators call learn the proper response to upset conditions, before having to experience theill on the actual process.
Process Design. A dynamic process model call be llsed to properly design chcmical process equipment for a desired production rate. F'or example, a model of a batch chemical reactor can be used to determine the appropriate size of the reactor to pro~ duce a certain product at a desired rate. Safety. Dynamic process models can aLso be used to design safety systems. For example, they can be llsed to determine how long it will takc after a valve Ltils for a system to reach a certain pressure. Control System Design. Feedback control systenls arc used to maintain process variables at desirable valucs. For cxample, a control system may measure a product temperature (an output) and adjust the steam Ilowratc (an input) to maintain that desired temperature. r'or complex systems, particularly those with many inputs and outputs, it is necessary to base the control system design on a process model. Also, before a COI11plex control system is implemented on a process, it is normally tested by simulating the expected performance u~ing computer simulation.
2.2
BALANCE EQUATIONS
The emphasis in an introductory matcrial and energy balances tcxtbook is on steadystate balance cquations that have the rollowing form:
mass
01
energy]

mass or e'l1crgy :
I
F~qlU1tion
cntcnng a systcm
leaving
(l
(2. I )
systcm
(2,1 )is deccptively simple becausc there may be many ins and outs, particulmly for component balances. The in and out terms would then include thc gcneration and con
18
Process Modeling
Chap. 2
version of species by chemical reaction, respectively. In this text, we arc interested in dynamic balances that have the form:
rate of mass (~r CT~crgyl rate of mass or accumulation 111 = .energyentering [ [ a system a system
1,

The rate of mass accumulation in a system has the form dM/dl where M is the total mass in the system. Similarly, the rate of energy accumulation has the form dEJdt where E is the total energy in a system. H Hi is llsed to represent the moles of component i in a system, then dN/dt represents the molar rate of accumulation of component i in the systclll. \Vhcn solving a problem, it is important to specify what is meant by system. In some cases the systcl1lmay be microscopic in nature (a e1i/Terential clement, for example), while in othcr cases it may be macroscopic in naturc (the liquid content of a mixing tank, for example). Also, when developing a dynamic model, we can take one of two general viewpoints. One viewpoint is based on an ifltegral balance, while the other is based on an instml{(lIIcoll.\ balance. Integral balances arc particularly useCul when developing models for distributed parameter systems, which result in partial differential equations; the focus in this text is on ordinary differential equationbased models. Another viewpoint is the instantaneous balance where the time rate of change is written directly.
2.2.1
Integral Balances
An integral balance is developed by viewing a system at two different Sll<l!'S!lots in timc. Consider a finite time interval, D.t, and perform material balance over that time interval
mass or energy
inside the system
I

[mass or energy
inside the system all
[
.
atl+tJ.1
(2.3)
It om I to I
tJ.1
The rneanvalue theorems of integral and differential calculus are thcn used to reduce the equations to differential equations. F'or example, consider the system shown ill F'igure 2.1 below, where one boundary represents thc mass in the systcm at time t, while the other boundary represents the mass in the system at t + i1t. An integral balance 011 thc total mass in the system is writtcn in the form:
Sec. 2.2
Balance Equations
mass in system at time
=:
19
t
,r
)If
m (f) OUf
FIGURE 2.1 Conceptual material balance prohlem.
n~ass contained
III
the system
I rn~ass
In
I
=
all+Llt
Ir

from t to (
D.,
hom I to t I nl
MI'i"'  MI,
J(,izi"  ,iz,,,,,l dl ,
(2.4)
where M represents the total mass in the system, while filill andli1()111 represent the mass rates elltering and leaving the system, respectively. We can write the righthand side of (2.4), using the mean value theorem of integral calculus, as:
1+ !:J./
f ,
(';/ill  filma> dl
dividing by dt,
l!nM
and using the mean value theorem of dUferentia! calculus (0 < ~ < I) for the Icfthand side,
MI"",~
/>1
MI,
,1M,
;it
[+IUI
20
Process Modeling
Chap. 2
which yields
dM ~i; I I ~
. .
lIj.f
= mill 
.
111,,,,(
(2.5)
and representing the total mass as M = VP"h ifl as FillPill andlilo!ll as FOII/p, where p is the mass density (mass/volume) and F is a volumetric nowrate (volume/time) we obtain the equation:
(2.6)
Note that we have assumed that the system is perfectly mixed, so that the density of material leaving the system is equal to the density or material in the system.
2.2.2
Instantaneous Balances
ratc~of~
Here we write the dynamic balance equations directly, based on an instantaneous change:
l
or
I
I
I
=.::
I
dM
rate of
mass entering
]

1..
rate of
mass leaving
mass
III
the system
the system
the system
. 1
(2. 7)
df 
(2.8)
dVp ~ d/
(29)
which is the same result obtained using an intcgral balancc. Although the integral balancc takes longer to arrivc at the same resull as the instantaneous balancc method, the integral balance method is probably clearer whcn dcvcloping distributed parameter (partial differential equationhased) models. An cxnmplc is shown in Section 2.6. Section 2.3 covers material balances and Section 2.5 covers material and energy balances. Section 2.4 discusses constitutive relationships.
2.3
MATERIAL BALANCES
'l'he simplcst modeling problems consist of material halances. [n this section we usc several process exarnples to illustrate the modeling techniques used,
Sec. 2.3
Material Balances
21
~
~~

EXAIVIPLE 2.1
Surge tanks arc often Llsed to "smooth" f10wratc fluctuations in liquid streams f!mvillg between chemical processes. Consider a liquid surge tank with one inlet (flowing from process I) and one outlet stream (flowing to process Ii) (Figure 2.2). Assume that the dellsity is constant. Find how the volume of the tank varies as a function of time, if the inlet and outlet flowratcs vary. List the s((ltc variables, [Jarometers, as weI! as the il/fJut and oll/Im/voriables. Give the necessary information to complete the quantitative solution to this prohlem.
v
_ _ _ _ _ L F
FIGUnE 2.2
The system is the liquid in the lank, the liquid surface is the top boundary of the system. 'rile following notation is used in the modeling equations:
F, F
~
inlet volumetric r10wrate (volume/time) outlet volumctric f10wratc volumc of liquid in thc tank liquid dcnsity (mass/volullle)
Integral i\'lethod
Consider a fillite time intcrval, !J.l. Performing a material balance over that time interval,
J11dSS 01 \Vdlel] [tlldSS 01 WdtCl ] lllslde the lank  lllSldc the td.nk <it I I
!J.t
elt I
from I to t 1 ill
which we can write InalhcmaticaHy as:
(', .3.1 1\':'1
Jr:p dt
Fpdl
(2.10)
ESCOL/\ Dc Ei CIULlO
22
Bringing the righthand side terms under the same integral
1;"\/
Procoss Modeling
Chap.2
J(r,:p
Ii,) rlr
(2.11 )
We can lise the mean value theorem of integral calculus to write the righthand side of (2.11) (where 0 So: 0' :::; 1) as:
I !j{
dl
(2.12)
Vpll'''' vpll
Dividing by f),.t, we obtain
(2.13)
PI","
(214)
dVp dt
(2.15)
InstantaneOllS Method
Here we write the balance equations based on an inslautancOU:i rate ofchange:
the rate of ch,~ngc of I = I.mass n~l\vratc (}C..I Imass flowratc ofI mass 1 of water tank _water lllln tank water out of tank_
III
The total mass of water tn fhe tank is Vp, the rate of change is dVp/dt, <:Inc! the density of the outlet stream is equal to the tank contents:
dyp
dt
(2.16)
which is exactly what we derived using the intcf{ral method. Given the same set of assumptions the two methods should yield the sam<.~ rnodel. You should usc the approach (integral or instantaneous) that makes the most sense to YOL!o In this. text we generally usc the illstantaneous approach since it requires the fewest number of steps. Notice the implicit assumption that the density of water in the tank docs not depend upon position (the perfect mixing assumption). This ai>sumption allows an ordinary differential cqlJa~ tion (ODE) formulation. \Ve refer to any system that can be modeled by ODEs as lumped parameIer systems. Also notice that the outlet stream density must be equal to the density of water in the tank. This knowledge also allows us to say that the density terms in (2.16) arc equal. This equation is then reduced 101
lit might he tempting to the reader to begin to direuly write "volume balance" exprt'ssions that look similar to (2.17). We wish to make it clear that therc is llO such thing as a volume balance and (2017) is only correct hecause of the constant density assumption. It is a good idea to always write a mass balance expn:ssion, such ::1S (2.16), before making as~;umpti()ns about the fluid density, which Jllay lead to (2.17).
Sec. 2.3
Mntcrial Balances
dV dt
23
1;  F
(2.17)
Equation (2.17) is it lineDr ordinary dilTcwntial equation (ODE), which is trivial to solve if we know the inlet and outlet flowmtes as a fllnction of time, and if we know all initial condition for the volume in the wnk. In equation (2.17) we refer to Vas a slale variable, and F; nnc! F as input variah!cs (even though Fis an outlet stream flowratc). If dellsity remained in the equatioll, \VC would refer to it as a /NlrWJlctcF. tn order to solve this problem \ve nlUst specify the inputs F/t) andF(t) and the initial con
dition \1(0).
Exanlple 2.1 provides all introduction to the notion of states, inputs, and parameters. This cxarnple illustrates how an overall material balance is llsed to find how the volume of a liquid phase system changes with time. It may he desirable to have tank height, II, rather than tank volume as the slate variable. If we aSSUlllC a constant tank crosssectional area, ll, we call express the tank volumc as V = Aft and the modeling eqU<:ltion as dli dl
F (2.18)
it
If we also know that the flowrate out of the tank is proportional to the square ront of the height of liquid in the tank, wc can usc the relationship (sec student exercisc 21) F = [3VIi (2.19)
[3VIi
,(
I
(2.20)
For tbis model \ve refcr to h as the stole variablc, inlet nowrate (F) as the input variable and f3 and A as parameters. Notice that a single system (ill this case, the liquid surge tank) can have slightly different modeling equations and variables, depending on assumptions and thc objectives used whcn dcveJopiug the model.
EXAi\iIPI.,E 2.2
Assume that two chemical species,;\ and 8, arc in a solvent feedstream entering a Iiquid~phase chemical reactor that is maintained at a constant tcmperature (l"igurc 2.3). The two spec'lc::, react irreversibly to form a third species, F. Find the reactor concentration of each species as a ftlllClion of time.
24
F.
I
Process Modeling
Chap. 2
F
C
FIGlJRE 2.3
(2.21)
ASSlIIllption:
The liquid phase density, p, is not a function of concentration, The tank (and outlet) density is then cqllallo the inlet density, so:
(2.22)
dV tit
(2.23)
The component material balance equations are (assuming no component P is in the feed to the reactor):
(Ive A
dt dVC II dl dVC,. dl
(2.24)
(2.25)
(2.26)
Sec. 2.3
Material Balances
25
Where 1~4' rr;, and I'p represent the rate of generatioll of species;\, II, and P per unit volume, and (~li and C'/li represent the inlet coneentallons of species A and N. Assume that the rate of reaction of A per unit volume is secondorder and 11 function of the concentration of both A and B. The reaction rate can be written
(2.27)
where k is the reaction rate constant and the minus sign indicates that A is consumed ill the reaction. Each mole of A reacts with two moles of If (frotH the stoichiometric equation) and produces olle mote of I), so the rates of generation of Band P (per unit volume) arc:
(2.2X)
(2.29)
Expanding the [cftlland side of (2.24),
dVC A
df
f'
C dV
'/I
dt
(2.30)
(2.31)
Similarly, the concentrations of n aud P call be written
dell
df
(2.32)
(2.33)
This model consists of four differential equations (2.23, 2.31, 2.32, 2.33) and, therefore, four state variables (V, c~\, C n. and C,,). To solve these equations, we must specify the initial conditions (V(O), CA(O), C/:I(t, and C,,(O)), the inputs (Fi . C Ai, and e/li) as a function of time, and the parameter (k).
2.3.1
Simplifying Assumptions
The reactor model presented in Exalnple 2.2 has four differential equations. Often other simplifying assumptions arc made to reduce the number of differential equations, to make theln easier to analyze and faster to solve. For example, assmning a constant volume (dVldt:::: 0) reduces the number of equations by one. Also, it is common to feed an excess of one reactant to obtain nearly completc conversion of another reactant. If species B is maintained in a large excess, then CHis nearly constant. The reactioll rate cqual'101l can then be expressed:
I'.1
(2.34)
26
where
kl
=
Process Modeling
Chap. 2
kel/
(2.35)
equation~
de"
cit
(2.37) Notice that if we only desire to know the concentration of species A we only need to solve one differential equation, since the concentration A is not dependent on the concentration of P.
or
EXAMPLE 2.3
Smgc drums are oncn used as intermediate storage capacity for gas streams that arc lransfclTcd hctween chemical process units. COl1::idcr a drum depicted in Figure 2.4, where (fi is the inlet Inola!" Ilowratc and q is the outlet molar tlowrate. Here we develop a model that describes how
the pressure in the tank varies with time.
q.
I
{
FIGliRE 2.4
Let V = voJurne of the drum and V::: molar volume of the gas (volome/mole). 'rhe total amount of gas (moles) in the tank is then VI\/.
Assumption:
where P IS pressure, T is temperature (absolute scale), and R is the ideal gas constant. Equation (2.38) can be written
if
RT
(2.39)
v
V
PV
(240)
the rate of accumlation of gas is then d(PV/NT)/dt. Assume that T is constant; since Vand Rare also constant; then the molar rate of accumlatioll of gas in the tank is:
Sec. 2.4
Constitutive Relationships
V tiP RT dt ~ 'Ii  'I
27
(2.41)
where q,: is the molar rate of gas entering the drum and q is the molar rate of gas leaving the drum. Equation (2.41) can be written
dP dt
RT V (qiq)
(2.42)
To solve this equation for the state variable P, we must know the illfJll1s lfi and q, the parameters R, 1; and V, and the initial condition P(O). Once again, although (j is the molar rate Ollt of the drulll, we consider it an input in terms of solving the model.
2.4
CONSTITUTIVE RELATIONSHIPS
Examples 2.2 and 2.3 required Illore than simple material balances to define the modeling equation::;. These required relationships are known as constiflltive equations; several examples of constitutive equations are shown in this section.
2.4.1
Gas law
Process systems containing a gas will normally need a gaslaw expression in the model. The ideal gas law is commonly used to relate molar volume, pressure, and temperature:
PV= RT
(2.43)
The van del' Waars FVT relationship contains two parameters (a and b) that are systcm~ specific:
a) , (P + \12 (V  b) =
2.4.2
RT
(2.44)
For other gas laws, sec a thermodynamics text such as Smith, Van Ness, and Abholl (1996).
Chemical Reactions
The rate of reaction pCI' unit volumc (mollvolume*timc) is usually a function of the con~ centration of the reacting species.I;or example, consider the reaction A + 2B > C + 3D. If the rate of the reaction of A is firstorder in both A and B, we use the following expression:
(2.'15)
where
rA
k CA
CjJ
is the rate of reaction of A (mol A/volume*time) is the reaction rate constant (constant for a given temperature) is the concentration of A (mol A/volume) is the concentration of B (mol B/volume)
28
Process Modeling
Chap.2
Reaction rates arc normally expressed in terms of generation of a species. The minus sign indicates that A is consumed in the reaction <:lbovc. Il is good practice to associate the units with all parameters in a model. For consistency in the units for 1"1\> we find that k has units of (vol/mol B* time). Notice that 2 mols of B react for each mol of A. Then we can write
1'8 ,
2rA
~
=
=
rc
r/!
 2k C~,Cll k C't\C: n
rf)
 JrA c. 3
k C"C"
Usually, the reaction rate coefficient is a function of temperature. The most commonly used representation is the Arrhenius rate law
k(T) = A expC 10/ /IT)
(2.46)
where
k(T) :::: reaction rate constant, as a function of temperature A ;::; frequency nlctor or prccxponcntial factor (sanle units as k) 10 = activatioll ellergy (cai/glllol) R :;:;: ideal gas constant (1.987 caJlgmol K. or another set of consistent units) T :::; absolute temperature (dcg K or dcg R)
The frequency factor and activation energy can be estimated data of the reaction constant as a function of reaction temperature. Taking the natural log of the Arrhenius rate 1mv, we find:
in k
InA  F '
/I
(I) T
(2.47)
and we sec that A and E can be found from the slope and intercept of a plot of (In k) versus (117).
2.4.3
Equilibrium Relationships
The relationship between the liquid and vapor phase compositions of component i, when the phases arc in equilibrium, can be represented by:
.
v,
(2.48)
where
Xi ::;:
liquid phase mole fraction of component i vapor/liquid equilibrium constant for component i
Ki
:;:;:
The equilibrium constant is a fUllction of composition and temperature, Often, wc \vill sec a ('otis/an! relative volatility aSSUlllption made to simplify vaporlliquid equilibrium models.
Sec. 2.4
Constitutive Relationships
29
In a binary system, the relationship between the vapor and liquid phases for the light component often used is:
(xx
l' =
I + (<YI)x
(2.49)
x :::: liquid phase mole fraction of light component y ::;: vapor phase mole fraction of light component (X :::: relative volatility Co. >. I)
2.4.4
Heat Transfer
The rate or heal transfer through a vessel wall separating two fluids (a jacketed reador, for example) can be described by
(2.50)
where
Q U ;\ fiT
:::: rate of heat trallsfcrcd from the hot tluid to the cold fluid ;:;;;; overall heat transfer coefficient ::::: area for heat transfer = difference between hot and cold fluid temperatures
The heat transfer coefficient is onon estimated from experimental data. At the design stage it can be estimated from correlations; it is a function of fluid properties and velocities.
2.4.5
Flowthrough Valves
(2.51 )
where
:::: volumetric f10wrate valve coefficient fraction of valve opening 0./\ :::: pressure drop across the valve s.g. :::: specific gravity of the fluid J(x) :::: the flow characteristic (varies from () to 1, as a function of .r)
Three common valve characteristics arc (i) linear, (ii) equalpercentage, and (iii) quickopening.
F Cl' x
30
Process Modeling
Chap. 2
0.8
~ 0
quickopening
0.6 0.4 02 0 0 0.2 0.4 0.6 0.8
15
c
0
t .:g
linear equalpercentage
fraction open
FIGURE 2.5 r~'low characteristics of control valves. (I::::::::' 50 for cqualpercentage valve.
f(x)
For an equalpercentage valve
0"
f(x)
For a quickopening valve
,,'
f(x)
',Ix
The three characteristics arc compared in Figure 2.5. Notice that for the quick~opcning valve. the sensitivity of flow to valve position (fraction open) is high at low openings and low at high openings; the opposite is true for an cqual~pcrcclltagc valve. 'fhe sensitivity of a linear valve docs not change as a function or valve position. The equalpercentage valve is commonly used in chemical processes. because of desirable characteristics when installed in piping systems where ;:1 significant piping pressure drop occurs at high Ilowrates. Knmvledgc of these characteristics \vill be important when developing !cedback control systems.
2.5
Sec. 2.5
31
2.5.1
Review of Thermodynamics
Developing correct energy balall(:c equations is not trivial and the chemical engineering literature contains many incorrect derivations. Chapter 5 of the book by DCl1Il (1986) points out numerous examples where incorrect energy balances "vert used to develop pnlCcss models. The total energy erE) or a system consists of internal (U), kinetic (KE) and potential energy (Pf{):
TE
U I KE
+ PI'
1 , 2 111\'
I'E
mgh
+ KE
I 1'10'
TE
U I K I,' I I' E
where II and represent per mole and per mass, respectively. The kinetic and potelltial ellergy terms, on a mass basis, arc
KE
PE
~
2u
gil
[,'or most chemical processes where there arc thermal effects, we will neglect the kinetic and potential energy terms because their contribution is generally at least two orders of inagnitude less than thai of the internal energy tcnn. When dealing with flowing systems, we willuslIally work with enthalpy. Total enth;:Jlpy is defined as:
II
while the enthalpy/mole is
U I pV
11
and the enthalpy/mass is (since p::::: 1/( \I)
U I pV
II
we will make usc
If I pV
U I
i'
32
Process Modeling
Chap. 2
EXAMPLE 2.4
Consider a perfectly mixed stirredtank heater, with a single feed stream and a single product stream, as shown in Figure 2.6. Assuming that the f10wratc and temperature of the inlet stream can vary, that the tank is perfectly insulated, and that the rate of heat added per unit time (Q) can vary, develop a modcllo find the tank temperature as a function of time. Slate your assumptions.
F.
I
T.
I
~
V T
F
T
Q
FIGlJRE 2.6
Stirred tank
hl~ateL
Material Balance
accumulation
dVp
==
in  out
(252)
dt
Energy Balance
accumulation = in by flow  out by flow + in by heat transfer + work done on system dTE r;p,T Ei FpTE + Q + W, df
Here we neglect the kinetic and potential energy:
dU dt
FIIlI FI'U , ., I I
f).' ~
WI
(2.53)
We write the total work done on the system as a combination or the shaFt work and the energy added to the system to get thefluid into the tank and the energy that the system performs on the surroundings to force the fluid out.
(254)
This allows us to write (2.53) as:
j.
Pi) _l'jJ(Uj p) + Q + W,
Pi P
(2.55)
33
tit
Since, rip Vld, = V dpldl + P dVldt, if the 1'011111/(' is cOl/slall! and tile mean pressure change can be neglected (a good assumption for liquids), we can write
(2.57)
We must remember the assumptions that went into the development of (2.57): 'fhe kinetic and polential energy effects were neglected.
The change in p\l term was neglected. This is a good assumption for a liquid system, provided I\p is not too large and constant volume is assumed.
The total enthalpy term is:
II
Vp 11
and assullling no phase change, we select an arbitrary reference temperature U:_,j) for enthalpy:
ii(T)
~. Jc,,<lT
Often we aSSU!llc that the heat capacity is constant, or calcuated at an average temperature, so
'.
II ll;
=
c,,(7'
1;,,)
(2.58)
(2.59)
c>( T;  7~,,,)
d(Vpc"CI' dt
T",))
F; from (2.52. we filld
(2.(>0)
0::
='
/il
~
(2.61 )
F V (/; T) I
Q
Vpcf
!
I
w
Veep
(2.62)
<I'J'
dt
F
V
/i (11')1"
' .
\fpc"
c[J'
(2.63)
In ordcT to solve this problem, we must specify the parameters \I, p, (as a function of time), and the initial condition '1(0),
34
Process Modeling
Chap. 2
2.6
v.
I + ill
f ,
Using the mean value theorem of integral calculus and dividing by D.f, wc find:
(2.64)
at
(265)
Normally, a tube with constant crosssectional area is used, so elV;:::: Adz and F :::: Av z' where V z is the velocity in the zdircction. Then the equation can be written:
g(~A iJt
av_c, ''  kC
iJz
A
(2.66)
at
~Vi:P iJz
(2.67)
If the fluid is at a constant density (good assumption for a liquid), then we can write the species balance as
'1'0 solve this problem, we must know the initial condition (concentration as a function of distance at the initial time) and one boundary condition. For example, the following
boundary and initial conditions
C~,(z,
(2.69)
Sec. 2.7
Dimensionless Models
35
indicate that the concentration of A initially is known as a function of distance down the reactor, and that the inlet concentration as a function of time must be specified. In deriving the lubular reactor equations we assumed that species A left a volume element only by convection (bulk now). In addition, the molecules can leave hy virtue or a concentration gradient. For example, the amount elltering at V is
(2.70)
where is the diffusion coefficient. The reader should be able to derive the following
at
(27])
Since this is a secondorder PDE, the initial condition (C~\ as a function of z) and two boundary conditions must be specified. Partial differential equation (PDEs) models are much more difficult to solve than ordinary differential equations. Generally, PDEs arc converted to ODEs by discretizing in the spatial dimension, then tcchniques for the solution of ODEs can be used. 'rile rocus of this text is on O[)Es; with a grasp or the solution of ODr~s, one can then begin to develop solutions to PDEs.
2.7
DIMENSIONLESS MODELS
Models typically contain a large number of parameters and variables that may differ in value by several orders of magnitude. It is orten desirable, at least for analysis purposes, to develop models composed of dirnensionless parameters and variables. 'To illustrate the approach, consider a constant volume, isothcnnal CSTR moue led by a simple firstorder reaction:
where Xj= CN/CAIO ' It is also natural to choose a scaled time, T = //1< where I'" is a scaling parameter to determined. We can usc the relationship df = f"'dT to write:
be
36
dx
{:;:dr
Process Modeling
Chap. 2
A natural choice for 1*' appears to be VIF (known as the residence time), so
dT
dx =x (Vk) 1+ .x I F
The term VklF is dimensionless and known as a Damkholcr Ilmnber in the reaction engineering literature. Assuming that the feed concentration is constant, .'j::;: I, and letting Ci;::: Vk/F, we can write: dOl I ~X + (Xx (IT which indicates that a single parameter, (X, can be used to characterize the behavior of all firstorder, isothermal chemical reactions. Similar results arc obtained if the dimensionless state is chosen to be conversion
2.8
EXAlVIPLE 2.5
Consider it Lank height problem where the outlet flow is a nonlinear function of lank height:
tilt d/
r~
Il
i\
1\
v1/
Here tbere is not au analytical solution because of the nonlinear height relationship and the forcing function. 1'0 illustrate a problem with an analytical solution, we will assume that there is no inler flow to the tank:
dh df
\Ve can see Ihat the variables are separable, so
tilt
v'h
Il d/
i\
Sec. 2.9
37
dll Vii
j
IJ
A ell
h,.
2 v'Ji , 2\/h"
or
letting
t,,;:::
A (1
iI(I)
I fl'
vii ~ "
0 "
2/\ .
This analytical solution call be used, for example, to determine the lime that it will take for the tank height to reach a certain level.
2.9
or
XI =
where Xi is a state variable, IIi is an input variable and Pi i:; a parameter. The notation.< is used to represent drldt. Notice that there arc II equations, II state variables, III inputs, and r parameters.
2.9.1
State Variables
A stale variable is a variable that arises naturally in the accumulation tefm of a dynamic material or energy balance. A state variahle is a Tncasurable (at least conceptu;dly) quantity that indicates the state of a systelll. For example, tern perature is the COll'lIllOn state variable that arises from a dynamic energy balance. Concentration is a state variahle that arises when dynamic component balances are written.
38
Process Modeling
Chap. 2
2.9.2
Input Variables
An input variable is <l variable that normally must be specified before a problem can be solved or a process call be operated. Inputs arc normally specified by an engineer based on knowledge of the process being considered. Input variables typically include Ilowratcs of streams entering or leaving a process (notice that the l10wratc of an outlet stream might be considered an input variablc~). Compositions or temperatures of streams entering a process arc also typic"ll input variables. Input variables arc often manipulated (by process cOlltrollers) in order to achieve desired pcrfonnancc.
2.9.3
Parameters
A parameter is typically a physical or chemical property value that must be specified or known tomathcmatically solve a problem. Parameters arc often fixed by nature, that is, the reaction chemistry, molecular structure, existing vessel configuration, or operation. Examples include density. viscosity, thermal conductivity, heat transfer coefficient, and masstransfer coefficient. When designing a process, a parameter might be "adjusted" to achieve some desired performance. For example, reactor volume lllay be an important design parameter.
2.9.4
Vector Notation
The set of differential equations shown as (2.72) above can be written more compactly ill vector form.
(2.73)
Notice that the dynamic models (2.73) can also be used to solve steadystate probJenls, since
x=
that is,
()
(2.74)
f(x,u,p)
=. ()
(2.75)
for steady~state processes. Numerical techniques (such as Newton's method) to solve algebraic equations (2.75) will be presented in Chapter 3. The steady~state state variables from the solution of (2.75) arc often used as the initial conditions for (2.73). F'requently, an input will be changed froni its steadystate value, and (2.73) will be solvcd to understand the transient behavior of the system. 'rhe numerical solution of ordinary differential equations will bc prescllted in Chapter 4. In thc example helow we show Example 2.2 (chcmicalrcactor) in state variable form.
Sec. 2.9
~
39
~~ ~
EXAMPLE 2.6
dV dl
~FF
j
(2~23)
(2.31 )
(2.32)
(2~33)
There are four states (V, C~\, Cu' and C p ), four inputs (Fi , F, CAi, ('/Ii), and a single parameter (k). Notice that although F is the outlet fJowrate, it is considered all input to the model, because it must be specified in order to solve the equatiolls.
v
CA
F
Ii (CHi  Cli) F
2 kC,C"
VC/, + kCAC/I
or
X2
II,
Xl
(lI J 
x 2)
___ ti x,U,IJ)
I'I(X,II,P)]
x,
i:
(11 4 
x.,)  2
P,X 2X3
 [ f,(X,II,p) J4 (x,u,p)
11,
i, x4 +
l)l X1X;;
40
Process Modeling
Chap. 2
SUMMARY
A number material and energy balance examples have been presented in this chapter. The classic assumption of a perfectly stirred tank was generally used so that all models (except Section 2.6) were IUlTlpedparameter systems, Future chapters develop the analytical and Ilmllcrical techniques to analyze and sinudatc these models. The student should now understand: that dynamic models or lumped parameter systems yield ordinary differential equations.
or
that steadystate models of lumped parameter systcrns yield algebraic equations. The notion of a state, inpul. output, parameter. A plethora of models arc presellted in modules in the final section of the textbook. More specifically,. the following modules arc of interest: Module 5. IJcatedMixing'rank Module 6. LillcarEquilibrium Stage Models (AbsorpLioll) Module 7. Isothermal Continuous Stirred 'Tank Reactors Module 8. Biochemicall<cactor Models Module 9. Diabatic Reactor Models Module 10. Nonlinear Equilihrium Stage Models (Distillation) Each of these modules covers Illodel development and presents examples for analytical and nUlllerical calculations.
FURTHER READING
A nice introduction to dlClnical engincering calculations is provided by: Felder, R.M., & R. Rousse<lu. (1986). Processes. 2nd cd. New York: Wiley.
Excellent discussions of the issues involved in modeling a mixing lank, incorporating density crfects, and energy balances is provided in the follO\:ving two hooks: Denn, M.M. (1986)./Jrocess Modeling. New York: Longman. RusselL T.R.F., & M.M.Denn. (1971). Introduction Allrdysis. New York: Wiley. An introduction to chemical reaction engineering js:
lo
Chemical Engineerillg
Student Exercises
41
Fogler, H.S. (1992). Elements (d' Chcmh'ol ReaUiol/ Engineering, '.l1d eel. Englewood Cliffs, NJ: PrenticeIlall. An exccllenttextbook for an introduction to chemica! engineering thermodynmnics is: Smith, 1.M., ftC. Vall Ness, & M.M. Abbott. (1996). Chcmhxd Engineering Ther fIlorfvllomics, 5th cd. New York: McGrawHilI. The following paper provides an advanced treatment of dimensionless variables and parameters: Ads, R. (1993). Ends and beginnings in the mathematical modelling or chemical engineering systems. Chemica! l:.'ngineering 5'cience, 48( 14). 25072517. 'I'he relationships for mass and heat transport arc shown in textbooks on transport phenomena. The chernicaI engineer's bible is Bird, R.B., WJ~. Stewart, & E. Lightfoot. (1960). Transpurt Phcl/oIJ/('!la. New York: Wiley. The predatorprey model in student exercise 16 is also known as the Lotka Volterra e(luations, after the researchers that developed them in the late 1920s. A presentation of the equations is in the following text: Bailey, J .E., & DJ<'. Ollis. (1986). Biochemical Engilleerinf!, Fundamentals, 2nd cd. New York: McGrawHilI.
STUDENT EXERCISES
I. In
r~xaJ1lple 2.1 it was assumed that the input and output f10wratcs could he independently varied. Consider a situation in which the outlet flow rate is a function of the height of liquid in the tank. Write the modeling equation for tank h~ight assuming two different constitutive relationships: (i) F:::: f3h, or Oi) F:::: f3 \/h, where [3 is known as a flow c;oefficicnL You will orten sec these relationships expressed as F = h/R or F =V/ZIR, where R is a flow resistance. List the state variables, parameters, as well as the input and output variables. Give the necessary information to complete the quantitative solution to this problem. If the f10wrate has units of liters/min and the tank height has units of meters, find the units of the flow coefficients and flow resistances for (i) and (Ii).
2. Consider a conical water lank shown below. Write the dynamic material balance equation if the flow rate out gr the tank is a function of' the square root of height of water in the tank (Fo :::: f3Yh). List state variables, input variables and parameters. (Hint: Usc height as a state variable.)
42
Process Modeling
Chap, 2
i
~
Fa
3. Extend the model developed ill Example 2.2 (isothermal reaction) to handle the following stoichiometric cqu;:llion: A + B > 21'. Assume that the volume is constant, but the change in concentration of component B cannot be neglected. 4. 13xtcnd the model developed in Example 2.2 (isothermal with firstorder kinetics) to handle multiple reactions (assume a constant volume reactor).
+ B  > 21'
(react;on I) (reaction 2)
2A
+ I'  > Q
Assume that no P is fed to the reactor. Assume that the reaction rate (generation) of A per unit volume for reaction I is characterized by expression
fA
k1 C'A
en
where the minus sign indicates that A is consumed in reaction 1. Assume that the reaction rate (generation) of A per unit volume for reaction 2 is characterized by the expreSSIon
I'll
 k2
c/\
C/,
[I' the concentrations are ex.pressed in gmolllitcr and the volume in liters, what arc the units of the reaction rate constants? If it is desirable to know the concentration or component Q, how many equations must be solved? If our COncern is only with P, how many equations must be solved? Explain.
5. Model a mixing tank with two reedstreams, as shown below. Assume that there arc two components, A and B. C represents the concentration of A. (C, is the mass concentration 01';\ in stream I and C2 is the mass concentration of A in stream 2). Model the following cases:
F
C
Student Exercises
43
a. Constant volullle, constant density. h. Constant volume, density varies linearly with concentration. c. Variable volume, density varies linearly with concentration. 6. Consider two tanks in series where the flow out of the first tank enters the second tank. Our objective is to develop a model to describe how the height of liquid in tank 2 changes \vith time, given the input flow rate fi~I(t). Assume that the flow out of each tank is a linear function of the height of liquid in the tank (F J :;:;: I3lhl and F2 :;:;: l3i12) and each tank has a constant cross~sectional area.
h,
to.
h2
F,
:b=L
F 2
7.
8.
9.
10.
11.
A material balance around the first tank yields (assuming constant density and P, ~ (3,11,) Two liquid smge tanks (with constant cross~seclional area) arc placed in series. Write the modeling equations for the height of liquid in the tanks assmning that the f!owrate from the first tank is a function of the difference in levels of the tanks and the f10wrate from the second tmik is a funclion of the level in the second tank. Consider two cases: (i) the function is linear and (ii) the function is a square root relationship. State all other assumptions. A gas surge drurn has two components (hydrogen and methane) ill the rcedstreHlll. Let Yi and y represent the mole fraction of lnethanein the feedstream and drum, respectively. Find dP/df and dy/dt if the inlet and outlet f]owrates can vary. Also as~ sume that the inlet concentration can vary. Assume the ideal gas law for the effect of pressure and composition on density. Consider a liquid surge drum that is a sphere. Develop the modeling equation using liquid height as a state variable, assuming variable inlet and outlet /lows. A car tire has a slow leak. The fJowratc or air out or the tire is proportional to the pressure of air in the tire (we ;Ire using gauge pressure). The initial pressure is 30 psig, and after five days tile pressure is down to 20 psig. flow long will it take to reach 10 psig? A car lire has a slow leak. The flowratc of air out of the tire is proportional to the square root of the pressure of air in the tire (we arc using gauge pressure). 'rhe initial pressure is 30 psig, and after 5 days the pressure is down to 20 psig. How long will it lake to reach 10 psig? Compare your results with problem 10.
44
Process Modeling
Chap. 2
12. A small room (IOn X Ion X lOft) is perfectly scaled and contains air at I atm pressure (absolute). There is a large gas cylinder (100 nJ ) inside tbe room tha( contains helium viith an initial pressure of 5 atm (absolute), Assume that the cylinder
valve is opened (at t = 0) and the molar f10wratc of gas leaving the cylinder is pro~ portional to the difference in pressure helween the cylinder and the room. Assume HUll room air docs not diffuse into the cylinder.
Write the differential equations that (if solved) would allow you to find how the cylinder pressure, the room pressure and the roorn mole fraction of helium change with time. Slate all assumptions and show all of your work.
13. A balloon expands Or contracts in volume so that the pressure inside the balloon is approximately the atlllOspheric pressure. a. Develop the mathematical model (write the differential equation) for the V01UIllC of a balloon that has a slow leak. Lct V rcpresenllhe volume of the balloon and q represent the molar flowratc of air leaking from the balloon. State all assumptions. List state variables, inputs, and parameters. h. The following experimental data have been obtained for a leaking halloon.
t (minutes)
r (em)
I (J
o
5
7.5
Predict when thc radius of the balloon will reach 5 cm using two different assumptions for thc molar rate of air leaving the halloon: (i) rhe molar rate is constant. (ii) 'fhe molar rate is proporlionallo the surface area or the balloon. Reminder: The volumc of H sphere is 4IJ
'ITr 3
14. Often liquid surge tanks (particularly those containing hydrocarbons) will have a gas "blanket" of nitrogen or carbon dioxide to prevent the acculllulation of cxplosive vapors above the liquid, as depicted below.
liqUid
Develop the modeling equations with gas pressure and liquid volume as the state vari'lble;.;. Lel Cfr(lnd Cf repre;.;cnt the inlet and outlct gas molar flowrates, F"rand F the liquid volumetric f1owratcs, V the constant (total) volume, Vjthe liquid volume, and P the gas prcssure. Assume thc ideal gas law. Show that lhe modeling equations arc:
riP
dl
V~V(FfF)
I
Student Exercises
45
15. Most chemical process plants have a natural gas header that circulates through the process plant. A siInplified version of such a header is shown below.
V,
From
source
valve i
Plant piping, represented as a perfectly mixed drum Gas drum for a boilerhouse unit
To furnaces
Here, the natural gas enters the process plant from a source (the natural gas pipeline) through a control valve. It fltnvs through the plant piping, which we have represented as a perfectly mixed dnnH for simplicity. Another valve connects the plant piping to the gas drum for a boi!erhouse unit. Gas passes through another valve to the boilerhouse furnaces. Write modeling equations asslllning that the pressures in drums I and 2 arc the state variables. Let the input variables be h J (valve position 1),11 2 (valve position 2), and Pi (source pressure).
16. 'file Lotka Volterra equations \Vere developed to mode! the behavior of prcdatorprey systems, making certain assumptions about the birth and death rates of each species. Consider a system composed of sheep (prey) and coyotes (predator). In the following Lotka Volterr~1 equations Xl represents the number of sheep and X2 the number of coyotes in the system.
0', ~,
y,
17. Consider a perfectly mixed stirredtank heater, with a single liquid feed stream and a single liquid product stream, as shown below.
T;
L j     t  '     .. F T
46
Process Modeling
Chap. 2
Develop the material and energy balance equations that describe this process. Fi is the volumetric nowrate into the tank, F is the volumetric rJOWfi:ltC oul of the lank, '1;is the temperature or the fluid entering the lank, r is the lcrnperalurc or the fluid in the tank, II is the height of liquid in the tank, and Q is the rate of energy added to the tank. State assumptions (such as constant density, etc.). _ Assume that the volume Call vary with time and that F is proportional to \1/1. How lllany differential equations docs it take to model this system? What arc the state variables'! What afC the parameters? What <:11"( the inputs? List the information necessary to solve this problem.
18. Consider a gas surge drum witb variable inlet and outlet molar flowratcs, {jr and q, res[Jectively. Asslilne that heat is being added to the tank at a rate, Q. \Vrite the modeling equations lhat describe how the temperature, and pressure, fl, vary with time. r)o not neglect the p V tenn in the energy balance. 19. Derive the reaction~dilJusionequation
1:
dC.\
at
=  v
neil
ilz.
using the same method to derive lhe tubular reactor model in Section 2.6. As:mme that a chelnical species enters a v()lllIne clement via convection (bulk flow) and a concentration gradient (diffusion):
"II
"I
F,
13 VII
II :::: F/F:I . and x:::: hlhs.. 'Where Fs and h. 1 are the stcadystateflowrale and height. respeclively (VI' :::: ~\Ih). Definc the dimeIl+ sionless limc, T, that will yield the follO\ving dimensionless equation:
dx elT

\/x
21. I)erive the constitutive relationship F:::: fjVh by considering a steadystate energy balance around a tank with a constant flowrate. Use P :::: 1\, + pgh for the pressure al the bottom of the lank, where Po is the atmospheric pressure (pressure at the top surface), 11 is the height of liquid in the tank, p is the density of fluid. Assume lhat
Student Exercises
47
the crosssectional area at the surface is much larger than the crosssectional area of the exit pipe.
dt
Use T = kl as the dimensionless time. [)evclop the dimensionless cquation for t\",O cases: (i) _y ;;;:;: C,/(\l' and (ii) x = I  C,/(~\r Compare and contrast the resulling equations with the example in Section 2.7.
23. Semibatch reactors are operated as a cross between batch and continuous reactors. A semibatch reactor is initially charged with a volume of material, and a continous feed of reactant is started. There is, however, no outlet stream. !)eve(op the modeling equations for a single firstorder reaction. The state variables should be volume and concentration of reactant A. 24. Pharmacokinetics is the study of how drugs infused to the body are distributed to other parts of the body. 'rhe concept of a cOlnpartmental model is orten used, where it is assumed that the drug is injected into compartment I. Some of the drug is eliminated (reacted) in compartmcnt I, and somc of it diffuses into cmnpartrnent 2 (the rest accumulates in compartment I). Similarly, some of the drug that diffuses into compartment 2 diffuses back into compartment I, while some is eliminated by reac~ tion and the rest accumulates in compartment 2. Assume that the rates of diffusion and reaction arc directly proportional to the concentration of drug in the compartmenl or interest Show thal the following balancc equations arise, and discuss the meaning of each parameter (k{i' units of minI)
dX I
dt
df
where Xl and x2 = drug concentrations in compartments I and 2 (/Lg/ml), and u =: ratc of drug input to compartment I (scaled by the volumc of compartment I,
/Lg/ml min).
SECTION
II
NUMERICAL TECHNIQUES
ALGEBRAIC EQUATIONS
The purpose of this chapter is to introduce rllcthods to solve systems of algebraic equations. Arter studying this module, the student should be able to: Solve systems of linear algebraic cqua.lions. Solve nonlinear functions of one variable graphically and fllll11crically. Usc thcMAI'LAB function fzero to solve a single algebraic equation. Discuss the stability of iterative techniques. Usc thcMATLAB function f solve to solve sets of nonlinear algebraic equations.
3.2 3.3
3.4 3.5
General r,'onn for a Lincar System of Equations Nonlinear Functions of a Single Variable
MATLAB Routines for Solving Functions of a Single Variable MuJtivariablc Systems
3.6
3.1
INTRODUCTION
In Chapter 2 we discussed how to develop a model that consists of a set of ordinary differential equations. To solve these problems we need to know the initial conditions and how the inputs and parameters change with time. Often the initial conditions will be the steadystate values of the process variables. To obtain a steadystate solution of a system of differential equations requires the solution of a set of algebraic equations. The purpose of this chapter is to review techniques to solve algebraic equations.
51
52
Algebraic Equations
Chap. 3
11
fl(XI,xz,
flex I ,x2'
0
(31 )
The objective is to solve f\1r the set of variables, Xi' that force all of the functions, .fi, to zero. A solution is called aJixed point or all. equilibrium poinf, Vector notation is used for a compact representation
I'(x)
~
(}
(3.2)
where rex) is a vector valued function. Notice that these can be the same functional relationships that were developed as a set of differential equations, with x:= rex) := O. The SO~ lution x is then a steadystate solution to the system of differential equations. Before we cover techniques for systems of nonlinear equations, it is instructive to review systems of linear equations.
3.2
where the a's and b's are known constant parameters, and the x's are the unknowns. The second equation is:
anx I +
([22
x2 + ([2J~rJ +. . + ([2Ir\:1/ =
/;2
The coefficient, aU' relates the jilt dependent variahle lo the itlt equation.
XJ
b,
b2
a 12
au
aLl
Xz
I"
a21
an
aliI
alii
(lId
"1
llZIl
a/l/l
x:'\
bJ
(3.3)
XII
(3.3a)
The goal is to solve for the unknowns, x. Notice that (3.3a) is the same form as (3.2), with
f(x)
~
Ax  b
Sec. 3.2
53
provided thallhe inverse of A exists. [I' the rank or A is less than 11, then A is singular and the matrix inverse docs not exist. If the condition number of A is vcry high, then the solution may he sensitive to model error. The concepts of rank and condition number are reviewed in Module 2 in Section V. Equation (3.4) is used for conceptual purposes to represent the solution of the sel of linear equations, In practice the solution is not obtained by finding the matrix inverse. Rather, equation (3.3a) is directly solved Llsing a numerical technique such as Gaussian elimination or LU decomposition. Since the codes to implement these techniques are readily availahle in any Ilumericallibrary, wc do not rcview thcm hcrc. The next example illustrates how MATLAli can he used to solve a system of lincar equations.
EXAI\ilPLE 3.t
Consider asstage ahsorption column (presented in Module 6 in Section V) that has a model of the following form (x is a vector of stage liquidphase compositions and u is a vector of column feed compositions):
O=1\x+llu
or
Axc;::~HII
a
0.3250 0.2000
0 0
O.12'SO
o
0.1250
a
o
0.1250
0.3250
0
b
0.3250 0.2000 0 0 0 0
0.3250 0.2000
o o o
0.1250
0.3250
0.2000
0 .2000 0 0 0
0
u

a
0 0.2500
0 0 .1000
54
Algebraic Equations
Chap.3
x
x
~inv(a)*b*u
Usc of the MArLAB leftdivision operator (\) yields the same resull more efficiently (faster computation time), using the LU decomposition technique:
3.3
f(Xi
x
The solution
a. Single Solution
b. Multiple Solutions
FIGURE 3.t
Sec. 3.3
55
3.3.1
Convergence Tolerance
where 1::: is a tolerance that has been specified, !/(xk)! is lIsed to denote the absolute value of fUllctionJ(x) evaluated at iteration k, and x k is the variable value at iteration k. At times it is useful to base convergence on the variable rather than the function; for example, a solution can be considered converged at iteration k if the change in the variable is less than a certain absolute tolerance, E(I:
'I'he absolute tolerance is dependent on the scaling of the variable. so a relative tolerance specification, l,;r' is orten lIsed:
The relative tolerance specification is not useful iLr is converging to O. A combination the relative and absolute tolerance specifications is often used, and can be expressed as
or
The iterative methods that we present for solving single algebraic equations are: (i) direct substitution, (Ii) interval halving, (iii) false posilion, and (iv) Newton's Jnethod.
3.3.2
Direct Substitution
Perhaps the simplest algorithm for a single variable nonlinear algebraic equation is known as direct substitution. We h.ave been writing the relationship for a single equation in a single unknown as
f(x) = 0 (3.5)
(3.6)
this means that our "guess" ft.)!' x at iteration k+ 1 is based on the evaluation of M(X) atiteration k (subscripts arc used to denote the iteration)
Xk+ l :::: M(Xk )
(3.7)
If not formulated properly, (3.7) may diverge or converge to physically unrealistic tions, as shown by the following example.
56
Algebraic Equations
Chap. 3
EXAMPLE 3.2
A Reactor with
Second~Ordcr Kinetics
The dynamic model for an isothermal, constant volume, chemical reactor with a single sccondorder reaction is:
~{~;, df
Find the
slcady~statc
At steadystate, riCA/til
:=
Clis ~ C' ~ 0 As
where the subscript s is used to denote the steadystate solution. For notational convenience, let .r:;;: CA" and write the algebraic equation as
We can directly solve this equation using the quadratic formula to find x:::: 1.6IX and 0.61X to be the solutions. Obviously a concentration cannot be negative, so the only physically meaningful solution is x::;;: 0.618. Although wc know the answer llsing the quadratic formula, our objective is to illustrate the behavior of thc direct substitution method. To use the direct substitution method, we can rewrite the function in two different ways: 0) x 2 :;;;; ~J_ + I and Oi) x:;;;; x 2 + J. We will analyze (I) and leave (Ii) as an exercise for the reader (see student exercise 4). (i) Here we rewrite JCi,.:) to fino the following direct substitution arrangement
x ~
v=:;:+) ~ g(x)
x,
x,
~
~
V  0.5 +
0.7071 0.5412
0.7071 + I 0.5412
XJ ~
X4 ~
+ 1 ~ 0.6774
~
0.6774 + I
0.5680
Sec. 3.3
57
.".
'"
15
20
11
I I with Xo
0:;;:
0.5. This
Notice that an initial guess of xo:::O () or ! oscillates between 0 and 1, never converging or diverging, as showil in Figure 3.3.
0.8 0.6
.". '"
0.4
I I I 0.2 I I 0 0
\ \ \ \
\
10
FIGURE 3.3 The iteration xI; i [ = ~::t~ 1 Wilh Xo::= 0 (dashed) or (solid). Thi::; sequence oscillates between 0 and 1.
As noted earlier, this problem has two solutions (x* :;:::; 1.618 and x~: :;;:: 0.(18), since il is a secondorder polynomial. This tall be verified by plotting x versus J{x) as shown in
58
Algebraic Equations
Chap.3
Figure 3.4. From phy:;ical reasoning, we accept only the positive solution, since a concentration
cannot be negative.
a/V
3:
1 f , .
~
. ,............
\
.
\[\
2
3 L...".
.i.._ _
.._"~._
_" .
2
1
FIGURE 3.4
Example 3.2 illustrates that certain initial guesses may oscillate and never yield a solution, while other guesses may converge to a solution. It turns out that the way that a direct substitution problem is formulated may eliminate valid solutions from being reached (sec student exercise 4). These problems exist, to a certain extent, with any numerical solution technique. The potential prohlems appear to be worse with direct substitution; direct substitution is not generally recommended unless experience with a particular problem indicates that results arc satisfactory, Direct substitution is often the easiest numerical technique toformulate for the ,,,>olution of a single nonlinear algebraic equation. If a numerical technique does not converge to a solution when the initial guess is close to the solution, we refer to the solution as unstable. The stability of iterative methods is discussed in the appendix.
3.3.3
The interval halving technique only requires that the sign of the function value is knowll. The following steps arc used in the interval halving technique:
1. Bracket the solution by finding two values of x, one wherej{x) is less than zero and
another whereJ{x) is greater than zero. 2. Evaluate the function,./Cr), at the midpoint of the bracket. 3. Replace the bracket limit that has the same sign as the function value at the midpoint, with the midpoint value. Check for convergence. If llot converged, go back to step 2.
Sec. 3.3
59
f(x)
FIGURE 3.5
An example of the interval halving approach is shown in Figure 3.5. Notice that the solution was bracketed by
1. Findingx\, whcrcj(xl) is negative andx2 wheref(x2) is positive. 2. The midpoint between xl and x2 was selected (x]). The function value at x3,}(x3)' was negative, so 3. xl was thrown out and x3 became the lower bracket point. 4. The midpoint between x 3 and .:rz was selected (x4)' The function value at '"4' .!{.r4), was positive, so 5. '\:2 was thrown out and x 4 became the upper bracket point. 6. The midpoint between x 3 and x4 was selected (x s)' The function value al x 5, j(x s )' was negative, so 7. x3 was thrown out and x5 became the lower bracket point
You can see that the midpoint between x5 and x4 will yield a positive value for}(x(), so that the x4 point will be thrown out. You can also see that this process could go on for a very long time, depending on how close to zero you desire the sol11tion. Engineering judgement must be used when making a convergence tolerance specification. The advantage to interval bisection is that it is easy to understand. A disadvantage is that it is not easily extended to multi variable systems. Also, it can take a long time to reach the solution since it only uses information about the sign of the function values. The next technique is similar to interval bisection but uses the function values to determine the variable value for the next iteration.
60
Algebraic Equations
Chap.3
3.3.4
The false position or rcguli falsi technique uses the function values at two previous iterations to determine the value for the next iteration. The technique of false position consists of the foJlowing steps:
1. Select variahle values xk and x k+ to bracket the solution. 2. Draw line hctwccnj{xk) andf(xk + 1) and find xk+2' 3. Evaluate f(xk+2)' Replace the bracket limit that has the S<llllC sign for its function as
J
the sign o(l{xk+2)' An example of the false position approach is shown in J1'igurc 3.6. The next step would be to draw aline from.f(x'j) to.!(x2) and find '"4 Continue until a certain tolerance is met. The false position method generally converges much more rapidly since it uses known function values to determine the next "guess" for the variable. We have sho\vn graphically how each technique is used. You willlHlVe an opportunity in the student exer~ ciscs to write all algorithrn to implement the two techniques.
3.3.5
The most commonrnethod for solving nonlinear algebraic equations is known as Newton's method (or NewtonI<aphson). Newton's method can be derived by performing a
Taylor series expansion ofJCr):
I(x
+ Llx)
= f(x)
=0
(3.9)
f(x)
X2
initial upper
limit
FIGURE 3.6
~~~
61
and so
011.
Neglecting the secondorder and higher derivative terms and solving for 1{,I:+~t) = 0, we ohtain
/(x)
L'.x
F(x)
(3.10)
Since this is an iterative procedure, calculate the guess YOI x at iteration k+l as a function of the value at iteration k:
defining
from (3.1 0)
(3.11 )
dX k + I
=At,)
f'(x,)
(3.12)
from (3.11)
F(x,)
(3.13)
= x, /"(x.k ) _
}\x,)
(3.14)
Equation (3.14) is known as Newton's method for a singlevariahle problem. Notice that we can obtain the following graphical representation {{Jr Nc\vton's method (Figure 3.7). Statting from the initial guess of Xl' we find that ':2 is the intersection off'Cr 1) with the xaxis. [~valuatcJ(.1:2) and draw a line with slopcf'(x2) to the xaxis to find x 3 . This procedure is continued until convergence.
I(x) I(x,)
I(x,) I(x,)
~
x,
x,
I(x)
'SlOpe" f'(x,)
Illustration of NeWlon's
62
Algebraic Equations
Chap. 3
Advantages to Newlon's method include quadratic convergence (when close to the solution) and that the method is easily extended to l1lultivariablc problenls. Disadvantages include the fact that a derivative of the function is required, and that the method may not converge to a solution or may not converge to the nearest solution. Foran example of nonconvcrgencc, consider the fUllction shown in l"igure 3.8. Here the initial guess is at a point where the derivative of function is eqllal to zero (f'(xo ) :;: 0), therefore there is no intersection with the xaxis to determine the next guess. \Vc also sec from (3.14) that there is no finite value for the next guess for x. Another probIcm is that the solution could continuously oscillate between two values. Consider/Cx) =::.x3  x. A plot of Newton's method for this function, with an initial guess o1'xo::= ~1/\/5,is shown inl<'igure 3.9. Notwithstanding the problems (possible diviSion by zero or continuous oscillation) that we have shown with Newton's method, it (or some variant of Newton's) is still the most commonly llsed solution technique for nonlinear algebraic equations. Notice that Newton's method essentially linearizes the nonlinear model at each iteration and therefore results in successive solutions of linear models. Notice that increasing amounts of information were needed to use the previous techniques. Interval halving required the sign of the function, reguli falsi required the value of the function, and Nevvton's method required the value and the derivative of the function. We also found that not all solutions to a nonlinear equation arc stable when direct substitution is used. Next, we show that all solutions are stable using NeWlon's method.
0.5
f(x)
a
______
.>..L~_"'
0.5
1
horizon1al 1arlgel
1.5
1
0.5
o
x
0.5
1.5
FIGURE 3.8
Sec. 3.4
63
0.5
f(x)
a
0.5
1
l'
l
....... ~_
'~_
,
J, I
1.5
1
0.5
a
x
0.5
1.5
FIGURE 3.9
3.4
or a single v.:triable.
FZERO is lIsed for a general nonlinear equation, while ROOTS can be used if the nonlinear equation is a polynomial.
3.4.1
FZERO
The first routine that we usc for illustration purposes is [zero. [ZI<;1:'O uses a combination of interval halving and false position. In order to usc f ZE,;ro, you must first write a MATL,AB mfilc to generate the function that is being evaluated. Consider the function.!(x):::: x 2  2x ~ 3 :::: O. The following MATLAB mfilc evaluates this function (the Illfile is named fcnl . m):
function y
y
~
:=
fcnl(x)
3;
x A 2  2*x
After generating the mfilc tcnl. m, the user must provide a guess for lhc solulion to the fzero routine. The following command gives an initial guess of x:::: O.
fzero{'fcnl' ,0)
64
MATL.AB returns the answer:
y
Algebraic Equations
Chap.3
1
z
and MATLAB returns the answer
These results arc consistent with those of Example 3.2, where we found that there were two solutions to a similar problem (we could usc the quadratic rOl11mla to find theln). Again, the solution obtained depends on the initial guess. A third argument allows the user to select a relative tolerance (the default is the machine precision, eps). A fourth argument triggers a printing of the iterations.
3.4.2
ROOTS
Since the equation that we were solving was a polynomial equation, we could also lise the MATLAB routine roots to find the zeros of the polynomiaL Consider the polynomial function:
The user must create a vector of the coefficients of the polynomial, in descending order.
e~[123]'
Then the user can type the following command roots(e) and MATLAB returns
ans ::::
3
~l
3.5
MULTIVARIABLE SYSTEMS
Tn the previous sections we discussed the solution of a single algebraic equation with a single unknown variable. We covered direct substitution, bisection, reguli falsi, and Newton's method. In this section, we will discuss the reduction of a multivariab1e problem to a singlevariable problem, as well as the multivariab1c NeWlon's method. Consider a system of 1l nonlinear equations in Jl unknowns
f(x) = 0
Sec. 3.5
Multivariable Systems
65
'There arc some special cases where 11  1 variables can he solved in terms of one vari~ ablclhen a single variable solution technique can be llsed. This approach is shown in the following example.
EXAMPLE 3.3
Reducing a
two~variahlc
problem to a
4x~
single~variablc
problem
x Jx 2 :::O
(3.15) (3.16)
(3.17)
I +3x,ZBxf::::O
which has the two solutions 1'1)]
XI
(3.18)
OJ) and
x2:::;:
1.5714
X.co"
0.1429] [ 1.5714
Question:
Observation: We can also see by inspection that the origin (sometimes cJlled the trivial solut'lOn), x =: tgl, is also a solution. Another solution that is slightly Jess obvious is x;::;; [~]. which we can see by inspection satisfies (3.15) and (3.16). Question:
How did we miss the other two solutions?
Observation: Perhaps we will find the olher solutions if we solve (3.16) for Xl in tCrIns of \2' then substitute this result into (3.15) to solve for x 2 . When this is done, we obtain the result that
xi  4 x
4 = 0 2
2
which gives us the solution x:;::: l~l. Notice that we are still missing the trivial solution, x ;::;;
rgl.
66
Algebraic Equations
Chap. 3
The mistake that we made was back at the fifst step, when we solved (3.15) for J.2 in terms of xl to find (3.17). We must recognize that (3.15) is quadratic in Xl' therefore there arc two solutions for Xl in terms OLt2' This is more dear if we write (3.15) .'lS
~4
x7 + xI (1  x2) + 0 ::: 0
and solve for xl to find xl :;:;:. 0 or Xl ::: 1/4 (I  x2). The reader should show that substituting these values into (3. 16) will1cad to the four solutions:
3.5.1
rex) = 0
That is, a set of n equations in n unknowns
(3.19)
0
0
(3.20)
The oQjectivc is to solve for the sct of variables, Xi' that forces all of the functions,};, to zero. We can use a Taylor series expansion for eachf;:
t;(x + Ax)
,f,(x) +
j ' l dX j
c"
(3.21)
f(x + Ax)
where.J is known as the Jacobian
f(x) + J Ax
(322)
ilf,
iii,
dxz
iJj;/
OX2
iii,
dX"
(3.23)
ax!
.J =
aj;/ ax}
iI/;/
aXil
Sec. 3.5
Multivariable Systems
67
Now, since we wish 10 solve for Ax such that r(x + Ax):::: 0, then (from 3.22)
f(x) + J Ax
Solving for Ax at iteration k
(3.24)
(3.25)
but Ax is simply the change in the x vector from the previolls iteration
AX k
xkl 1 
xk
(3.26)
x, , I
_.

xk
f(x k )
"(
x, )
which is the result that we obtained in Section 3.3.4. Comment: In practice the inverse of the Jacobi;:l11 is not actually used in the sollilion of (3.25). Actually, (3.25) is solved as a set of linear algebraic equations, using Gaussian elimination or LU decomposition.
where
EXA1VIPLE 3.3
xj
XjX? =
f;(X"xJ
2 x2
x~ I 3 X1 2 = 0 X
or
The Jacobian elements are
f(x) [ x l 4xf
 2 x 2 ~ xi + 3 x j x 2 _ =0
X,X'j
[OJ
JJI
ill; ..
()J:
=
r
1  8x 1 ~
X2
J?""'=x L iJx .l
2
fJ/;
68
Consider guess
all
Algebraic Equations
initial guess of ,:rj :;:; ; 1 and
x2 ;;;;;
Chap. 3
.I(x(O))
T'hc inverse of the Jacollian is
~_ [
10
1
.I I(X(O
~13
~I]
10 . 13
[ .3 13
13
f(x(O ~ [ 2 ( I)
 1
4 I
I[
+3
[~]
and the guess for x( I), \vherc x( I) represents the vector at iteration I, is
x( I)
1 U
13
13
x(1 )
~053851 0.3846
Iteration 0 1 2 3 4 5 6 7
~I
XI

x,
]
~0.5385 ~0.3104
0.2016
~0.156]
Sec. 3.5
Multivariable Systems
::::
69
.I and x2::::::1 is
x,
1 0.6190 0.3893 0.2870 0.2542 0.2501 0.2500
X2
0 1 2 3 4 5 6
Noticethataguc:'isofx:::o [1 1]' convergcdtox [0.1429 1.5714.1' aftcrsix iterations, and a guess of x ::: [ l 1J' converged to x '" [ 0.2500 0.0000 I ' aftcr six iterations. Other initial guesses may lead to the other two known solutions that were determined analytically.
The previous example illustrates that, for systems that have ITIuhip1c solutions, the solution obtained depends on the initial guess.
3.5.2
QuasiNewton Methods
Most computer codes actually implement some variant of Newton's method; these arc referred to as quasiNewton methods. Remember that Newton's method is guaranteed to convcrge only if thc system is nonsingular and we arc "close" to the solution.
DAMPING FACTOR
Often it is desirable to "dampen" the change in the guess for xk+l' to make Newton's method more stahlc. Applying a damping factor, a, to (3.27), we write
xu, = x k  a J k ' f(xkl (3.28)
where a is chosen so that II f(x k+1) II < II f(Xk) II and () < 'x S; I (we lise the II f(x k) I1l10tation to represent the norm of the vector f(x k Often IX is selected to minimize II f(x k + l ) II using a search technique l that is, IX is adjusted until II f(x k + 1) II is minimized. It should be noted that the singlevariable equivalent to (3.28) is
(3.29)
70
Algebraic Equations
Chap. 3
value for the next iteration. If the Jacobian is singular, it cannot he inverted. One method that avoids this problem is known as the L,evcnhcrg~Marquardl method:
xk + t
xk
(J k J k
(3.30)
where T represents the matrix transpose and [3 is an adjustable parameter llsed to avoid a singularity. The single variable equivalent to (3.30) is
(3.31 )
WHEN ANALYTICAL JACOBIAN MATRICES ARE NOT AVAILABLE If an analytical Jacobian is not available, a numerical approximation to the Jacobian mllst be used by the quasiNewton techniquc.A backward differences approximation for the Jacobian is
(3.32)
where oxJ(k) is a small perturbation in variable x at iteration k. A problcrn with this ap.I proaeh is that an nvariabfc problem requires 11 + 1 evaluations of the function vector at each iteration. There are other techniques that rely on infrequent function evaluations to update the Jacobian matrix.
3.6
EXAMPLE 3.3
Summary
and we obtain the solution by entering
X
::0
71
[0.2500
0.0000] ,
2 'fhe following function file gcnerates the analytic,tI Jacobian for this problem.
gf(l,2)=x(1) ; gf(2,l)=3'x(2);
gf(2,21=22*x(2)+3*x(1);
which we place in all Illfile called gradnle. m. We can then solve this problem by entering
xO = [l 1]';
SUMMARY
In this cbapter we have presented a number of techniques to solve nonlinear algebraic equations. Each technique bad a number of advantages and disadvantagesthe approach that you use may depend on tbe problem at hane!. If you have the option, it is a good idea to plot the function,f(x), to see if the results agree with your numerical solution. This option may not be available with l11ultivariablc problems. Notice that if a particular problem has multiple solutions, the actual solution obtained will depend on the initial guess. There are many actual chemical. processes that have "multiple solutions," that is, there are several possible "steady~states" that the process may operate at. In practice, the steadystate obtained wiU depend on dynamic considerations, such as the way that the process is started up. These issues will be ad~ dressed when we discuss differential equation~hased models. Much research is being done in applied mathematics to develop numerical tecbniques that yield everyone of the multiple solutions, without having to make many initial guesses. Among these is "homotopy continuation." These techniques arc not welldeveloped and are heyond the scope of this text. For now, the student must he willing to
72
Algebraic Equations
Chap. 3
try a numher of techniques, with a number of initial guesses, to find all of the solutions to a problem. It is recommended that you generally lise commcrically availahle routines for solving these problems. The numerical techniques covered were Direct substitution Interval bisection Rcguli falsi Newton's method Newton's method (and some variants) is the most commonly llsed multi variable technique. The reader should he able to understand the notions of Jacobian Fixed or equilibrium points COllvergence and stability
Tolerance Ilcration
The MATLAB routines that were introduced in this chapter are f801 ve: Solves a system of nonlinear algebraic equations, using quasiNewton and LevenbergMarquardt based algorithms fzero: roots: Solves for a single equation Solves for the roots of a polynomial equation
A I1lnnber of other numerical rOlltines are availiable through thcMATLAB NAtj Toolbox.
FURTHER READING
More detailed treatments of numerical methods given in the textbooks by Davis, Finlayson, and Riggs: Davis, M.E. (1984). Numerical Methods ol1dModeling for Chell/ieal Engineers, Ncw York: Wiley. Finlayson, B.A. (1980), Nonlinear Analysis in Chonit'al Fngineering. New York: McGrawHili. Riggs, J.B. (1994). Numerh..al Techniques for Chemical Engineers, 2nd cd. Lubbock: Texas Tech University Press.
Student Exercises
73
Example numerical techniques arc also presented by Felder and Rousseau: Felder, R.M., & R.W. Rousseau. (1986). Elementary Principles Processes. 2nd cd. New Yark: Wiley.
(~r
Chemical
The following book is more of ail advanced undergraduate/first~year graduate student text on I1lllncrical methods to solve chcmical engineering problems. The emphasis is on FORTRAN subroutines to be used with tbe IMSL (FORTRANbased) package. Rameriz, w.r<. BUtlerworths.
( 989).
STUDENT EXERCISES
Single Variable Methods
1. Real gases do not normally behave as ideal gases except at low pressure or high tcmpcrature. A number of equations of state have been developed to account for the nonidealities (van del" Waal's, RedliclyKwong, PengRobinson, etc.). Consider the van cler Waal's (YO T relationship
where Pis pressure (absolute units), R is the ideal gas constant, T is temperature (absolute units), {, is the molar volume and a and b arc van der Waa!'s constanls. The van der Waal's constants are often calculated from the critical conditions for a particular gas. Assume that a, h, and R are given. We find that if P and T arc given, there is an iterative solution required for V. a. How many solutions for V arc there? Why? (Hint: Expand the PVT rclationshlp to form a polynomial.) b. Recall that direct substitution has the form Vk+J :::: gV k)' Write three different direct substitution formulations for this problem (call thcse 1, H, and Ill). c. What would be your first guess for V in this prohlem?Why? d. Write the MATLAB mfiles to solve for V using direct substitution, for each or the three formulations developed in b. Consider the following system: air at 50 atm and 1 ()(PC. The van der Waal's constants arc (Felder and ROllsseau, p. 201) a :::: 1.33 altn Iitcr2/gmo!2, b = 0.0366 Iitc/Jglllol, and R = OJl8206 liter alm/glllol K. Solve the I{Jl1owing problems numerically. e. Plot V as a function of iteration number for each of the direct substitution methods in b. Usc 10 to 20 iterations. Also usc the first guess that you calculated in c. Discuss the stability of each solution (think about the stability theorem).
74
Algebraic Equations
Chap. 3
f. H.carrangc (I) to the form of/CO") :::: Oand plot./n/ ) as a function of V. How many sol uti OilS arc there? Docs this agree with your solution for a? Why or why
not?
g. Usc the MA'rLAB function roots to solve for the roots of the polynomial de
veloped in a. h. Write and lise an mfi1c to solve for the equation in a using Newton's method.
The nUlllerical Solulion is eonsidercd converged when
,,~
IVk~ Vk11
k [
0.0001.
2. Consider the van der Waals relationship for a gas without the volume correction lerm (Ii ~ 0)
a) (P + V2 V
A
A
RT
heat addition to the furnace is 1.0 x J 0 6 Btu/hI'. The ammonia fcedstrcam tempcra~ ture is 550 0 R. Use Newton's method to find the tcmperature of the aJl1monialeav~ ing the furnace. Assumc ideal gas and use the following equation for heat capacity at constant pressurc:
ell
a + bT + cT 2
Btll lOS Btu "R Ibmol "R' c =  1.20 X Ibmol
Btu
Ibmol "R Ii
and remember that Q c.
~ 3.33
T
to
,i r,,''" C" dT
where Ii is the molar rlowmtc of gas and Q is the ratc of heat addition to the gas pCI' unit timc. lIow did you detcrrnine a good first gucss to lise? 4. Consider Example 3.2 , .ltx) = _x2 ~ X + 1 = 0, with the direct substitution method jCll'lllulated as.x = x 2 + 1 :;;:: g(x), so that the iteration sequence is
Xk
I
c=
g(x k ) =  x~ + I
Try several different initial conditions and show whether these convcrge, diverge, or oscillate bctwcen values. Discuss the stability of the two sollitions .x*:;:: 0.618 and x*:;;:: 1.618, based on an analysis ofg'(.I;*).
5. Show why the graphical Newton's method is eqlJivalent to xk+l = x k ~J(xJ.Yf(xk)'
6. Develop an algoritlnl1 (sequence of steps) to solve an algebraic equation using intcrval halving (bisection).
Student Exercises
75
7. Develop an algorithm (sequence of steps) to solve an algebraic equation using reglilt falsi (false position). Compare and contrast this algorithm with Newton's mcthod. S. A componcnt material balance around a chemical reactor yields the following steadyslale equation
0=
where V
F
V
C kc'
ftC>
and k = 0 . 0 5 , . IbmoV ITIm a. How many steadystate solutions arc there? b. Write two different direct substitution methods and assesS the convergence of each. c. Perform two iterations of Newton's method using an initial guess of C:::: 1.0. 0.1 min " Cj" 1.0
.=
Ibmol
9. Consider the following direct suhstitution problem, which results from all energy balance problem
k+ I 
I'
7~
'I'
IO. Consider the following steadystale model for an exothermic zeroorder reaction in
a continuous stirredtank reactor. The variable x is the dimensionless reactor temperature. x
lex)
0.42204 cxp
x
20
1.3x=O
I'here arc two solutions to this equation, as illustrated in the figure below. The solu!ions mc x = 0.55946 and 2.00000. a. Formulatc a direct substitution solution to this problcm. Will your direct substitution tcchnique converge 10 0.55946'1 Will your direct substitution technique converge 10 x::: 2'1 Use a rigorous mathematical argument in each case. h. For an initial guess of x = 1.35, would you expect Newton's method to have any trouble with this problem? Explain. c. What is the next guess from the reguli falsi lechnique if your first guess was x;:;: I and your second guess was x:::::; 2.5 (show this mathematically)? d. Write a function routine to solve this problem using theMATLAB function f zero. Also show the commands that you would give in the MATLAB command window to run fzera.
76
0.5
Algebraic Equations
zeroorder rxn  dimensionless
Chap. 3
0.5
0.5 x
1.5
2.5
11. A component material balance around a chemical reactor yields the following steadystate equation
F o V C';,, F C V
c
k(25
F where V
i:1.
IU min'!, C;"
1.0
If'5
Write two different direct substitution methods and assess the convergence of each to the steadystate concentration of 0.75354. b. Perform two iterations of Newton's method using an initial guess of C:::: 1.0.
12. Consider the dimensionless equations for an exothermic CSTR (continuous stirred tank reactor) shown in a module in the final section of the textbook.
= exp
2 (_Xx,I'Y. ) 1+
I)
Uscft (x['X2) to solve for xl in terms of x 2 and substitute intoh(xl,x2) to obtain the single equation
IX,)  (1 + o)x, ~ .
Consider the parameter values ~ :::: 8, (V : :;: 0.072, 'Y :::: 20, 0 = 0.3. Determine the number of solutions to this problem (graphically), Find the xI and .x2 values for each solution, using the single variable Newton's method.
Appendix
77
Multivariable Methods
13. Use the multivariabJe Newton's method to solve the following problem. Solve this as a twovariable problem. Do not reduce it to a singlevariable problem via substitution.
f,(x)
2x,x2 5
stcady~statc operation)
is
is the biomass concentration (mass of cells) and xl is the substrate concentration (food source for the cells). Find the steadystate values for xI and x2 if f)::::: 0.3 (There are three solutions). <l. Usc fsolve and several initial guesses for the solution vector. b. Perform a detailed analysis by hand (hinl: the trivial solution xl ~ 0 and X2 ~ '\j should be easy to show.) 15. For the dimensionless CSTR problem (module 9 in Section V), use the MATL,AB routine fso1 ve to find the solutions. Show lhe initial guesses and the solutions that sol ve converges to. Show your function routine as well as the calls to
MATLAB.
f,(x"x,)
CC
q>X,,,(xz) + (1  x,)
= 0
13 =
'Y =
8 20
(I' = 0.072
1\ = 0.3
78
Algebraic Equations
Chap.3
APPENDIX
Stability of Numerial SolutionsSingle Equations
If the iterates (xk) from a numerical algorithm converge to a solution, we refer to thal solution ns being stable.
._~_
..
_~~~~_._~
Definition 3.1
Let x''' represent the solution (fixed point) of x*
=:
S(x'''), or get''')
yO" =:
O.
~
Theorem 3.1
x~'
g , ~ g(,"'). if lu l (JX
If
f
'1'li1gl  I
~<
llx
t evaluated at x*
1~lgl
rJx
g to represent 1.':>1_
dx
\Vc continue with Example 3.2 to illustrate the numerical stability of direcl substitution.
x
which has the derivative
g(x)
x+1
ag
ax
II I I
. g' 
 I
I 1
lex ")
:::;0
O.61X + I
I
O.X090
I.Sox''':=O.6ISisa
10
xO;o 0::::
stable solution, that is, all initial "guess" for X o close to 0.618 will convergc
0.618.
2. ['or x'"
0::::
.618
x'"
be a stable solution, that is, an initial "guess" frw Xu close to  1.61 g should converge to 0:::: 1.618.
Appendix Question:
Why did we find previollsly that an Initial guess close to 1.61 Xdid not converge?
79
Observation: We must realize that the square root of a positive number has two values. For example, 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 show that the direct substitution method can he unstable. Newlon's rncthod guarantees stable solutions, if the "guess" is close to the solution.
where
fix,)
f'(x,J
Then we can find that tbe derivative, //Ctk) is
or g'(x,)
At the solution,
~
lex,) n\,)
II'(x*)]'
g'(x*) = ()
as long as/ex"~') * O. This shO\vs that Newlon's method will converge to the solution, provided an initial guess close to the solution.
NUMERICAL INTEGRATION
Most chemical process models arc nonlinear and rarely have analytical solutions. This chapter 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 RungeKutta techniques. Usc thcMATLAB ode45 integration routine. The major sections 4.1 4.2 4.3 4.4
4.1
BACKGROUND
Thus far we have developed modeling equations (Chapter 2) and solved for the steady states (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 storage tank will take to reach a certain pressure if the outlet valve is closed. This requires in80
Sec. 4.2
Euter Integration
81
tegrating the differential equations from given initial conditions. If the dynamic equations are linear, then we can generally obtain analytical solutions; these techniques will be presented in Chapters 6 and 8 through 10. Even when systems are linear, we may wish to use numerical methods rather than analytical solutions. At this point itis worth reviewing the difference between linear and nonlinear differential equations. An example of a linear ordinary differential equation is:
dx = r dt
since the rate of change of the dependent variable is a linear function of the dependent variable. An example of a nonlinear differential equation is:
dx dt
~x
since the rate of change of the dependent variable is a nonlinear function of the dependent variable. Although this particulary nonlinear equation has an analytical solution, this will not normally be the case, particularly for sets of nonlinear equations. Notice that the following equation 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 integrating initial value ordinary differential equations. The first numerical integration technique that 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 INTEGRATION
Consider a single variable ODE with the form
dx. dl = x
=f
( ) x
(4.1 )
We consider two different approximations to the derivative. In Section 4.2, I we consider a forward difference approximation, which leads to the explict Euler method, In Section 4.2.2 we consider a backwards differences approximation, which leads to the implicit Euler method.
4.2.1
Explicit Euler
If we use a forward difference approximation for the time derivative of (4, I), we find
dx
dl
t(k
+ I _. + I) ~ t(k)
(4.2)
82
Numerical Integration
Chap. 4
where k represents the kth discrete time step of the integration. Now, assume that)(.\:) is evaluated at x(k). We will refer to this fuuclion ast(x(k)), and can write (4.1) and (4.2) as
x(k+ 1)... x(k) = j(x(k)) I(k + 1)  'rk)
Normally we will use a fixed increment of time, that is, t(k + 1)  t(k) ~
(4.3)
at,
where!:;;'/ is
2t x(k)
Cc
J(x(k))
(43)
x(k
+ I)
= x(k)
(44)
We can view (4.4) as a prediction of x at k + 1 based on the value of x al k and the slope 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 is
x(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 vector of functions evaluated at step k. Equations (4.4) and (4.5) are explicit because the statc variable value at time step k + 1 is only a function of the variahle values at step k. 'I'his method 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. Explict Euler is not often used in practice, but is covered here for illustrative purposes.
4.2.2
Implicit Euler
This method uses a backwards difference approximation for the derivative in (4.1). The function (or vector of functions) is evaluated at time step k + 1 rather than time step k:
+I)x(k)
6.1'
j(x(k
+ 1))
(46)
x(k)
~
k
k+1
Sec. 4.2
Euter Integration
83
(4.7)
Equation (4.7) is implicit because the value x(k + I) must be known in order to solve for + 1). What this generally requires is a nonlinear algebraic solution technique, slIch as Newton's method. For a linear system, equation (4.7) can be explicitly solved to obtain the form
x(k + 1) = g(x(k))
The following section compares the explicit and implicit methods for a single linear ordinary differential equation. In particular, we compare how the integration step size (At) affects the stability of each method.
4.2.3
Consider the tank height problem covered in Example 2.1. There was no inflow, and the outlet flowratc was assumed to be linearly related to height, which gave us the following equation:
dx dt
1
T
co
Ax
= f(x)
(4.8)
where 'T = A/13, A =  lIT and the state variable x is the tank height. Since the variables are 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 EULER
The function value at step k is:
f(x(k)
J
Oc 
x(k)
and the state variable value at the next time step is:
(4.10)
I(x(k
+ 1))
I
T
x(k
+ 1)
84
Numerical Integration
Chap. 4
x(k + I)
x(k) + 
ill
T
x(k + I)
(4.1 J)
Notice that, since this is a linear problem, a nonlinear algebraic equation solver is not needed for (4.11). We can rewrite (4.11) as
x(k + I)
ill x(k)
(412)
In the next section we compare the numerical stability of the explicit and implicit Euler methods.
NUMERiCAL 5TABILITY
The explicit Euler solution, written in terms of the initial condition, is (from (4.10):
x(k + I)
which will be stable if
(1  flt)"
T
x(O)
11 AlIT 1< 1. This is the same re~Htlt if we usc the representation:
x(k + i)
=
g(x(k))
~
ill
T
(I  ~1)X(k)
<I
flt
0<flt<2T
while the solution will have a stable, oscillatory solution for:
T<ill<2T
and a stable, monotonic solution for:
o<
ill < T
The implicit Euler solution, written in terms of the initial condition, is (from (4.12)):
x(k +
I)~ I;~I
( )
'"
x(O)
th
Sec. 4.2
Euter Integration
85
which will be stable if II/l+~t,'T1 < 1. This is the same result if we usc the representation
x(k + I) = g(x(k)) = (
+ !it
7
) x(k)
and the stability requirement that 11/ ::to < 1. Notice that the implicit Euler method is stable for any value of D.f (as long as the sign of D.l is corrcct) and will not oscillate.
EXAMPLE 4.1
Let x(O) ::::: 4, T :::: 5, and tlt ;:: I. Table 4.1 compares the exact solution (4.9) with the explicit Euler (4.10) and implicit Euler (4.12) methods.
TABLE 4.1
x,
()
exact
4.()()()()
1 2 3
4
2.YkJ
4'yf{)
6.7(70
8.99() 10.9%
1.81;1,
J.(H(' 5.49;
7.Yfri
9.2(;{,
The results shown in Tahle 4.1 are illustrated graphically by the curves in Figure 4.2.
implicit explicit
Comparison of the exact solution with the explicit and implicit Euler for
86
Numerical Integration
Chap,4
Larger Integration Step Size. We have seen the wellbehaved response for I (which is 7/5). Consider now a larger D..t. We cun sec from (4.10) that the explicit l:u1cr method predicts.r::::: 0 for all time after time 0, if at;;:::; T. Indeed, the explicit Euler solution is oscillatory for fj,t > 7, for this process. For example, let at = 6 for this problem. The results arc shown in 'fable 4.2. These results arc illustrated more graphically by the curves plotted in Figure 4.3. The implicit Euler techniquc has monotonic behavior and more closely approximates the exact solution. We sec that the implicit Euler method call tolerate it larger integration step size than the explicit Euler technique.
TABLE 4.2
Linc)]r First Order Example (r;:: 5, ilt;:: 6)
,~~~
at : : :
x, exact
6 12 IS 24
x, Explicit Euler
4JJOOO IISOOO 0,1600 ,(HmO OJI064
Y,
Implicit Euler
4,0000 LSIS2 118264 IU757 IU70S
2
~
implicit
exact
0
explicit
1 0 5
10
15
20
25
30
FIGURE 4.3
Comparison of exact solution with implicit and explicit Euler for D.l;;o.
o.
We have seen that thcre is a limit to how large a step size can bc tolerated by the explicit Euler method before it goes unstable, while the Implicit Euler Inethod rcmains stable for any step size. This is true for a simple linear ordinary differential equation. The following example illustrates an important issue when solving nonlinear equations. That is. the implicit Eulcr method requircs an iterativc solution at each time step.
Sec. 4.2
Euter Integration
~ ....
87
_~
EXAjVII.JIJ~ 4.2
Consider a surge tank with an outlet f!owratc that depends on the square rool of the height of liquid in the tank. Whclllhcrc is 110 inlet flow, the model has the following form fix dl
(4.13a)
area).
x(l)
[\1,(1
lit
/21'
r~Lllcr
(4.13bl
solutions.
Explicit Euler.
,(k
I)
x(k)  tH lI\le(k
(4.14)
l<'or the numerical example of ([;;;; 0.8, curves for 3 different D.ts are shown in Figure 4.4.
F1G{][{E 4.4 Explicit Euler solution. !:1t:::: O.()I, 0.1, and LO. The 0.01 and 0.1 step sizes yield virtually identical results. while there is a significant error ill a step size of 1.0.
Implicit Euler.
,(k + I)
x(k)  uta\lx(k + 1)
(4.15)
R.ecall that when we were dealing with a linear equation we were able to rewrite the implicit Euler equation to yield an explicit calculation of the state variable at the next time step. Here we sec that this is impossible for a nonlinear equation. Rewriting (4.15),
(4.16)
we sec that (4.16) requires an iterative solution. That is, at time step k + I we must usc a numerical method that \vill solve a nonlinear algebraic equation. We know from Chapter 3 that a num
88
Numerical Integration
Chap.4
bel' of techniques, including Newton's method, can be used. To illustrate clearly one approach that we can take, let y represent tbe value of x at step k + I for which we desire to find the solulion. We can rewrite (4.16) as
y + b\/v  c = 0
where y = x(k + I), b "" 1:11 (/, and c :;;: x(k). If Newton's method is used, we can write:
(417)
MCr(i
c.
y(i) + 1,v)'O)  c
(4.18)
yO +
where
(4.191
g'(y(i
+ 7'
2VY(I)
iJ
(420)
yO+
I),~y(i)
Iln,'(i) iJ
(\1)'0)]
(4.21 )
\lv(i) + 2
Equation (4.21) is then iterated to convergence. Summarizing, at step k+l of an integration, we must iteratively solve for the value of x at k+ I. That is, (4.21) is iteratively solved to convergence, in order to find x(k + 1) in (4.16).
4.3
RUNGEKUTTA INTEGRATION
This technique is an extension of the Euler method. In the Euler method, the derivative at time step k was used to predict the solution at step k+ 1. Runge~Kutta methods use the Euler technique to predict the x value at intermediate steps, then use averages of the slopes at intcmediatc steps for the full prediction from the beginning of the time step.
Sec. 4.3
RungeKutta Integration
89
4.3.1
SecondOrder RungeKutta
The first RungcKutta approach that we discuss is the secondorder RungcKutta method, which is also known as the midpoint Euler method, for reasons that will become clear. The Euler technique is first used to predict the state value at I:3.t12. The derivative is evaluated at this midpoint, and used to predict the value of x at the end of the step, l:i.t, as shown in r'igufc 4.5. Let Tnj represent the slope at the initial point and lJl 2 represent the slope (dddt) at the midpoint:
= [
x(k) + n1,At
For autonomOllS systems, the derivative functions arc not explicitly functions of time, so (4.22) and (4.23) can be written:
n1,
[(x(k))
(4.22a) (4.23a)
or
n1 2
[(x(k) +
~ !(X(k))
(4.23b)
FIGURE 4.5
90
Numerical Integration
Chap" 4
x(k + I)
which is of the form:
~ x(k)
+ L1t r (r(X(k) +
~tr(X(k))))
(4"24a)
x(k + I)
g(x(k))
It should be noted that the secondorder RUllgc Kutta is accurate to the order of :i1 2 ,
EXAMPLE 4.3
dt
~ {(x) ~
1
T
x
I
(4"8)
Ill, ~
r(x(k))
( "
x(k) )
I
T
x(k)
(4"25)
(4"26)
For t1t::;;;; 1,
From (4"25)
1 x(O) 5
4 5
~
From (4"26)
H 5
[:rom (4.24)
x(O) +
111 ,
bot
Compare this with the analytical result of 4.0 e 1/5:::: 3.2749 Notice that the error is O.16 1YtJ. Contrast this with an error of2.3% from Table 4.! for the Euler method. For the same step size, RungcKutta techniques arc more accurate than the standard Explicit Euler technique.
Thus far, we have used single variable examples. The next example is for a able system.
two~statc vari~
Sec. 4.3
RungeKutta Integration
91
EXAMPLE 4.4
Two~statc
VII I  il 2,
Consider two interacting tanks in series, showll in Figure 4.6, with outlet tlowrates that are a fun~~,igl_~_ ~!f the square root of tank height. Notice that the He)w from tank 1 is a function of while the flowratc out of lank 2 is a function of Vl1
FIGURE 4.6
Interacting tanks.
(4.27)
13,
= 2.5
min
13 2
=~C
fl2S
\/6 min
A, = 5 ft' A, = to ft'
[
=
, ! .10.5vh,h,
2< O. , _I
'2
_1. ;,2\16 \ h,
(4.28)
Since this system is autOnomous (no explicit dependence on time), we can leave (oul of the arguments:
m,
111
2
.ti(h,(Ie) + at 2 at [1;(h,(k) + 2
""I'
h,(k) +2 h2(k)
at]
fI1 21 ) fI1 21 )
Ill",
+ 2
92
Numerical Integration
Chap. 4
h(k
1I1,C,t
Let the initial conditions be 11 1(0) = 12 ft and hiD):= 7 ft. Also. let!J.! 0::: 0.2 minutes. Por k = 0, we find
. 05
YI2~7
2v6
I ..
7,IY7so
0.118034.] . 1 0.018955
h,(O)] hiO)
m
!!.t 2
'
7.001896
h,(O) +
~t 111" ~
~
0~2 (_ 0.118(34) ~
~
11.988197f1
0 .2 (0.018955) _ 7
7.001896 fl
"'" . t;(h,(O)
~
1;(11.988197.7.001896)
10.5vI1.9881977.001896 ~ 0.116501
"'" .0
t;(h,(O)
+ ~. "'", h,(O) +
.=
0.OIH116
",(I)
",(0) +
m"c,t
",( I)  ",(0) +
and we call continue for the next time step, k = t. A plot of the response of this system is shown in Figure 4.7. The response of Ii] actually increases slightly hefore dccrcasingthis is missed became of the scaling. Notice that when hi is greater than h 2 , the flow is from tank I to tank 2; while when hi is less than 1l 2, the flow is from tank 2 to tankl (although this cannot occur at steadystate). Since we have assigned a positive value to F[ when the flow is from tank I to tank 2, then a negative value of F I indicates the opposite flow. Care must he taken when solving this problem numerically, so that the square root of a negative number is not taken. For this pU'lJOse, the sign function is used
Sec. 4.3
RungeKutta Integration
93
::~
10
1    
gL
7r61 o
FIGlJUE 4.7
Runge Kutta.
81
20
==========~!
40 60 80
time (minutes)
100
The idea behind the secondorder RungeKutta can be extended to higherorders. The most commonly used method is the .f(Jllrthorder RungeKaNa method as outlined in the next section.
4.3.2
FourthOrder RungeKutta
Using this method, the approximations arc more accurate than explicit Euler or sccondorder RungeKutta. The idea is to use the initial slope (m J ) to generate a first guess for the state variable at the midpoint of the integration interval. This first guess is then used to find the slope at the midpoint (m 2 ). A "corrected" midpoint slope (m 3 ) is then found by using mz. A final slope (m 4 ) is found at the end of a step using 111 3 A weighted average of these slopes is then used for the integration. The algorithm is
fill ~
[(I(k), x(k))
(4.29)
fIl 2 =
~ fIllD.I)
(4.30)
fll,
(4.3 J) (4.32)
fIl 4 = [(I(k)
94
x(k
Numerical Integration
Chap.4
+ i)
x(k)
~!lL
11
I
IJ}z
4 + tn, + m
!,
11
uf
(433)
To become rnore familiar with integration techniques, yOll should solve sOllle of your initial problems using the explicit Euler method. Make certain that your step size is small enough so that the errors do not build up 100 rapidly. As you find a need for more accuracy, you should then lise the fourtlHlrdcr RungeKulla method. In Section 4.4 we introduce the MAI'LAB routines that arc available for numerical integration.
4.4
Sec. 4.4
95
step size is adjusted by the routinc to provide the necessary accuracy, witholll taking too !llllch computation limc,
4.4.1
To usc od(~23 or ode4~), the reader must first generate an mfilc 10 evaluate the state
It, xl
where xprimc
rto, t
t ] xO )
is a string variable containing the Halne of the Illfile for the derivatives
to
t t
xO
is the initial time is the fjnal time is the initial condition veclor for the state variables (usually a column vector)
a (column) vcctor or lime an array of state variables as a function of time (column I is Slate I, etc.)
For example, jf the lillle vector has 50 elements, and there arc three state variables, then the stale variable vee lor has the 50 rows and three columns. After the integration is performed, if the student wishes to plot all three variables as a fUllction of time, she/he simply types
plot(t,x)
If you only want to plot the second state variable. then the command
plot (t, x ( : ,2) ) is given.
EXAMPLE 4.4
function hdot
Lwotnk{t,h) ;
consL~(1/{2*sqrtI6)));
'fhcn, the following command is entered ill the !VIATLAB command window:
[t, h 1"'ode4S { T twotnk' , [0100] , [12 7
J ' };
96
Numerical Integration
Chap. 4
Notice lhat we arc generating two arrays, ( and h, and using ode45. The function file is named twotnk. m. The initial time is to :; :;: 0 and the final time is ~r:;;:: 100. The initial condition IS 110:;;:;: fl2 Tj'. At the MATI,AB prompt () the following commands were given:
plot(t,hl"l)) plot (t, hi, ,2) )
12
11.5
11
10.5
10
20
40
60
80
100
7.2 7 6.8
c
N
a. Height of Tank 2
FIGURE 4.8 Transient response curves for interacting tank example.
Notice the tremendous reduction in effort when compared with generating your own RungeKuua code.
Further Reading
97
Often it is desirable to know the state variable valucs at a particular timc or at fixed time steps. A variable stcp size algorithm yields variable valucs that are not at a fixed step sizes. One has two options. If the variable step size is smaller than that of the variable step, then we could reduce the step slze. The major disadvantage is that computation time will increase. The best option (and that recommended by MATLAB) is to use a spline fit to interpolate or extrapolate the values to desired points. The routine used is interpl.
SUMMARY
It is important for the student to understand the Euler, as well as the second and fourth order RungeKutta integration techniques. When using your own fixed step size integration code, be careful with the selection of !1t. In practice, it is preferable to use a commercial integration code, which automaticalJy selects the integration step size. The MATLAB routines llsed were
ODE23: ODE45:
Variable step size, secondorder RungeKutta Variable step size, fourthorder RungeKutta
FURTHER READING
A nice treatment of numerical integration is provided by:
Parker, T.S., & L.O. Chua. (J 989). Practical Numerical Algorithms .ftJr Chaotic S'.vstems. New York: Springer Verlag.
98
Numerical Integration
Chap.4
STUDENT EXERCISES
1. Consider the scaled predatorprey equations.
dy, dy,
=a(ly)y dt .2 I
=
;il
13(1  y,)y,
<X
r3
= 1.0 and the initial conditions arc ."1(0) :;;;; 1.5 and
a. Solve these equtions using explicit Euler integration. Compare various integration step sizes. What b.t do yOll recommend? In addition to transient responses (t versus y, and Y2), also plot "phaseplane" plots (y, versus yz). b. Solve these equations using the MATLAB integration routine ode45. Compare the transient response curves with the Euler results. c. How do the initial conditions effect the response of YI and Y2? Please elahorate.
2. Consider a CSTR with a secondorder reaction. Assurne that the fate of reaction
(per unit volume) is propottional to the square of the concentration of the reacting component. Assuming constant volumc and constant density, show that the modcl~ ing equation is:
dC dt
Use the following parameters:
V 5 . p=.mll1
k 2 = 0.32 flO Ibmol' min'
and a steadystate inlet concentration of C i , = 1.25 Ib11101 fl ' Calculate the steadystate concentration of C, = 0,625 Ibmol ft3 Assume that a step change in thc inlet conccntration occurs at t:::: o. That is, C i changes from 1.25 Ibmol fl} to 1.75 Ihmol ft} atl = 0 minutes. Use ode45 10 simulate how the outlct concentration changes as a function of time.
3. Analyze the stability of the fOliJ1h ordcr RungeKuHa method for the classical order process.
first~
dx
tit
x
What is the largest integration step size before the numerical solution becomes unstable?
Student Exercises
99
4. A gas surge drum has two componcnts (hydrogen and methane) in the feedstream. Let Yi and y represent the mole fraction of methane in the fcedstream "mel drum, respectively. Find dP/dt and {I,v/dt if the inlet and outlet now rates can vary. Also assume that the inlet concentration can vary. Assume the ideal gas law for the effect of pressure and composition on density. Assume that the gas drum volume is 100 liters. The temperature of the drum is 3 J.5 deg C (304.65 K). At steadystate the drum pressurc is 5 atm, the molar flow rate in and out is 2 gmollmin and the concentration is 25Cff! mcthane, 75% hydrogen. Usc Eulcr integration and ode45 to solve the following prohlems. Discuss the effect of integration step size when using Euler integration. In all cases, you arc initially at steadystate. a. Assume that the molar llowrates remain constant, but the inlet methane concentration is changed to 509h. F'ind how pressure and composition change with time. b. Assume that the molar f10wrate out of the drum is proportional to the difference in pressure between the drum and the outlet header, which is at 2 atm pressure. Perform a step change in inlet concentration to 5(Y./o methane, simultaneously with a step change in inlet tlowrate to 3 gmollmin. c. Assume that the MASS f10wrate out of the drum is proportional to the square root of the difference in pressure between the drum and the outlet header (which is at 2 atm pressure). Again, perform a step change in inlet concentration to 501ft" methane, simultaneously with a step ch;:mgc in inlet flowratc to 3 gmol/min, d. Assume that the MASS rlowrates in and out are proportional to the square root of the pressure drops. Assume that the steadystate inlet gas header is at 5 atm. Perform a step change in inlet concentration to 50W" methane, simultaneously with a step change in inlet pressure to 6 atm. 5. Pharmacokinetics is the study of how drugs infused to the hody arc distributed to other parts of the body. The concept of a compartmental model is often used, where it is assumed that the drug is injected into compartment I. Some of the drug is eliminated (reacted) in compartment 1, and some of it diffuses into compartlnent 2 (the rest accumulates in compartment 1). Similarly, some of the drug that diffuses into compartment 2 diffuses back into compartment 1, while some is eliminated by reaction and the rest accumulates in compartment 2. The rates of diffusion and reaction arc directly proportional to the concentration of drug in the compartment of interest. The following balance equations describe the rate of change of drug concentration in each compartment.
100
;:;0
Numerical Integration
Chap. 4
drug concentrations in compartments J and 2 (fLg/kg patient where x J and x2 weight), and u = rate of drug input to compartment 1 (scaled by the patient weight. [Lg/kg min). Experimental studies (of the response of the compartment I concentration to various drug infusions) have led to the following parameter values: (k lO + k 12 ) = 0.26 mini
Vj V2
liquid volume in reactot 1, liters liquid volume in reactor 2, liters k : : : secondorder rate constant. liter/(mol hI')
:::::
b. Show that the steadystate concentrations are 0,33333 mol/liter (reactor I) and 0,0')005 mol/liter (reactor 2), so the specification is met.
(Ilint: You need to solve quadratic equations to ohtain the concentrations,) c. The system is not initially at steadystate. Write a function file and use ode45 for the following:
Student Exercises
101
(i). If C",I(O) = 0.3833 and C",2(0) = 0'()9005, fine! how the concentrations change with time. (ii), [I' C",I(O) = 0.3333 and C",2(0) = 0.14005, find how the concentrations change with time.
7. Consider a batch reactor with a series reaction where component A reacts to form the desired component B reversibly. Component B can also react to form the undesired component C. The process objective is to maximize the yield of component B. A mathematical model is used to predict the time required to achieve the maximum yiele! of B. The reaction scheme can be characterized by
Here k]fand k tr represent the kinetic rate constants for the forward and reverse reactions for the conversion of A to B, while k2 represents the rate constant for the con~ version of B to C. Assuming that each of the reactions is firstorder, the reactor operates at constant volume, and there arc no feed or product streams, the modeling equations arc:
where CA, Cu' and C c represent the concentrations (mol/volume) of components A, B, and C, respectively. a. For k,{= 2, k l ,. = I, ane! k 2 = 1.25 h,l, use ode45 to solve for the concentrations ~IS a function of time. Assume an initial concentration of A of CAO := t mollliter. Then plot the concentrations as a function of time. For what time is the concentration of B maximized? b. Usually there is some uncertainty in the rate constants. If the real value of k2 is 1.5 hr l find how the concentrations vary with time and compare with part a.
SECTION
III
LINEAR SYSTEMS ANALYSIS
Many dynamic chemical processes arc modeled by a set of nonlinear, firstoruer differential equations that generally arise from material and energy balances around the system. Common analysis techniques arc based on linear systems theory and require a ,\tate~space model. Also, most control system design techniques are based on linear models. The purpose of this chapter is to provide an introduction to statespace Inodcls and linearization of nonlinear systems. After studying this chapter the reader should be able to: Write a linear model in stalespace form. Linearize a nonlinear model and place in statespace form. Use thcMATLAB eig function to analyze the stability of a statespace model. Develop the analytical solution of statespace models. Understand stability and transient response charactcrstics as a function of the eigenvalues. Understand the importance of initial condition "direction". Be able to use the MATLAB routines step and initial for simulation of statcspace models. The major sections in this chapter are: 5.1 5.2 5.3 5,4 5.5 5.6 StateSpace Models L,inearization of Nonlinear Models Geometrical Intell1retation of Linearization Solution of the ZeroTnput Form Solution of the General StateSpace Form MATLAB Routines step and initial
105
106
Chap. 5
5.1
STATESPACE MODELS
Thus far in this text we have discussed dynamic models of the general form:
x=
f(x,u)
('ill
where f(x,u) is, in general, a nonlinear function vector. A linear model is a subset of the more general modeling equation (5.1). 'I'he fonn of linear model that we discuss in this chapter is known as a statcspace model. First. \vc show how to write statc~spacc models for systems that arc inherently linear. Tlll'.IL \VC show how to approximate nonlinear systems with linear models. [~xamplc 5.1 illusln:ttcs the form of a statespace model.
EXAi\IPLE 5.1
NOllintcracting Tanks
Consider two tanks in series where the flow nut of the first tank enters the second lank (Figure 5.1). Our objective is to develop a model to describe how the height of liquid in tank 2 changes with lillIe, given the input fJowratc F,,(t). We aSsumc that the flow out of each lank is u linear function of the height of liquid in the tank. Fo
t
h1
tbi. tt=L.
F1
h2
FIGURE 5.1
Noninteracting tanks.
A material balance around the first tank yields (assuming constant density and F] :;;; [1 IlIl)
(5.21
where A J is the constant crosssectional area (parameter), I) I is the flow coefficient (paranlt'((TL Po is the fJowrale into the tank (input), and hi is the tank hcight (state). Writing a materi<l.1 balance around the ~econd lank (since Ii~l :;:: [)2ItZ)
A,
F J _ ../3) II . ' A, 2
Sec. 5.1
StateSpace Models
107
where A 2 is the constant crosssectional area for tank 2 (parameter), ~2 is the now coefficient (parameter), F J is the flowratc into the tank, and /1 2 is the tank height (state). In this case, F I is not an independent input variable that can be manipulated, since F 1 =. {3Jh J " We can write the previous equation as
dI',. A /3, df 
h
1 
~2 h
2
(5.3)
Notice that we can write (5.2) and (5.3) in the following matrix form:
(5.4)
x=Ax+Bu
where:
(5.5)
/3,
A,
/3, A2
The state and input vectors arc (notice that the input is a sC:;llar):
= r~:J
anel
II
= Fo
(5.6)
The additional equation that is nonnally associated with a state space model is y"c:Cx+[)u
where y is a vector of output variables. Generally, output variables arc variables that can he measured (at least conceptually) or arc of particular interest in a siumlation study. Here, we will consider the case where both tank heights arc outputs. Let output I be the first tank height and output 2 be the second tank height
~ o
[I 0] [h'l
I
h,
cc
ex
where:
I [o I
oj
108
Chap, 5
/fwe also consider the input, F o' to be the third output variable, we have the following relationship:
y
which is the form of (5.6), with
' I [] l
1 0 ' ()
1 [;;'] +
2
[F;,]
5.5.1
Example 5.1 illustrated a specific case of a statespace model. In general, a statespace model has the f{)lIowing form:
dX I
dt
I
(JIll X;,
I b ll
H)
I
I h Jill
lim
I
dim U IlI
which has n state variables (x), m input variables (ll) and r output variables (y). This relationship is normally written in the matrix form:
["]
x"
Yr
['
(112
'or] ["
""" x"
btl
(lui
(1,,2
b",
bill
"r]
b~!Il1 I:",
d l2
(;,<2
em
x"
tid
da
Sec. 5.2
109
x~AxlBu y~Cx
IDu
(5.7)
where the dot over a stale variable indicates the derivative with respect to time. A~ shown in Section 5.4, the eigenvalues of the Jacobian matrix (A) determine the slabihty of the system of equations and the "speed" of response. The aij coefficient relates state variable j to the rate of change of state variable i. Sillli~ larly, the bij coefficient relates inputj to the rate of change of state variable i. Also, cij relates state j to output i, while dij relates input) to output i. We can also say that the klh row of C relates all states to the ktll output, while the kth column of C relates state k to all outputs. In this section we have shown how to write modeling equations that arc naturally linear in the statespace form. In the next section we show how to linearize nonlinear models and write them in the statespace form. Linear models are easier to analyze for stability and expected dynamic behavior.
5.2
5.2.1
The function of a single variable, j(x), can be approximated by a truncated Taylor senes approximation around the steadystate operating point (.r):
dx x,
2 dx
(5.9)
x,
(5.10)
Note that:
dx y dl
() ~jx, ~O
(5.11 )
110
Chap. 5
I
.1,
(x x,)
where the notation 0f1(}ti.t is used to indicate the parlial derivative ofJ(x) \vith respect to .t, s evaluated at the steadystate. Since the derivative of a constant (1;) is zero. we call write: dx
dl
d(x dl
'J
I) 13)
I (x  x,)
I,
I
() 1II
ThcTcaSOll for using the expression above is that we arc orten interested in deviations in '1 stale from a steadystale operating point. Sometimes the symbol is llsed to represellt dc viat;rm variu!JIes, x' ::::: X '_:y We can sec that a deviation variable rcprcscllls the CIWll).!C or perturhation (dcviatirm) 1'1'0111 a stcadystate value.
() 1)1
state~space
Corm: dr'
(f
dt
x'
(516)
where {/ :::: iH!dxx s . We have shown how to linearize a single variable equation. Next, system with one state and one input.
\VC
consider a
5.2.2
Similarly, consider a function with one state variable and one input variable
dx
dl
f(X,II)
() 171
(x  xJ
.t,.Il,
dxtJU
.iY'/1 .:
.1,.11,
Sec. 5.2
111
. fix It )
s, s.
iI +.f (Jx
I
.\",.(1,
(x  x )

t
ill
()ll
IJ',
(It 
ItJ
(5.18)
d(x dl
xJ .~. ilf I
ax
',.11,
(x
~. x) +
,
It 
all
ilf
I
',,II,
(li
.~
uJ
11,1':
dx'
dt
= (/ x'
j
b u'
(5.19)
g(x.lI)
(5.20)
Again. performing a Taylor series expansion and truncating the quadratic and higher terms:
(5.21 )
Since g(x,I"u\) is simply the stcadystate value of the output Cv), we can write:
(5.22)
or
y  y, ~
where c:::: aJ;J{)xi.\. \" /I s and d
co (x  xJ + d (li  lIJ
= dg/au:,_ '
.\',II.\'
y' ,,::.
l~xalnplc
x'
+ d II'
one~input,
(5.23)
oneslate nonlinear
system.
112
Chap. 5
13 \ II
.'1
.1
\vhcrc Ii i\ tlie
sjalC
\ariilhlc. F is the input \'ariahlc. 13 Hild A arc parameters. The riglJlhand side is:
I(ld)
r
A
1(l1F)
I
I ,
\
,I
Ij \
hi '
I
I
[3
2/\ \ h,
III
(:,),251
rile ftl'\l terll] ell] the righthand side is lern. because the lincari/<ltioll is ahout a slcady~swtc point. That is.
<ih
W(, call jll)\'\ \\Tite:
I J
()
dl!'
.1
d(h
hJ
<il
1,,\ \ II
I'
II, 11.1
j
I
+
II
and dmpping the
II'::::
I'
2/\\ 11,
<II
I.'
II" ,I
!'\)r \:UIl\CllicllCC (simplicl1;' in llotatj()!11 we often urlJJ! the (') notation and assume that x ~l!1d II
/I::::
(,i
dIld
write:
I I
til:
dl
IJ
2/\ \' h,
"
dr
dr
uxlbu
(527)
5.2.3
The prC\ious cx,ullples sho\\ed how to linearize singlestale vari~lhlc systems. In this seclion \VC geJlcralizc the technilJue for any' I1umber slates. lkfnre vvc generalize the techniquc. it is worthv,hile to consider an example system with Ivve) states, olle input and OIlC output.
ur
~ . ._             _
Sec. 5.2
113
EXAMl'LE 5.3
Two~statc
(5.29)
(5.30) Performing a Taylor series expansion of the nonlinear functions, and neglecting the quadratic and higher terms:
"\x,
we can write the statespace model:
dl
=or,,} and
d(x]  x 2 )
lit
114
Chap. 5
,II,
(Ju
f
[ df e
(JII
_.
,ll""1
dg
ilx,
(5.311
XI,
<lg
t .. " . "
d.t]
,II~'
t"
\\hid)
i~
x'
y'
\\here (') indicates dC\iation variahles.
A x' ex'
+ H u' + D u'
J
lJ
5.2.4
Generalization
is
(j
NO\\ consider the tll'ncral nonlinear Illodel \\'hcrc x is <l \cdor of II state v<triable,,_ v('clOr of III input \ariahlcs and y is a vectur of r output \ariables:
x,
xn
V ,
..
1;,(x 1
, .. lI m )
Yr
In \ector notation:
g,(.\l"
,X",II], .. .11 1)
f( X,II) g(x,u)
15 ..\.11
(';,\41
F killen!" of the linearization matrices arc defined III the follll\ving fashion:
/\ 1.1
(lX,' __ Ii
"1.1
<11/,
I .. "
Sec. 5.2
115
c, '.I
II
I
.1,_1<,
(5.37)
i)u D = ""
aU
j
I
"/'>
(538)
statc~spacc
form:
x'
y'
Generally, the () notation is dropped and it is understood that the model is in deviation variable form:
x=Ax+BlI y=Cx+[)lI
Usually, the measured (output) variable is not a direct function of the input variable, so it is Illore common to sec the following state~spacc model:
x~Ax+BlI
[~xample
5.4.
EXAMPLE 5.4
Interacting Tanks
FIGURE 5.2
Interacting tanks.
AsslIlne that the flowratc out of tanks is a nonlinear function of tank height. The f]owratc out of tank one is a function of the difference in levels between tank I and lank 2.
116
Chap. 5
Also, assume that only the second tank height is measured. The output, in deviation variable form is
Notice that there arc two state variables, one input variable, and one outptH variable. Let
= F F,
IJ I
2A I Vhl,\~h~;
The clements of the A (Jacobian) and R matrices 5.35) and (5.36 arc:
lJil 1
Au
=
"fl
I I
hJ;
ilf ah'}
2
h F
".<
2A1VhL\=7i~\
~I
2A2v'hl;~li;_;
~J
~2
2A,vh"
li
=
II
1
Al
=0
Since only the height of the second tank is measured, y
=
0:::
ilL,
(from (5.37)):
ell
(jj;; k.", ~~ 0
Sec. 5.3
Interpretation of Linearization
117
Il,
(!li'] [
{fJ:}
Il,
2A2V/hl,~h2'
dt
Ul}UI
1~:1
y
where:
[O!]
In this section we have shown how to linearize a nonlinear process model and put it in slatespace form. The states in this model arc in deviation (perturbation) variahle form; that is, the states arc perturbations from a nominal stcady~stat:c. A stalespace moclel provides a good approximation to the physical system when the operating point is "close" to the linearization point (nominal steadystate).
5.3
INTERPRETATION OF LINEARIZATION
In Section 5.2 we illustrated the method of linearization of models into slalc~space form. The objective of this section is to illustrate what is meant hy linearization of a function. Consider the single tank height problem, which has the following model:
dh
dl
~
J(h,l')c
F
A
f3
II
vh
...
(5.39)
for a system with A = 1 n2 , !Is :::: 5 ft, and fj ;;:; ft L5 /min the steadystate f10wrale is 3/min. To focus our analysis 011 the meaning of the linearization with rcspect to F s ;;;;: I ft the statc variable, consider the ease where the input is constant. Then, from (5.39) and the given parameter valucs:
I/V5
f(hYJ
performing the lincarization:
c.c
I ~
vh
(5.40)
J(h.FJ = f(h,,!',)
+:"If I . (h ~ h,)
dh
h,)"s
118
Chap, 5
0,5
"'"
linear
a,s
4 x
10
FIGlJRE 5.3 Basic idea of linearization. 'rhe linear approximation is exact for the steadystate value of x;::o: 5.
2\15
(h 
hJ
(54 I)
10
1"
.' ..
o
10
'
20
lime, min
30
40
50
FIGURE 5.4
initial conditions.
Sec. 5.4
Solution of the
Zero~lnput Form
119
We can see how good tbe linear approximation is by ploning both the nonlinear function (5.40) and the linear function (5.4l), as shown inlijgurc 5.3 011 p. liS. Here we have used x to represent tank height and .f(x) to represent the nonlinear and linear functions. Notice that the linear approxiruation works well between roughly 3.5 to 7 feet. or course, the two functions arc exactly equal at the steadystate value of 5 [eet, which was the point at which the Taylor series expansion was performed. H.calizc that .f(x) is dx/dt, which is the rate of change of tank height. It makes sense that the rate of change is positive at a tank height less limn 5 feet, because the system "seeks" to achieve a steadystate level of 5 feel. Similarly, for a tank height greater that 5 feet, the rate of change of tank height is negative, because the level "desires" to decrease to 5 feet. We can also see that the linear system wiJl be slower than the nonlinear syslem, if the tank height is less that 5 feet, but will be faster if the height is greater than 5 feet, as shown in Figure 5.4.
5.4
where x and u are deviation variable vectors for the stales and inpulS, respectively. In this section we assume Ihat the inputs are held constant at their steadystate values, but thaI the states may be initially perturbed from steady~state. The "zeroinput" form of the state space model is then:
.j [ [
\1
all
{/lll
t'/I
{lnl
(/1I2
llll/l
] 1 r
XI
.fn
or
Ax
(542)
This form is used to analyze the stability of a system and to understand thc dynamic behavior of a system that has had its statcs perturbed from the steadystate values. Recall that the single variable equation:
X
has the solution:
ax
X(I)
,,'" x(O)
X(I) ~ e"'x(O)
(5.43)
and the solution to (5.43) is stable if all of the eigenvalues of A are less than zero. The response of (5.43) is oscillatory if the eigenvalues arc complex.
120
Chap. 5
There arc many differenl ways to calculate the exponential of a matrix; in this chapter we discuss only the similarity tr{[n.~1"orm method.
Recall that the eigenvector/eigenvalue problem is written (sec Module 2 for a review):
AV=V;\
l<Of a 2X2 A matrix we have the following eigenvector matrix:
(5.44)
V =
where
[s,
S2J
v" =. v"
S,
= [~~:]=
[~~~]
"12) "22
(5.45)
S2 =
I I
I.., 1.. 0 0
2
(5.46)
A=V;\V '
multiplying by the scalar t and taking the matrix exponential, we find:
eM
(5.47)
= V
ei\1
VI
(5.48)
(5.49)
An interesting result is that an initial condition vector in the same direction as ~i has a response in the direction of ~i with a "speed or response" of Ai" This is shown by the foll{)w~ ing analysis.
5.4.1
x=
Define a new vector z, such that
Ax
(5.42)
x = Vz
(5.51 )
Sec. 5.4
121
or
z = V J X
and notice that (from (5.51 )):
(5.52)
x=
Substituting (5.53) and (5.51) into (5.42):
V Z
(5.53)
Vz=AVz
or, left multiplying by VI
(5.54)
z = Vi A Vz
But, from (5.44) A V = V A
so we can write:
(5.55)
V'AV=!\
which yields (from (5.55) and (5.56)):
(5.56)
z=
=
!\ z
(5.57)
(5.58)
z]
which have the solutions:
= "IZ\
"2 Z2
(5.59) (5.60)
12 =
z,(t)
z,(I)
and we can write:
=
Z,(O) e'"
(5.61) (5.62)
= Z2(0) e'i
[ ZI(t)1 z,(t)
or
(5.63)
z(t)
z(O)
(5.64)
122
then:
Chap. 5
z(t)
and, if tile z(()) vector has the form:
(5.66)
(').67)
then,
(568)
"
'I'llis means that state variable initial conditions in the "direction" of the first eigenvector will have a speed or response associated with the first eigenvalue:
(569)
and state variable initial conditions in the "direction" of the second eigenvector will have a speed or response associated with the second eigenvalue
x(t)
v z(t)
(5.71l)
Knowing the effect of the initial condition "direction" is impOitant. If a randOlll case study approach was taken, then we might arbitrarily select initial conditions that \verc '"fast.'" \vhilc other (missed) initial conditions could cause a much slo\\'cr response. We \vill show two examples of tbe cfree! of initial condition: Example 5.5, where the syS!elll is stable, and r':xample 5.6, \\'here the system is unstable.
Sec,5A
123
I<;XAMI'LE 5.5
A Stable System
+ x2
(5,71 )
(5,72)
x = Ax
The Jacobian matrix is
A
(5A2)
= [. 1l.5
1 '.1
(5,73)
2
det ([.
so
+ 05
 1
J)
A+ 2
= (A
+ 05)(A + 2)
A,
and the eigenvectors are
 0,5
A,
= 
X(I)
= V
e'" V 'x(O)
O
0,5547J[.e 0,8321
"
e"
(5,74)
x(O)
~ [~J
(5,75)
X(l)
[I e~5'1
(5,76)
X(O)
= I.  0.5547.1 0,8321
(5,77)
124
Chap. 5
X(f)
 0.5547
0.8321
(5.781
Note that x(O) :::; ~l"'" f.lll is the slow initial condition and x(O) :;; ~2 :::;; I~;_:~_:~
I is
the fast
initial condition, as shown in Figures 5.4 and 5.5. The initial conditions in the fast subspace IWH' reached the steadystate in roughly 2.5 minutes (Figure 5.6), while the initial conditions in the slow subspace afC roughly 7SCYo complete in 2.5 minutes (J'igurc 5.6').
11'IGlJRE S5
subspace.
The expm (matrix exponential) function from MATLAB can be llsed to verify these simulations. Using t :;; 0.5 and the fast initial condition, we find
;:::
[~O. ~j
1;
0, '2] ;
x ;;; expm(a*O.5)*[O.5547
x ;:::
0.8321]
0.2040
0.3061
Sec. 5.4
125
in I,\gurc 5.6.
fa.:H suospace
'=' o 2 345
Transient response for initial condition in the fast
FIGURE 5.6
subspace.
The previous example was a stable system. The next example is an unstable system.
EXAMPLE 5.6
2x 1
+ Xl
~\'2
= 2x, . Xl
2 1 .2
 I
II
A2
=.
= 1.5616
2.5616
<= 1
...
0.270:1 .1 O.962g .
<2 
l0.4896
o.R719]
since Al < 0, is a stable subspace; since A2 >. 0, S2 IS an unstable suhspace. The solution for this system is:
Xl __._ ["
s[
() 
o.R71911e
15(,lr"
e 1.56 \(il.O.9907
11 0.5038
126
Chap. 5
x(O)
we find the fulJrming :1,l1C SolUli(l1l
O.~h2f; I
xl t)
which is a stablt' solution.
~I\
O.270J ('
 O,9h28 ('
r"i)!UH:
shown in
.".7
o
x
0 5
stable sUbspace
1/ "
f /,.
~~
~~~===I
x(O)
~[
0.2703] 0 9628
I'L:::;;o 2 3
FlCa"IU: 5.7
X7191
02
O~
06
08
FIGUIU: 5.8
Il should be noted lhal if the initial conditioll is Ill)! ('.Y(lU/\' in the stahle slIh"pacc. the solUliull \\'illl.w~jll to di\l'I'!,!c and hCCOllll' unslahk. Thut is. if thl' initlal cunditi()11 i" olT by. "a;, 10 !p. thl' rl'Sp()Il"l~ \\,ill l'\,cntually lxconw Llllbuumkd.
Sec. 5.6
127
5.5
[] ["
or
at?
__u:
11
ali?
"T] l"
(lll/!~
\ /I
b 12
;.]
b nm .
",
b"l
b n2
_U~iI
(5.79)
x~Ax
Illu
x=a.\lbu
has the solution:
(5.80)
X(I)
when u(f) = constant = {f(O).
~c
(5.8 I)
nCO~
from
to tis
X(I)
where
P xeD)
Q u(O)
(5.82)
(583)
and
F:quation (5.82) can be used to time step by using:
ttl
(I'  I) A 'II
(5.84)
solve f{}I' a system where the inputs change from time step
X(I + AI)
More often this is written as
P X(I)
+ Q U(I)
(585)
x(k + I)
Px(k) + Qu(k)
(5.86)
where k represents the kth time step. Often a general purpose nuttlcrical integration tcch~ niquc (such as one presented in Chapter 4) will be used to solve (5.79).
5.6
128
Chap. 5
EXA!\'1PLE 5.7
Consider the follO\ving: lincarilcd form of a biorcactor model with suhstrate inhibition kinetics (see tvloduJe 8 for details):
x=AxfBu
)'=Cx+Du
where:
A=
o
 0.7500
009056] 2.5640
II [o 0]
J) 
[~;I
0.9056;0.7500, ).')640]
<::1
a =
[0,
0.9056
[1.5302;3.8255)
1.5302 3.8255
>,.c
[l,O;l,OJ
0
1
o
c1
[0;0)
o
o
Sec. 5.6
MATLAB Routines
~;tep
and initiiJl
129
eig(a)
ans : :; :
~().3000
2.2640
The system is stable. Assume the process is initially at steadystate. Since this model is in deviation variable form, the initial condition is the zero vector.
5.6.1
The MATLAB step [unction assumes a deviation variable form (the initial conditions are zero). The cOlllmands arc.:
[y,x, t]
stcp{a,b,c,d,l);
" plol(t.,y) which yields the plot shown in Figure 5.9. Notice that the ::3 tep function automatically determined the length of the Ii me vector. You may also provide an equal~spaccd time vector and usc the following command [y,x] = step(a,b,c,d,l,t)
5.6.2
The MATLAB ini t ial function assumes a deviation variable form, with the initial conditions perturbed from zero. The commands arc:
FIGURE 5.9
130
Chap. 5
[Y,x,tJ
initial(a,b,c,d/l);
ploL(t,y)
Notice that the band d matrices are not really used by' the initial function. since it is assUllled that there is no input change.
SUMMARY
In this chapter we have developed a statc~spacc model of a chemical process thm is in.. hcrcntly linear (e.g., the tank height example). \\ic have also \ho\vn I1mv to linearize models that are nonlinear. The models obtained in this fashion arc based on r/eriulioll l'ariables, that is. the states and inputs arc perturhotiolls from the steadystate operating point where the linearization is pcrfonncd. The stahility of a nonlinear syqcrn is determined from the eigellvalues of the Jacobian matrix in the linearized model (statcsracc form ). Several important concepts were presented in this chapter.
For unforced systems (zero input). the initial conditiclll vector \vil! determine the "speed" (If response. For stable systems (all A 0), the eigenvector associated \vith the largest rnagnitude A is the fast direction, while the eigenvector associated with the smallest A is the s\()\v direction. Although it is possible for a system with both Ilegatin; (stable) and positi\e (unstable) eigenvalues to have stable behavior if the initial condition is In the stable subspace, this is impossible in practice. Any perturhation from the stable trajectory \vill cause lhe solution to become unbounded (unstable). The I,,:1ATLAB routines that \vere used include:
exprn:
step:
Statespace rnodels can be transformed to Laplace transfer function fOnl1, which is particularly useful for control sy'stcm design. Applications of Laplace transforms \vill be presented in Chapters 7 through 10. Eigcnvector/cigenvalue analysis \vill be useful in perfonning phase~p!anc analysis. which is covered in Chapter 13. The reader should understand the fol\O\ving terms: statespace Jacobian deviation or perturbation variable eigenvalue
131
FURTHER READING
L,inearization is discussed briefly in most books on process control, including: Luyben, W.L. (1990). Process Modeling, Simulation and Control for Chelnical Engineers, 2nd Ed., New York: McGrawHill. Marlin, T.E. (1995). Process Control. Designing Processes and Control Systems for Dynamic Performance, New York: McGrawHilI. Ogullnaike, B.A. and W. H. Ray (1994). Process Dynamics, Modeling and Control, New York: Oxford University Press. Seborg, D.E., T.F. Edgar, and D.A. Mcllichamp (1989). Process Dynamics and Control, New York: Wiley. Stephanopoulos, G. (1984). Chemical Process (:ol1trol: An Introduction to Theory and Practice, Englewood Cliffs, NJ: PrenticeHall.
STUDENT EXERCISES
1. As a process development engineer you arc working on a process with three continuousstirredtank reactors (CSTRs) in series. A constant volumetric H(l\vrate (flowratc docs not vary with time) is maintained throughout the system, howcver the volume in each reactor is different (but constant). Since thc temperature varies from reactor to reactor (but is constant in an individual reactor) the reaction rate parameter is different for each reactor. The molar concentration of the inlet stream varies.
Assume that the density of the streams remains constant (independent of concentration). The reaction is a firstorder (irreversible) decomposition (11 > B). Molar rate of decomposition of A (per unit volume) = k CA
132
Chap. 5
V, = I() ft1 V, = ft' V, = 5 fl ' :;:; O.O:n3 mini k::.::::: 0.2 min 1
k:;:::
0.55 mirr 1
2. Consider a chemical reactor with bypass. as shO\vn below. Assume that the rcnction rate (per unit volullle) is firstorder (r::: kC j ) and ('I is the concentration in the reactor (the reactor is perfectly' mixed). Assume that the volume in the reactor (V) and the feed flowrate (F) remain constant. crhc fraction of feed bypassing the reactor is (l a)F and that entering the reactor is aF. Assume that the fraction bypassing the re~ actor does not change. The inlet concentration (C i) is the input vmiable and the mixed outlet strcarn composition (e 2 ) is the output variable. \\lrite this model in statespace form (this model is inherently linear, so deviation variahles are not neededj.
o(.{)
A :( + n If \"=C'x+Dl/
k. I
.~)
k.,
[i
~,
.)
A + A
k,
d('., dl dC"
dl
V ( .. ("/1)1 (k,
I
(A 
k: elll
I liters 6 mol min
where
k,
5
6
min
Ie
10 mol
5
]
nlln I k, =:
(Ii
("
ii'
.,~
mol
liter
I iter
a. Find the steadystate dilution raIl' UIVj and concentration of B (show all units). h. Linearizc and put in statespace hlrm (find the numerical values of the A. B, and (' matrices), assuming that the manipulated vari,l!,!e is dilution rate (F/I/) , and the output variable is CI). c. r;'ind the eigenvalues (shmv units). d. Find perturbations in initial conditions that arc in the fastest and slo\vcsl directions.
Student Exercises
133
4. A chemical reactor that has a singlc secondordcr reaction and an outlct r10wrate that is a linear function of hcight has the following model:
dVC  = Fe dt
In
 FC  WC
III
(5.87)
dV = F F dt III
(5.88)
where the outlct f10wratc is linearly related to the volume of liquid in the reactor
(F == 13V). The parameters, variables and thcir steadystate values are shown below.
== inlet llowrate (I liter/min) C in = inlet concentration (l gmolliiter) C == tank concentration (0.5 gmollliter) V = tank volume (I liter) k == reaction rale constant (2 liter/(gmol min)) f3 == I min l
Fill
Equations (5.87) and (5.88) can be written in physical state variahle form as
dC = Fi" (C _ C) _ kC 2 dt V (1l
(5.89)
dV
dt = F  "V t..J
11/
(5.90)
list the states, outputs, inputs and parameters for the nonlinear equations (5.89) and (5.90). b. Linearizc (5.89) and (5.90) and write the state space modcl (find the numeric_al values for the A, B, and C matrices), assuming that thc inlet tlowratc is the input variable and that both states arc output variables. Define thc deviation variahles for states, inputs, and outputs. 5. Find the "fast" and "slow" initial conditions for the foJlowing model
H.
6. Find the stable and unstable subspaccs for the following system of equations
Plot the transient responses for initial conditions in both the stable and unstable subspaces. Show that a small perturbation from the stable initial condition will lead to an unstable solution.
134
Chap, 5
"I
AI,
13
A,
13 1
1
.
A,
13, ,
I';,
Consider a system where the stcady~statc f10wratcs arc 5 ftJ/min, and the following crosssectional areas and steadystate heights:
Al ~
2n'
2.5 It
A, ~
lon'
5 It
hi
We find (1"')Ill F I ~
h,
nlln
1,
1
0,2  OJ
0 '1Ih ,I+[05I F h,
l
"
:J [o
()
a. Work in deviation variable form and find the fast and slow subspaces. Use ini tial to simulate the unforced deviation variable systcrn (input deviation remains constant at 0), from initial conditions in both the fast and slow suhspaces. h. Usc the results from part <1, and convert to the actual physical variables. c. Work in physical variable form. Usc ini tial to simulate the unhJrced deviation variable system (input remains constant), from initial conditions in both the fast and slow subspaccs. Show that the results obtained afe the same as those in part b. 8. As a chemical engineer in the pharmaceutical industry you are responsible for a process that uses a bacteria to produce an antibiotic. The reactor has been contaminated with a protozoan that consumes the bacteria. The predatorprey equations arc Llsed to model the system (b ::::: bacteria (prey), jJ ::::: protozoa (predator)). The time unit is days.
dh
dl dl' dl
'Y bp
13 I'
Student Exercises
135
b. Usc the scaled variables, tv and z, to find thc following scaled modeling equations
Ii
ll' rill'
z=
d/
,,(I
=~
~z)w
dz
d/
fl (1
w)
c. [<'ind the eigenvalues of the Jacobian matrix for the scaled equations, evaluated at W s and zr Realize that ll'.I ' and z,\. are 1.0 by definition, Find the eigenvalues in terms of ct and f3. d. "rhe parameters arc (~ :::0 f3 ;:; : 1.0 and the initial conditions arc w(O) ;:;;: 1.5 and z(O) = 0.75. i. Linearize and write the statespacel~ml1 (let the state variables be Xl :::0 HI , It\ and );:, ;;;;; Z  z).Find the initial condition vector xo ;;;;; [,,".,0)) [, to use . ~ . 'x,D with in.it_ial. ii. Solve the state space model from (I) lIsing lsim and plot the transient response of Xl and x2 as a function of time (plot these curves on the same graph), simulating to at least t ;:;;: 20. iii. Show a phaseplane plot, placing Xt on the xaxis and x2 on the yaxis. iv. WhItt is the "peaktopeak" time for the bacteria? By how much time docs the protozoan "lag" the bacteria? 9. Consider the statespace model
Ii'l I. ~ 1.0
"2
4.0
5.0
a. Find the "fast" and "slow" initial condition directions. 10. Consider the foJiowing system of two reactors.
136
Chap. 5
Assullle a firsHmJcr decornpositi()tl of ;\>8. Assume that all flo\\TatC\ arc C(lll stant (volumes arc consUlllt). a. \\;'ritc the moueling equations for concentration or A, using either the instantaneous or integral method. h. \Vritc these in statespace form:
X~AX4
Bu
I;,
cu
_ kgnlOl
.j
L
IJ.3.1.13.1 hr
V~ = l)m
111
VI'" 15nr'
d. Find the eigenvalues of the A matrix. Discuss the swbility of this Sy'stClll.
e. The inlet concentration.
('Ii'
simulatc the behaVior of this system. 11. ;\ stirrc,d lank heater is used to supply a chemical proct:~ss \vith a fluid at a constant temperature. The heater receives fluid from an upstrcam pnll'l'SS unit \vhich may cause the f10wrate or tcmperature to change. Consider the diagram of the stirred tailk heater sho\vn belt)\:!". \vhere the tank inlet stream is received from another process unit. /\ heat transfer fluid is circulated through ajacket to heat the fluid in the tank, Assume that no change of phase nccurs in either the tank liyuid or the jacket liquid.
Tank inlet
F,
T,
~
V
r

Jacket inlet
T
Tank outlet
Part 1
a. Write the dynamic modeling equatiolls to find the tank ami jacket tcmperaturcs. Do not usc any numerical valuesJeavc these equations in terms of the process parameters and variahles. State any additional assumptions needed [0 sol ve the problem.
Student Exercises Assume: Constant level. Perfect mixing in both the tank and jacket.
137
The tank inlet flowratc, jacket flowrate, tank inlet temperature, and jacket inlet temperature may change. The rate of heat transfer from the jacket to the tank is governed by the equation Q ;:;; UAClj ~ T), where U is the overall heat transfer coefficient and A is the area for heat exchange. b. State the nl(~jor objective of this process. c. What do you consider the most important measured variable? d. What is a likely input variable variahle that you would use to maintain a desired tank temperature?
Part 2
Assume that both the tank fluid and the jacket fluid are water. The steadystate ues of this system variables and some parameters arc:
val~
I'l' min
p(~, = 61.3
OF
Btu
p/'~)j = 61.3
Btu OF
1; =
Tjill
=
50"F
20(Y'F
Toe 125F
7; = 150"F
v c=
10
n'
V = 1 ft' J
e. Find Fj and UA (show units) at steadystate. f. Linearize the set of two nonlinear ODEs obtained in problem a, to obtain the state space form:
x=Ax+Uu
where
x=
state variables
u=
input variables
Y= 1 T 7: J J.I
1' l' ]
= output variables
Determine the A, H, and C matrices (symbolically and numerically) g. Find the eigenvalues of A.
138
Chap. 5
Part 3
h. Simulate the system of statespace equations for a step change in the jacket flowratc from F:i =: 1.5 ft 3/min to l'j =1.75 ft 3/rnin F at time::: 5 minutes (work in deviation variables, but remember to convert back to physical variahles before plotting). What is the final value of the states, in the physical variables (T and 7/? Plot the response. i. Perform some simulations with step changes on some of the other input variables. Comment on any different behavior that yOll Illay observe.
12. Consider the following model of 2stagc ahsorption column:
13. Most chemical proccss plants have a natural gas header that circulates through the
process plant. A simplified version of such a header is shown below.
Pi
From source valve i Plant piping, represented as a perfectly mixed drum Gas drum for a boilerhotlse unit To furnaces
Here, the natural gas enters the process plant from a source (the natural gas pipeline) through a control valve. It flows through the plant piping, which we have represcnted as a perfectly mixed drum for simplicity. Another valve connects thc
Student Exercises
139
plant piping to the gas drum for a hoilerhouse unit. Gas passes through another valve to the hoilerhouse furnaces. The objective of this problem is to develop a linear model that relates changes in valve position to changes in drum pressures. a. Write modeling equations assuming that the pressures in drums I and 2 arc the state variables. Let thcinput variables be (I) valve position I, (2) valve position 2, and (3) sourcc prcssure. b. Solve for the steadystate conditions and write the modeling equations in lincar, deviation variable form.
x=Ax+Uu
y = ex p rP2,  1"'1 Ph
x=
state variables
\I
:;::
J
= input
variables
output variables
c. Study the effect of step changes in each input on each tank pressure.
HINTS: For simplicity, assume that the following equations can be used for the flow through the valves:
fJj
=::
where the f10wrate is in Ibmol/min, h is the fraction that a valve is open (varies between 0 and I), and Ct is a valve coefficient.
assume that each valve is 1/2 open under these conditions (his:::: h lA,:::: h 2s == 0.5)
140
State~Space Formulation
Chap. 5
CONSTANTS:
V, ~ I 135 n3, V, ~ 329 ft3, Temperature ~ 32 "F
R (gas constant)
MAGNITUDE OF STEP CHANGES:
10.73
psia ft J IbmoloR
Make separate step changes of 0.1 (10(*)) in the valve openings, and! 0 psia in the inlet pressure. Simulate for t:::; 0 to I = 15 minutes. 14. A strealll contains a waste chemical, W, with a concentration of 1 mol/liter. To Illeet EPA and slale standards, at least 9()fJ{) of the chemical must be removed by reaction. The chemical decomposes by a secondorder reaction with a rale constant of 1.5 liter/(mol hr). The stream nowratc is 100 Iiter/hr and two available reactors (400 and 2000 liters) have been placed in series (the smaller reactor is placed before the larger onc). a. Write the modeling equations for the concentration of the waste chemical. A')sumc constant volume and constant density. Let
('wi
~
C w2 F
V, V 2
k
concentration in reactor 1, mol/liter concentration in reactor 2, mol/liter volumetric flowrate, liter/hr liquid volume in reactor I, liters liquid volume in reactor 2, liters secondorder rate constant, liter/Cmol hI')
b. Show that the steadystale concentrations are 0.33333 mol/liter (reactor I) and 0.09005 mol/liter (reactor 2), so the specification is met. (Hint: You need to solve quadratic equations to obtain the concentrations.) c. L,inearize at steadystate and develop the state space model (analytical), of the form:
x
where:
AxtBu
u~
 0.320 IS
Il
.=
(also, show the units associated with each coefficient) c. i. Find the eigenvalues and eigenvectors using the MATLAB eig function. ii. Find the eigenvalues by hand, by solving det(Al A) ~ o.
Student Exercises
141
f. The system is not initially at steadystate. Solvc the following for the linearized model, using the MATLAI3 function initial (first, convert the physical variables to deviation variablcs) i. If Cw,(O) = 0.3833 and C w2 (0) = O.(J9005, find how the concentrations change with timc. ii. If Cw,(O) = 0.3333 and CwiO) = 0.14005, find how the concentrations change with time. Relate these responses to the eigenvalues/eigenvector analysis of c. Discuss the differences in speeds of response (you should find that a perturbation in the first reactor concentration responds more rapidly and a perturbation in the second reactor concentration). The MATL.AB ini tial function needs you to create the following matrices before using it:
[1o 01 1
g. Solve f for the nonlinear equations, using ode4 5. Compare the linear and nonlinear variables on the same plots (make certain you convert from deviation to physical variables for the linear results).
0=[0 01
h. Now, consider a step change in the flowrate from 100 liters/hour to 110 liters/hour. Assume the initial concentrations arc the steadystate values (0.3333 and ().(l9005). Compare the IincHr and nonlinear responses of the reactor concentrations. Is the removal specification still obtained? i. Would better steadystate removal of W be obtained if the order of the reaction vessels was reversed? Why or why not? (Show your calculations.)
The purpose of this chapter is to review methods to solve solve linear 11th order ()[)F~s, After studying this material, the student will be able 10: Transform a linear statespace model with differential equation.
1/
Solving Nonhomogeneous, Linear OIJEs with Constant CocfTicicnts Equations with Time Varying Parameters Routh Stability Criterion ,.. Determining Stability without Calculating l:':igenvalues
142
Sec. 6.1
Background
143
6.1
BACKGROUND
A model composed of a single, nth order linear ordinary differential equation has the lowing form:
fol~
... + {/,(t)
(6.1 )
It
where the state variable is x and the input variable is u. 'rhis general model is linear because the state (x) and input (ll) and all of their derivatives with respect to time appear linearly. Notice thallhc coefficients do not have to be linear functions of time, however.
Models of the form of (6.1) do not arise naturally when chemical processes arc
modeled. As shown in previous chapters, dynamic chemical process models arc generally sets of firstorder (either linear or nonlinear ordinary differential equations. The advantage of the form of (6.1) is that there exist a number ortcchniques to obtain analytical solutions. In this chaptcr we show how t(? transform scts of lincar, firstorder differclltial equations to a single nth order differential equation. We then review several techniques for solving this type of equation. For motivation, we use Hbatch reactor example to illustrate each of the tcdllliques. It should be noted that there arc many good mathematics tcxts that covcr each of these techniques in more depth (see Boyce andlJiPrima, 1992, for cxampic). Our goal here is to provide a concisc overview of some morc lIscful tcchniques to solve dynamic chemical process problems.
EXAMPLE 6.1
Hatch Chemical
R(~ador
Cunsidcr a hatch chemical reactor, where there is no flow in or out of the vessel. The reactor is initially charged \vith a liquid of volume \I and an initial concentration (mol/liter) of reactant A
of" C~,IO'
We consider a series reaction where component A reacts to lImn the desired component B. Component B call rurther relet to form the undesired component C. Each of the reactions is irreversihle, so A can react 10 rorm R, hUI B does not react to form A.
A
,>1
k 11 } C
Here k l represents kinetic rate constant (lime l ) for the conversion of /\ to Ii, while k] represents the rale constant II)r the conversion of U to C. Since component 8 is the desired product, we would like to know how long to run the feaction in order to maximi/.c the amount of 8 produced. If the reaction time is too long, all or B will eventually be converted to C,
Develop the Modeling Equations. Assume that each of the reactions is firstorder. Since the volume is constant (dVldt ;:;:; 0), and there is no flow in or out, the modeling equations arc (the reader should be able to derive these, based on material balances on each component);
144
Chap. 6
dC""j dt
~{_Cll dt
k 1 Cit
(6.2)
(6.3)
dec _ . '
{/
' Ie,
(II
(6.4)
where C.',\' C'fj, Hnd C( represent the concentrations (mol/volume) of components A. fl, and C, respectively. The units for the rate constants (k 1 and "2) arc LIllie' I. Notice that the time faLl' of change of component A is only a fUllction of the COllccntnllion of /\. 'fhcH equation (6.2) call be solved, since C~4 and t arc separable, (0 find (6.5)
where C;\O is the initial condition for the concentration of 1\. If we define the conversion of A as \: :;;:; (CAO  C;\)/('"o and the dimensionless time T :::: kJt. (6.5) can be represented by the single
~ ('7).
0.8
.Q
0.6
ill
g0.4
c
"' >
0.2
o o
FIGlJRE 6.1
dimensionless time
Reduce to a Single Equation for CB. Here we have (wo different ways to solve for Method I, Substitute (6.5) into (6.3) to obtain the expression
ell'
(6.6)
Sec. 6.2
145
Equation (6.6) is a linear, constant coefficient, heterogeneous differential cquatiOiL ]t is hetenJgcneolls because of the "forcing function" on the righthand side. Heterogeneous equations are solved in Section 6.3. Method 2. Here we can rewrite (6.3) to solve for ell in terms of en:
(6.7)
Substituting (6.7) and (6.8) into (6.2), we find the secondorder equation:
+ (k, + k,)
deft
til
+ k,k,
('/I
(6.9)
Equation (6. J 0) is known as a linear, constant coefficient, homogeneolls differential equation. The term homogeneous means that there is no "forcing function" on the rigbthand side. In Section 6.2 we cover the solution of these equations.
6.2
d/lx
lin
tit'f
+ an _ I
{pr1x dt'll
dx
(6.11)
Equation (6.12) is called the characteristic equation. The n roots of the characteristic equation are called eigenvalues (in control textbooks the rools are often called poles). The eigenvalues arc used to solve (6.1 I). Two related methods are used, depending on whether the eigenvalues are distinct (all are different) or repeated (some are the same),
146
Chap. 6
6.2.1
Distinct Eigenvalues
JI
We sce that (6.12) is ,jJl nth order polynomial that will have arc distinct (not repeated), the solution to (6.11) is
where each the constants ('I through en is found from the initial conditions, \iO). !lx ll " I (0 l!dIIl1 . In (lrder [0 find the coefficients, c i' \VC rl)ust know the illitia/ cOlldifiollS for r and its
derivatives.
or
6.1 Continued.
~c('
l'nllll equation (6.2) that the concentration of /\ does not depend on the vahle:; or U
e
til
lIle
(h,14)
l'haracteri'ilic
cqlW(IOII is
A+ k]
II
=c
k!
(6.16)
e ,(I)
e",e
I.,
(h.17)
\\hich is the ",[llle result nhlaillcd in (h.)) usil1g Sl'lMratioll of variablcs and integnilioJ1. Now. let's cuntilluc and use lhe gel]cnd procedure 10 so!vc a sccondorder differential eqllalion
(h.! 01
Sec. 6.2
147
CJI)
(6.20)
We need two initial conditions, ell(O) and dCjj(O)Jdt, to evaluate the constants, (:1 and ("2' We assumed that there is no component B in the reactor initially, so ell(O) :::: O. From (6.20) we then find:
Taking the derivative of (6.20) and using (6.21) and (6.22), we find:
(623)
C,,(t)
This expression can be used, for eX<llnple, to solve for the amount of time that will yield the maximum amount or ell (see student exercise J 5).
Dimensionless Equation, It should also be noted that (6.23) call he made dimensionless by defining the following variables:
x
Cfic'!W = conversion of A to B
=
dimensionless time
I
n
~
[expCT) _. exp(uT)1
which is shown in Figure 6.2, for a "'" 0.5 and 2. Notice that when the first rcw:tion is faster than thc sccond (ex "'" 0.5), there is a highcr concentration of B than when the first reaction is slower
148
Chap. 6
than the second (0: = 2). When the second reaction is faster than the first, component B reacts further to form C before a substantial amount of H is formed.
0.5
............
_~
co 0.4
'0
alpha   alpha
~
0
0.5 2.0
.Q
0.3
'" '"
c "'
0.2
E '6
:
0.1
"
:'
.:
:'~~~~,
"'
.. '.
", ",
....
345
dimensionless time
FIGLJRE 6.2 Concentration of B as a function of time. When the rate for the second reaction is faster than the first (~ = 2), the peak concentration of B is lower.
We notice in the previous example that (6.23) cannot be used if k 2 :::: k l . This is a case where the eigenvalues are repeated. The procedure for repeated eigenvalues is shown
next.
6,2,2
Repeated Eigenvalues
If a particular root in the solution of (6.12), Ai' occurs r times, then the corresponding terms in the solution to (6.11) are:
(6.24)
Repeated Roots
:::::
kl
;;;;;:
k is:
(6.25)
~t':~_:.11_
rIl 2
Sec, 6,2
149
and the characteristic equation is: A' which can he factored as: (A so the eigenvalues (roots) are:
A,
~
2 k A + k2 ~ 0
(6,26)
+ k) (A + k)c., 0
A2
k
C,,(t)
(6.27)
Notice that we can find cl from the initial condition for C n From (6.27) at t = 0,
C,,(I)
e, t cxp( 
kl)
(6,2H)
at t = 0,
"e,,(O) , dt  k CAO
so:
C,,(I)
(6.29)
x(i)
(dO)
150
which is shown version of A to
ill
Chap. 6
COI\~
Figure 6.3. The reader should be able to find the 1l.1<1xiunJJn value for the
o o
________'
'
L.
2 3 dimensionless time
FIGURE 6.3 Conversion of A to B as a fUllction of dimensionless time (T "" kt), for the case of equal rate constants.
The previolls example illustrated the solution for systems with real roots. The next pie illustrates a system with complex roots.
cxam~
     _..
EXA MIJl..E 6.2 Complex Roots Consider the secondorder equation:
_~...
dx
dt
The characteristic equation is:
+x
()
(6.31 )
A'
+ A+ I
o
4
(6.32)
Solving for the roots lIsing the quadratic formula, we find that the rools mc complex:
A~_lV.3.
2 2
Sec. 6.2
where j
151
,(t)
c .1
e(
I 2
+ V3) t + c1 e (J 2 j , 2
Vi) 2' j t
(6.33)
ejll
elo
and the property that
eXtI' "" eXe Y
cos f:l
j
jSln f:l
(6.34)
(dS)
=0
cosO jsinH
x(t)
10 ce'cos ' 1
V3 (I 2
(6.36)
x(t) = e
/
., [c 1 COS V3 t 2
(6.37)
x(t)
e ,/2
[e c ,
e
vi
~3 tj
(d8)
x(t)
2 lie;>
[ V2 t + c cos i
sin Vi t 2
(6.39)
Again, initial conditions for x(O) and ~\:(O) can be used to determine {'3 and ('4 The student should verify that jf x(O}:::: 1 and ~~(O) = I, then c J :::: \.0 and (.'4 ::::1.5. A plot is shown in Figure 6.4.
1.5
::.:;
0.5
a
0.5
10
FIGURE 6.4
152
Chap. 6
Chemical process system models with complex roots include some exothermic chemical reactors. Also, models including feedback control will often have complex roots (leading to oscillatory behavior).
6.2.3
We can now generalize the results of Example 6.2 for any equation that has pairs of complex roots. For each pair of complex roots, A ;: : ; At j Ai' where Ar and Ai arc the real and imaginary portions, the solution is:
x(/)
co
(N
(6.40)
In the previous example the real part of the complex roots was negative (stable). Notice that the state variables decayed to zerO with time. Notice from (6.40) that there will be no decay (simply a continuous oscillation) if the real portion is O. We can also sec from (6.40) that a positive real portion of the complex root will lead to an ever growing (unstable) solution. This behavior is shown by studellt exercise 19. Most chemical processes are stable; however, some exothermic chemical reactors have unstable operating points. Also, improperly tuned feedback control systems call be unstable. Thus far in this chapter we have solved the homogeneous problems. Homogeneolls problems result from models that are "unforced," that is, there is no input. This usually occurs when the process model is in deviation variable form, and there is no change in the input variable. They are based on a perturbation from steady~state in the state variable values. In Section 6.3 we will solve nonhomogeneolls problems llsing the rnethod of undctcnnined coefficients. These types of problems arise when there arc input changes to a process.
6.3
In this section we will solve nonhomogeneous problems with the following form:
+ aox = '1(/)
lIsing the method (4 undetermined coefficients, which is outlined below.
(6.42)
Sec. 6.3
2. Solve for the particular solution by determining the coefficients of a trial function (sec Table 6.1) that satisfy the non!1o!11ogcncOlls equation
X,,(I)
:t
X(I)
Xu(l)
+ X,.(I)
TABLE 6.1 Trial Functions for Method of Undetermined Coefficients (noyee and DiPrim~l, 1992)
Forcing FUllction
Trial Function
A (a constant)
Ac(~(
flo
cAt)
and substitute it into (6.3) to obtain
= CAUek,1
(6.14)
(6.43)
Step 1.
Step 2. Since the forcing function is k] CAU e tion for the particular solution:
Xp(t)
k,I,
we use c2 e
k,f
c). e kl !
k l
C e k ,!
+ k 2 Cz e k,f
kl
CAO
e k,f
(6.46)
154
which we can solve for
('2:
Chap. 6
c,
c
k,
k2 ~ k,
XII(t)
(6.47)
Step 3.
+ _'(/,(1)
kit
c e
1
I..,,'
+ k, __ k e l
(6.48)
We
call
evaluate
('I
which, of course, is the same result obtaineu previously (0.23) by solving the secondorder homogeneous equation in CII _
We have lIsed a single firstorder equation to illustrate the procedure for heterogeneous equations. The same procedure is used for higherorder equations.
6.4
(649)
Notice that the coefficient is timc~varying and the equation is heterogeneous. One approach to solve thiS type of problem is to use an illtcf.iratingfactor. Let the integrating factor be represented by 1J.(r)
,,(t)
(6.50)
,,(t)
dx + ,,(I) p(t) x dt
(65 I)
If
~ exp
If
(6.52)
Notice that the lefthand side of (6.52) is simply the expansion of:
(~t
Sec. 6.4
155
so we can write:
P(t)dt}]
= exp
(6.54)
[f pet) dl]
fq(t) exp
(6.55)
X(t)
= exp [
II
(6.56)
EXAMPLE 6.3
Semibatch Reactor
Consider the case where the batch reactor is being filled. Assume a single, firstorder reaction (A )B) and a constant volumetric flow rate into the reactor (F), with no llow out of the reactor.
dve 1 dt
dt
dt
(6.59)
we find:
(6.60)
v = Ft
and:
(6.61)
(6.62)
Let:
fp(t) dt
~
= =
fG + k l ) dt
In t + kit + c i
(6.63)
exp
IJ
pet) ilt]
c,l ~
[cd
(6.64)
156
Chap. 6
Multiplying through on each side of (6.64) by ('2! ('xp Ik1tl and dividing by c_'
exp [k,l]
and noting that the lefthand side is simply
(6.6.'1)
"
we multiply by dt and integrate to find
exp [k,11 C ,] dt
(6.66)
k
multiplying by exp I kill and dividing hy
t.
[exp [k,ll I I
(6.67)
.,
k,1
II
exp [
k,111
The division by t is bothersome at f;;;;; O~ the reader should llSC L Hospital's rule to sl1(1\\ that the correct initial condition is obtained with this expression. NOlice that we can define a dimensionless coucentration and time as
to find
V(T)
which
, 11  exp [
,II
(6.69\
IS shown in Figure 6.:). Notice that this solution hold.s while the rcacf(l1" IS being "fed" After the feed is stopped the model is simply dei/ill:;:: ~kICi\ with appropriate intinl conditi(lI1s (sec student exercise ~f))
1  _ . . ~
,
c
o
o
~
0.8
o ~ 0.6
c o
is
~ 0.4 E
0.2
o
FIGURE 6.5
4 6 dimensionless time
Sec. 6.5
157
6.5
(670)
We can arbitrarily assume that all > O. If an < 0 then multiply (6.73) by
~1.
A neces
salT condition for stability is that all of the coefficients in (6.70) Inust be positive. If any
of the coefficients are negative or zero then at least one eigenvalue (root of the characteristic equation) is positive or 7.ero, indicating that the equation is unstable. I~ven if all of the coefficients are positive, we cannot slate that the system is stable. What is needed is a sl4licicllt condition for stahility. To determine that the system is stable, we must construct the ROLlth array and use the ROllth stability criterion, which provides necessary and sufficient conditions for stability. Sometimes we simply wish to determine if a particular system is stable or nOl, without actually evaltltlting the eigenvalues. This is partieuJtlrly true if we wish to determine values of system parameters that will cause a systelll to lose stability. This approach will be useful in performing a bifurcation analysis in later chapters, <lndin tuning control systems in chemical process control.
6.5.1
Routh Array
If "lll of the coeffients of the characteristic eq uation (6.70) arc PO"ilive, the llccessaJ)' condition for stability is satisfied. The following Routh array (Seborg, Edgar, & Mcllichamp, 1989) is developed to test for the s/!llfcicnt conditions for stability:
Row
an
2
{[Il!
{[n3
a n4 an 5
3
4 n+l
h,
ci
h2 c2
h3
158
Chap.6
where II is the order of the characteristic polynomial. Notice that the first two rows consist of the coefficients of the characteristic polynomial. 'fhe clemenls of the third row arc calculated in the following fashion:
hI =
and so
011.
h2 =
{III
Elcments of the fourth and larger rows arc calculated in a similar fashion:
bj({/I ) 
({nlhZ
('2
hl{[/I S 
lltJJ}J
(:1
h,
hi
and so Oil,
EXAi\lPLE (,.4
Sccond~ordcl'
Charadcdstic Equations
+ ttl
+
dx
til
((J.7 I)
al
;>..?
al A
an
(6.72)
If all of the coefficients (12' (II' and (10 arc positive, then the necessary condition is satisfied. We call form the ROllth array to test for the sufficient condition:
ROll'
a)
(10
2 3
(ll
an
Since the left column consists of the pc}lynomial coclTicienls, if all of the coefficients in the second order system are positive, the. system is stahle.
Notice that, for secondorder sysLems, a lesL for positive coetJicienLs is necessary and sufficient for stability.
Sec. 6.5
159
EXAMPLE 6.5
The system:
ThirdMonlcl' System
rex
riP
has the characteristic polytl(l!llia]:
+2
(Px
dP
+3
dx dt
+x
= 0
A'
and the following Routh array:
ROH'
+ 2 A' , 3 A + I
~ 0
2 3 4
2 5/2 I
3 I
All of the coefficients of the characteristic polynomial arc positive and all of the elements in the left column of the Routh ,trray afC positive, so the system is stable.
_.~~~~~_._~~
The Routh array is particularly useful for determining how much a parameter call vary before a system loses stahility. The following cxan1pJe illustrates such a system.
EXAIVIPLE 6.()
The system:
3 A , fC ~ 0
where 1.1 is a parameter that may vary. The Routh array is:
2 3 4
I 2
3
fC
h,
('I
160
Chap. 6
where b l :::: J  f.L/2 and c j ::::: IJ... From the characteristic polynomial, we sec that /L > 0 is required. The same result holds true for the requirement of c) > O. We notice that h] will be posj~ live only if f.L < 6. F'rom these conditions, we find that the stability requirement is 0 < /L < 6. for complex, high order (3 or greater), it is not uncommon for a system to have parameters that stabilize the system only over a certain range of parameter values. 'rhis is particularly true of feedback control systems.
SUMMARY
We have reviewed techniques to solve homogeneolls and nonhomogeneous (heterogeneous) 11th order ODEs.
Homogeneous problems arc solved using the roots of the characteristic equatioll, forming the solution IIS a sum of exponential terms. Homogeneous equations generally occur if the system is unforced, but there is an initial deviation from steadystate in the state variables. The method (~l undetennilled c()(dlicients is lIseful for solving nonhomogeneous (heterogeneolls) problems. These generally occur if the system is forced by a chang~ ing input. The integrating factor method was useful for solving a firstorder heterogeneous equation with a timevarying coefficient. The Routh array was llsed to test for the stahility of a differential equation. This is lIseful for finding vailles of a paranletcr that cause a system to lose stability, such as in feedback control system design or bifurcation analysis. The type of dynamic behavior of an nth order differential equation is a function of the eigenvalues (roots of the characteristic equation). Eigenvalues that arc further in the left half plane arc "fast." The larger the ratio of the imaginary portion to real portion of a complex eigenvalue, the more oscillatory the response. Stability is detennined by the real portion of the complex eigenvalue. If all eigenvalues have a real portion that is negative, then the system is stable. If any single eigenvalue has a real portion that is positive, then the systern is unstable. Often engineers study the dynamic hehavior of processes by starting out at stcady~state, then applying a changing input to the process. Although the method of undetermined coefficients can be used to solve these problems, the Laplace transform technique is used more often. The Laplace transform method is introduced in Chapter 7.
Student Exercises
161
FURTHER READING
Boyce, W., & R. DiPrima. (1992). Ordinary Differential Equations and BoundmJ Value Problems, 5th cd. New York: Wiley. Routh, EJ. (1905). Dynamics ofa 5'ystern (~lRigid Bodies, Part Il. London: Macmillan. Seborg, D.E., TF. Edgar, & D.A. Mellichamp. (1989). Process Dynamics and Control. New York: Wiley.
STUDENT EXERCISES
I. Consider the statespace model:
Ix, Ix,
1 1I
.~ 211 XI]
0
x2
a. Find the second order ODE in terms of XI' b. Find the second order ODE in tenns,of x'2' c. For xI(O)::::: ~l and x2(O)::::: 1, ohtain the analytical solution for xl(t) and x 2(t) d. Usc ode45 or initial to solve the set of two differential equations, given the initial conditions in part c. 2. Consider the following linearized form of a hioreactor model with substrate inhibilion kinetics (sec Module 8 for delails): x=Ax+8u y=Cx+DtI
where:
A~
~.
0
0I 1
0.7500
0.9056..1 2.5640
1 0 1
I D= I;:]
.~ 1.53021
3.8255
a. Find the secondorder ODE 1n terms of XI' assuming u::::: O. b.Find the secondorder ODE in terms of x 2 , assuming u::::: O. c. For x,(O) = I and x 2(O) = I, oblain the analytical solution for x, (I) and xP) d. Use ode45 or initial to solve the set of two differential equations, given the initial conditions in part c. 3. Consider the slate space model for a twostate system:
x= Ax [Xl] = .1 all
'\:2
(121
162
Chap. 6
y [all
1\2  [all
a 22 ]
Y+
1\
[a ll a 22  a2\ad
Y = 0
+ a 22 ]
[a ll a 22  a2\a 12 ] =
det(H  A) = 0 Show that det(l\I A) = 0 applied to this general twostate example, yields:
1\2  [all
+ an]
1\
[allan  a 2I a 12 ] =
4. Solve the following differential equation with the given initial conditions:
 3 ;I:;'  4 y =
dy
. 2 sm x
,l'x dx 3+3x=O 2 dt dt
a. Write the characteristic equation for this ODE.
b. Find the solution (solve for any constants), x(t), if the initial conditions arc x(O) 2.0 and x(O) 3.0. c. Discuss the stability of this system.
dx + x = 2(1  e''') dt
a. Write the characteristic equation for the homogeneous part of this ODE. b. Find the solution to the heterogenous problem. Show all steps. The initial condition is x(O) = 2.0.
8. Consider the following statespace model that results from a linearization of the
predatorprey equations:
Student Exercises
163
with initial conditions x,(O) = 0.5 and x 2 (0) = 0.25. a. What are the eigenvalues of the A matrix? Use both MATLAB and your own analytical solution. b. Write the secondorder ODE that corresponds to xI. Use the method of Section 6.2 to solve for x,(t). Plot x,(t). c. Write the secondorder ODE that corresponds to x2. Use the method of Section 6.2 to solve for xlI). Plot x2(t). d. Compare the results from band c with those obtained by integrating the statcspace equations using cither ode45 or ini tial. e. Show a phaseplane plot (Xl versus Xl)' placing XI on the .:raxis and Xl on the yaxis. 9. Consider a system described hy the following thirdorder ODE:
dt'
dt
dt
I ill
show that {lj > 0 and ([la2 ~ {loa 3 > are necessary and sufficient for stability. 11. For a general fourthorder polynomial:
([4 Po. 4
A I a o = 0
+ llJ Po. 3
Po.
I
ao = 0
show that aj > 0, a2a3 ~ {l\a 4 > 0, and {l1{l2{l3 sufficient for stability. 12. Consider the following thirdorder ODE:
 (l4ar
d'y
;/ti
d 2y
dy
= 0
where ('{ is a parameter. Find the range of ('{ that will cause this equation to he stable. 13. Consider the lllowing secondorder ODE:
d'y dt2
which has eigenvalnes of I y(t).
+ Z + Z Y
dy dt
= 0
164
Chap, 6
14. Consider the series of two tanks, where the levels interact.
O
  .
tHJ21~h2
F,
. F2
a. Assuming that the flow from the first tank is linearly proportional to the difference in the tank heights (P'l :::.: ~l (h t  h 2 )), the flowrate from tank 2 is proportional to the height in tank 2 (F2 ;:;;; rJ 1 liz), and the tanks arc or COllstant crosssectional area (A I and A 2 ) show that the modeling equations arc
Find the reaction time that maximizes the production of B. Recall that the tion for the concentration of B is:
solu~
and that the maximum occurs when the condition den/dt:::: 0 is satisfied. b. For k j ::::: I and k 2 :::o 5 minI, find the maximum conversion of A to B (express as Cn/CAo) and the tinle required for this conversion. c. In practice there is uncertainty in the rate constants. If the actual vallie of k, is 7.5 minI, and the reaction time from b is used, find the actual c()nvcrsion~or A to Ii, d. Use the MATLAB routine ode4 5 to integrate the three state variable equations and solve for C;\> C n' and C c as a function of time, for the parameter values in
Student Exercises
165
:0;:
h, with C~\O := 1.5 and em> Ceo::::: 0 mol/liter. Make a comparative plot for the parameter values in c. What do you observe about the concentrations of A, B, anel C? 16. For the batch series reaction with ilTeversible reactions (A ..7 B ..7 C): a. Find the reaction time (tllla,,) that maximizes the conversion of A to B for the case INhere k 2 ::::: k j ::::: k. Also find the value for the maximum conversion of A to B. Recall that the solution for the conversion is
X(I)
b. Assume that the reactor is run for the period {max found in a. Now consider the
effect of an error in the reaction rate constant of +50%. What is the actual conversion orA to B obtained at t max ? 17. Consider a batch reactor with a series reaction where component A reacts to form the desired component B reversib(v. Component B can also react to form the undesired component C. The reaction scheme can be characterized by:
k ll
> A f B 1<, C > k lr
Here kjr"nd k 1r represent: the kinetic rate constants for the forward and reverse reactions for the conversion of A to H, while k 2 represents the rate constant for the conversion of B to C Assuming that each of thc reactions is firstorder and constant volumc, tbe modeling equations are
where CA , C u' and Cc represent the concentrations (mol/volume) of cOlnponents A, B, and C, respectively. Using the following definitions: Dimensionless time, Conversion orA, Dimensionless concentration of B, Ratio or rate constants, Ratio of forward and reverse rate constants,
'T
= kit
p=
k ir / kIf
166
ll.
Chap. 6
l~)r
(Px)
(/72
+ (1:\ +
<X
I) dX 2
d'T
and that the roots of the characteristic equation can never be complex or ullstable (assuming that the rate constants arc positive). h. Solve the previous equation to find x2 as a function of T and ex and r3. c. For kif:::: 2, k 1r = ], and k2 :::: 1.25 hr"], find the maximum conversion or A to lJ and tlie reaction time required for this conversion. d. Usually there is some uncertainty in the rate constants. If the real value of k 2 is 15 11I~1 and the reaction is fun for the time found in c, what will be the actual conversion of A to B? 18. Consider the series reaction:
le l k? ~>'f) AlIJj C' k~
[Hint: Solve for en fWln the third equation and take the derivative to find
deBldt.1
h. Assuming that all of the kinetic parameters are positive, show that this system is stable.
Por initial conditions x(()) = I and x(O) =1, find the analytical solution and shm\' that the following plot describes how x changes with time.
Student Exercises
167
150 100 50
K
0 50 100 150
2
4
10
20. Consider a semibatch reactor (Example 6.3) with a firstorder kinetic parameter of
k:::: I hr I . I\x a nowrate of 10 liters/hour, a feed concentration of 5 mol/liter, and arced time of 2 hours, find (and plot) how the concentration changes fronl 0 to 10 hours.
fUl1c1iollS.
Usc Laplace transforms to convert an nth order ()DL: to the Laplace donwin.
7.1
Motivation
7.2
7.3
7.4
7.5
7.6
Application Examples
T;:lblc of Laplace Transforms
7,1
MOTIVATION
In this chapter \vc introduce {\ mathematical tnoL the Lllp/ace fnlllsji irlii , which i:; \cr.\ useful ill the analysis of linear dyn,unic .;y.;terns. crill' purpose of tile Laplace transform. as used in this textbook, is to converl linear differential equations inLo algehraic equa,
168

, ~ d'i i t
Sec. 7.2
169
lions. Algebraic equations arc much easier to manipulate than differential equations. An analogy is the usc of logarithms to change the operation of multiplication into that of addition. Laplace transforms arc lIseful for solving jinear dynamic systems problems, particularly nonhomogeneous (heterogeneolls) problems (Le., where the input to the process system is changed), and are commonly used in process cOlltrol system design and analysis.
7.2
Definition:
Laplace transform
Consider the time domain function/(t). The Laplace fransform ofj{f) is represented by qj{t)J and is defined as
1.[j(l)1
= F(s)c
J/(t) e "<it
(71 )
This operation transforms a variable from the time dornain to the s (or Laplace) domain. Note that some texts use an overbar or capital leucrs for the transformed variahle. In this initial development wc will let/C!) represent the time dOlnain function and F(s) represent the Laplace domain function. Later we may be more relaxed in our notation and let .f(s) represent the Laplace domain function. The Laplace transform is a linear operation, as shown below.
L[a,Jj(t)
+ a,Nt)1
<)
J [a,Nt)
]a,I;(t)
+ ",Nt)] c "tit
()
Oc
(J
e~" <it +
= aJ'f(t)
() ,
Equation (7.2) satisfies the definition of a linear operation. In (7.1) we used Ll/{t)1 :so; F(s) to define the transform of a time domain function. [I' we wish to transform a Laplace dornain (sometimes called the sdomain) function to the time dornain, we lise the notion of an inverse transform
L'IF(s)1 =/(1)
Although not emphasized in this text, Laplace transforms can also be used to solve linear partial diffcrenlial equations (PDEs).
170
Chap.7
7.3
7.3.1
Exponential Function
Exponential functions commonly arise in the solutions of linear, constant coefficient. ordinary difTcrcntial equations:
J(t) = e,n'
A plot of this function is shown in Figure 7.1. Recall that the transfoml is defined for t > 0 (we also use the identity that e X + 1'
;:::
e1c\)
L[e,n] =
JHt) e n dt
I
S
()
J e,n e n dt
=
J e(da l ' dt
0
= _
LIe
+ (l
I
[(((.\'+O)lj'''' 0
s+a
'[01]=
s+a
,a] .
s+a
E\pOllential
1['
.s
1 ....
a
J = eO'"~
0.8 0.6
OA
1ji 0: x
w
I
i
0.2 0
0
2
at
FIGURE 7.1
Exponential function.
Sec. 7.3
171
Notice that the way we have solved for the limits of integration is only rigorously true for a; we will assume that this condition is always satisfied.
The step function is used to solve dynamic problems where a sudden change in an input variable occurs (a flowratc could he rapidly changed from one value to another, for example). The step function is defined as 0 before t = 0 and A after [ = 0, as shown in Figure 7.2, Ofort<O} }(I) = { A f{)f 1 > 0 We must use the "more precise" definition of the Laplace transform, because of the discontinuity at t = 0:
L[t(t) I = lim +
1'+0
T'>7;
I }(t) e" dt
"
> 0,
A
L[A] =
J Ae" dt =
0'
[0  i]
A
s
L[A]
= ;\
s
5;tep
Notice that the same expression is used for the Laplace transform of a constant.
A
Step Function
t = 0
FIGURE 7.2 Step function.
172
Chap. 7
7.3.3
This is important for systems with transport delays (flow through pipes, etc.), or delays due to measurements. l"ct ttl represent the time delay. If the undclayed time domain function isj(t), then the delayed function is/(t  l<f)' as shown in Figure 7.3. TheL,aplace transform of the delayed function is:
Llf(t  t,,)1
J ](1  I,Jeo
ew,J o
dt
e""
1'(.1')
Notice that the lower limit of integration did not change with the change of variable, because the function/ttl is dehned as jet) = 0 for 1 < 0,
Llf(t  td ) 1 ~
1"'"
P(I')
Time~De!ay
cstt!
I(t)
function
delayed
function
"FIGURE 7.3
Delay funclion.
~_.
Sec. 7.3
173
7.3.4
Derivatives
This will he important in transforming the derivative (accumulation) term in a dynamic equation to the Laplace domain.
U adv:::: uv  f
vdu)
or/t
DO
Derivative
t, 'lsF(s) f(O) 1
dIet)
fit
Since we often work with deviation varinhlcs,j(O) := 0 in many cases. In general, you should he able to show the following (sec student exercise I):
7.3.5
Integrals
This is often used in process control, since many controllers use information about the integral of the error between the desired value (sctpoint) and the measured value:
{I
J(t) dll
I~
J(l) d l " dl
I
174
Chap. 7
FIGUH.E 7.4
Ramp functioll_
I F(s) s
Integral
7.3.6
Ramp Function
f(l)
bI
as depicted in I'igurc 7.4. You should be able to shmv (sec exercise 2) that
R(/Illp
'IINI
7.3.7
Pulse
Consider the pulse function in Figure 7.5, which consists of a step from () to A at [::::: 0, and a slep back to 0 at t;;::;; tp.fiind lhe Laplace transfer function for this pulse. There arc two ways to solve this problem.
FIGURE 7.5
Pulse fUllction.
Sec. 7.3
175
ONE METHOD
The pulse function is defined over the following two time intervals:
f(t) = A for 0 < I < I" .I(t) = 0 for I > I"
F(s)
A
s
[e"I'"
F(s) = ~
A. A [e""~ I] = [I s s
~e
"'I
'pi ,
I [1 s
e I"1
I
Unit Pulse
A SECOND METHOD
Consider 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 at t ::::: tv Lctfl(t) fcprCScllt the step change at t :::: 0, and lit) represent the negative step change at I :::: If!>
TL
o
FIGURE 7.6 Pulse function.
/, (I)
176
Chap. 7
1."
A
.I'
1'(.1')
/1
s
[] .. e'']
7.3.8
Unit Impulse
In Figure 7.7, consider the pulse function as the pulse time is decreased, but the pulse area remains 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]'s
rule:
: ..
~,'
'''       
FIGURE 7.7
Impuhc function.
Sec. 7.4
177
L[o]
lim
11')0
I
S
(!'.,o
I sc "1"1
Unit Impulse
7.3.9
Review
'rhus far we have derived the Laplace transform of a number of functions. f:;'or example,
we found:
LIe "']
s+a
If we have a LapJace domain function, such asl/(s + a), we can "invert" it to the time domain.For example,
LII,
al.~e'"
Althollgh the student should he able to derive Laplace transforms of any lillle domain fUllction, that is not our major objective. Our major objective is to usc Laplace transforrns as a tool to solve clynarnic problems. The l,aplacc transforms of many timedomain functions have been derived and compiled in various tables and handbooks. Already, we can construct a table of eight (exponential, step, timedelay, derivative, integral, ramp, pulse, and impulse) timedomain functions along with their Laplace domain functions. Addi
7.4
lim
Is F(s)]
(7.3)
)' __Pc
lim
is 1'(.1')]
(7.4)
178
Chap. 7
If we have lransforlnc<J a time domain function to the s domain, \ve Call still find out the
orems is shmvn in
L~xaTl1ple
7.1.
EXA1VIPLE 7.1
\" + (/
Finu/ Vulue Theorem. \Vc first find:
lim s F(s)
;(1
lim
>it,()
lim !(T)
as IOllg as
1/
Jim
c!l"
()
is positive.
II
Illn
."
!t t)
lim e'"
'"
. ... ~~~~ ~ ~ ~ ~ ~
One pOJl1lnot often made in texthouks is that the final value theorem only hold", for stahle sy,'",tems (0 > 0).
7.5
APPLICATION EXAMPLES
crhe 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 tiJ\le domain fUllctions to the Laplace dumain. gen~ erally by using a tabk of Laplace transforms.
Sec. 7.5
Application Examples
179
Step 3. Step 4.
Usc algebraic manipulations to solve for the transformed variable. The partial fraction expansion approach is particularly useful. "Invert" to the time domain, by using a table of Laplace transforms.
7.5.1
The partial fraction expansion approach is based on representing a ratio of two polynomials as a sum of simpler terms. L,ct N(s) and D(s) represent numerator and denominator polynomials, respectively.
N(s) D(s)
D,(s)
D,(s)
.. UJs)
Ci arc constants and D i are lower order (typically J) polynomials. The [ourstep procedure is llsed in each of the following examples. The partial fraction expansion is first used in [~xample 7.3.
gXAMPI.J~
7.2
Step 1.
+ 2x
(7.5)
x(O)
Step 2. Rccall the following transforms:
(7.6)
II:';;] ~
"iilxj
~
s X(s) x(O)
al jxl c.
1/
Xes)
Then wc (an take the Laplace transform of (7.3) aud (7.4) as:
II ~; I
Step 3.
Solving (7.7) for Xes):
+ 2Lix]
~0
~
X(.,) .I'
4
j
(7.8)
180
Step 4.
An Introduction to Laplace Transforms Inverting each clement back to the time domain:
Chap.7
L '[Xes))
crt)
(791
17.10)
CII
and the solution is
.s+ 2.
41 ~4e"
4 e"
x(t)
(7. II)
\VC
dr
tit
with initial condition x(O)
+ax
cc;:()
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 illustrated in Example 7.3.
EXAMPLE 7.3
Tc(~hnitluc
+ 2x
4.5
(7.12)
x(O)
Step 2.
17.1\1
4.5
s
(sl 2) Xes)
c
4'
4.5
Step 3.
Xes)
4.5 s(s + 2)
(7.14)
Sec. 7.5
Application Examples
181
We would like to invert (7.14) to the time domain, however we do not know how to invert the last term 4.5/s(s + 2). We will use the approach known as apartialFaetion expansion. That is, write:
4.5 s(s \ 2)
to find A, finit multiply (7.15) by s:
A
.\'
Ii
S
+2
(7.15)
4.5 s+2
then set s:::o;: 0 and solve for A:
"C
+ lis
s+ I
A
To find fl, first lllUltiply (7.15) by s + 2:
2.25
A(s + 2) + IJ s
~.
2.25
which yields:
4.5 .I(S + 2)
and
We
2.25
 2.25
s + 2
(7.16)
Xes)
+
2.25
 2.25
s +2
(7.17)
Step 4.
x(t) = 4
or
C 21
X(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.
EXAJ\tlPLE 7.4
Write
s+a
s+b
(7.19)
to find:
182
Chap.7
.\
\lultil'l;. 7.19) hy.\ + f),
~l'l
u
/1 tu find:
(/  h
(1)(0,
h)
u I h
I h
17 ..2UI
I.
(1)(.\
 101]
10 ~ hi,
(7..~
II
The Illl'thod in the prc\iou" c\i1lllple failed ir the rouLS n( the LttpLICC domain rlll1l~!i()l1 were equal. "fhc ldhming c\arnplc "IH'\'" hO\\ 10 pl~rrorll1 a partial fraction C\\"KlIbioll fur
I"Cj)('(lfcd I"oofs.
EX';\\IPLE 7.5
(s
([) :'{.\
hi
(s
101
(I
(7,231
\+i!
S =i1,
(s
Here we
C,lll!lU{
,p1(1 set
11l1buUlllkd (nULS.
Fir"L
multiply 0,20)1 by
i\( ,\
01
C(s
I' '
and C;d ,\
;:c:
u lu find Ii
11
(/
0:::
b 10 filld
 ....
Sec. 7.5
Application Examples
183
Notice that we have solved for two of the coefficients of (7.23). Now, we can solve for olle
equation in one unknown, by setting s:;:;: any valuc. For simplicity, choose s = O. Froln (7.23):
(b A =
(a
I
bJ'h
(ab)'
We have solved for A, H. and C' in (7.23), So we can perform an clcmciltbyclemcnt inversion of
e"l
_j
t em +
... e hi
(a,
and
\VC call
ha
(a_b)'
write:
'I (, +
+ b)
(il '
e"l +
b~a
( , ,,11/ (ab)'
(7.24)
As an alternativc, we tan JJnd a COllUllon denominator for the right hand side of (7.23) and write:
+ b)
b)
b)
e(s + (I)'
(725)
then expand the numerator and solve for the coeJTicienls A, lJ, and C such that the righthand side
is equal to the Ieniland side. See student exercise 13.
L.~
The previous examples were for ODEs with real roots. This next example is a problem with complex roots.
EXA1\lPLE 7.6
Second~ordcr
Step 1.
dt'
with the initial conditions:
i+
dx dt
+x~O
(7.26)
\(0)
,(0)
(7.27)
Step 2.
S"
2 .\'(0)  ... 
S Xl"
184
So, for a second derivative:
Chap,7
L [ ..
dx
df .
l = sX(s)x(O)
=
Step 3.
+ 1):
X(s)
and from the initial conditions:
=
x(O)
.\'2+ s +1
,\'
(7,28)
(S2 + s + 1) ~ s +
which means that we can write (7.28) as:
Xes)
= (
Step 4.
(s + Ii)' + ",'
Lle'"
cos wI} =
(7,111)
and we should maneuver (7.28) into the form of (7.29) and (730). Notice that we can write (7.30) as:
Sec. 7.6
185
s+
X(S)
I.S
(SI i)'1
l x(t)=el"cos '
(\~7
(7.31)
and we invert each clement of the RHS of (7.31), using (7.29) and (7.30):
ttl)
e 'I ~cos 2 l .
V"3
v3 e 'I' sin V3 ( :. 2
which has the lime domain response sho\vll in Figure 7.8. As we Iloticcdin Chapter 6, complex roots give oscillatory responses. We see in Chapter 9 that this type of response is called llndcrdamped.
1.5
:..::
0.5
o
0.5
4 time
10
FIGURE 7.8
7.6
186
TABLE 7.1
fit)
(j(t) (unit impulse)
Chap, 7
{Ofoft<Oj . _
1 lor I .> 0
,I'
Ah cos F(s)
1
I
.v"
df dt
dtil
(derivative)
.1'1'(.1') .1(0)
sllFCs)
~
d'~f
SIll.!W)  s"2j'(I)(())
"(0)
 .1./,"21(0) .I'''
e il !
(eOll  e Ojl )
s+a
I
{/2
aj
(.I'
c,,,,r +~lJ  (12 e"/
al~a2
+ "')(.1' + "2)
~~L_=~lJ
(J2~al
s(n + I) sin wt
cos wt
W
s2
+
S
+
(,)
(.I'
eIl!
C [J)'
+
f
cos
(UI
s+a
(.I' +
(1'1
1+
1'2 1'1
e
t/
~ 1'2
eIl,,)
1 .1'(7,.1' + 1)(7,.1' + I)
(1 _ 1
where w
I
:c:.:c
+
,(V
7
I 2;; 7S
I)
= tan 1
_'l"~_:'l"1 eI/T)
Tl~T2
+'l"J .'1"2
1'21'1
liT,
.1'(7,.1' .1'(7".1'
+1
1 (1  ::J et!'d
+
j
1)(7",
1
+ I)
Til.\' j
I)
___________________ TtII'"
Student Exercises
187
SUMMARY
We have defined the Laplace transform and applied it to several functions that commonly appear in the solution of chemical process dynamics problems. Although the Laplace transform concept seems quite abstract at this point, in the chapters that follow you will find it extremely llseful in solving differential equation models. The final (7.3) and initial value (7.4) theorems will be useful for checking the longterm (steadystate) behavior and the initial conditions for a particular problem. A number of examples were provided to illustrate the power of the Laplace transform technique for solving ordinary differential equations. We noted that the tcchnique allows us to convert the ODE problem to an algebraic problem, which is casier for liS to solve. After performing algebraic manipulations in the Laplace domain, often with the usc of a partial fraction cxpansion, we then look up inverse transforms to obtain thc time domain solution. In the chapters that follow, we use Laplace transforms to analyze the dynamic behavior of different types of linear process models.
FURTHER READING
Many differential equations and process control textbooks provide details on Laplace transforms. Some examples arc:
Boyce, W. & R. DiPrima. (1992). Ordinary Differential Eqaatiolls alld BOlll/dary Value 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: McGrawHilI. 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)l and Practice. Englewood Cliffs, NJ: Prentice Hall.
STUDENT EXERCISES
15. The student should derive the Laplace InmsfoJ'm for the following functions;
L
d'~l
dt"
~
2, '/(1) 3, '/(1)
bl
t2
188
Chap.7
5. ttt):::; cos
(flilll:
10
(I)!
Although you can solve question:) using integration by pans. you may \vish usc the Euler identity cos (I){:::; 1/2 (ei'dl + eF'II).)
6. Find the Laplace transform, u(sL o!' the following input function:
2
u(11
10
20
35
y(l)
d\
dt'
.)
d\"
dl
dl
'
2y
0
,(OJ
8. Solve the dlllcrcntial equation:
d\(O)
dt
d\(O)
dt,1
\ (0)
2.0
2
~
6
C
\Vhat is the lillle domain input. Sketch the time domain Input.
It(t)?
10. Find the tillle dornain solution yO) for the Laplace domain transfer function (\\'ilh ~ <: J):
Student Exercises
189
Y(s) =
,
S(T"S'
2~TS
+ I)
11. Derive the time domain solution yet) for the Laplace domain transfer function:
+1 1)(T,s+l)
12. Derive the time domain solution y(l), for the Laplace domain transfer function:
Y(s) =
+1
.'(TI'+I) "
13. Consider Example 75, involving the following transfer function with repeated roots:
(.I' +
+ h)
=+
A s + a
Ii
(.I' + a)2
+.I' + h
(.1'+
+b)
af
then expand the numerator and solve for the coefficients A, B, and C such that the righthand side is equal to the lefthand side.
Arter studying this chapter. the reader should 11l1ck:rsland: 'fhe responses oj" firstorder systems to step and illJpubc inputs.
flow chemical reactions change the tillle constant of a stirred tank. The behavior or all integrating procesc,. How to compare the longterm beh;lvior of a nonlinear process \viLll tll<'ll of' a linear process \vitholll integratlng the nonlinear modeling cquaticllls.
The responses of firstorder + ti!ll\>clcla)! models.
HO\\ to estimate the par~HT1Clcrs o( firstorder and firstorder + tillledebl) lr;:1I1sfcr fUllctions by apply'ing step input changes. "rile response of a lead/Jag IlH)c!C] to a step input.
B.3 SA
B.5
Integrating Processes
Lcwl[,ag rVlodcls
190
Sec. 8.2
Responses of
First~Order Systems
191
8.1
PERSPECTIVE
One of the powers of theLaplace transform technique is the ease with which it handles heterogeneous (forced input) problems. It is most uscftl1 when the models arc separate fronl the type of input imposed (step, ramp, etc.). The models that arc developed arc called tl'mqlerjl/I/('lioll models and will be llsed frequently in control system design. Process engineers often learn ITlLlch about the behavior of a process by changing the inputs and seeing how the outputs respond. The goal of this chapter is to illustrate the typical responses of firstorder models to step changes in inputs. Knowledge or these types of responses will allow an engineer to determine a good approximate model for the process, including the best parameter values, based on measured data fronl the process.
8.2
dy dt
+ Y ~. ~ k u
where the parameters (T and k) and variables (y ;:lnd u) have the following nailles:
T ::::
time constant (units of time) process gain (units of output/input) input variable
The rllodel (8.1) is sometimes derived by linearizing a nonlinear model about a given steady~state and then placing the resulting linear Illodel in deviation variable fortlL For this reason, we assume that the initial conditions arc y(O) ::;: 0 <mel u(O) ::;: O. The input, U and the outputy afe functions of time; uU) must be specified to solve for y(t). In the next example, we show how a standard first~ofdcr process model arises,
EXA.MPLE 8.1
A mixing tank
Assume that a chemical compound, A. is in a ICedstream cntering a mixing lank. Assume tbat there is no reaction, and that the concentration of A has no effect on the density of the fluid (this is true for trace components ill water, for eXlIlnpk). Also assume that the f!owrate is constant <lnd the volume in the tank is constant~this implieS thal the outlet flowrate is equal to the inlet flow rate, as shown in r"igure 8.J. The process is operating at steadySlate, then tbe iHlct concelltration is suddenly changed to a llew value, Find the tallk outlet concentration as a function of time,
192
F
C
First~Order Systems
Chap.8
F
C
FIGURE 8.1
Mixing tank.
tit
FCFC
'
since V is constant
de
tit
v C v C '
(X.2)
First of all, we can solve for the initial steadystate concentration. At steadystate, dC/dt = 0, so from (8.2) we find:
where Csis the steadystate tank outlet concentration and Cis is the steadystate tank inlet concentration. Now, since FiV Cis + FIV C s ::::: 0, we can add this to (8.2). Also, since C~ is a constant. dC/elf = d(C  C)/dt, and we can write:
d( C  C,)
,It'
_.
F.
(X.3;
or
(X.4)
dy T+y=ku dt
(X I)
withr= VIF, k= 1,y:::: C Cs' It =: Ci  Cis Notice that the time constant in this case is simply the residence time of the tank, that the average amount of time that a molecule stays in the lank.
j~.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " ~~fPI
Sec. 8.2
193
Notice that for linear systems, we can directly write the deviation variable Illodel directly from the physical model, skipping several intermediate steps. Also. since deviation variables arc defined on the basis of a steady~st:ate operating condition, if the process is initially at steadystate. then yeO) = 0 and lI(O) = O. Taking the Laplace transform of (8.]) we find:
Tis yes)  yeO)] + yes) Ie lI(s) TS yes) + Y(s)c Ie lI(s) (n + J) Yes) .c k U(s)
which is most commonly written:
(8.5 )
Y(ll
or,
Ie
TS + I lI(s)
(8.6)
yes)
where:
g(s) lI(s)
Ie
(8.7)
g(s)
(88)
'fhc reader should become familiar with this type or representation. In general terms, /:(s) is known as a !ral1.~Ierfimc[i()lI. In this specific case. g(s) is a firstorder transfer fUllction. You \vill often see a block diagram representation of Ut7) as shown in Figure 8.2 One nice thing about (8.6) is that it holds for any rirsHmJer process (with zero ini~ tial conclitions) we have not had to usc any knowledge (yet) about the input u as a fUllction of time. Once we know u(t), we can usc Laplace transforms to find U(s) to solve the problem. We will sec later that block diagrams and transfer functions arc easy [0 work with, when we have a complex system that is composed of a number of subsystems. Before we deal with such systems. we will first understand the behavior of firstorder systems to different types of inputs.
8.2.1
Step Inputs
Themosi common input forcing function is the step input. For this problem, asSUllle a step input of magnitude 6.U altimc I ~ O. We know that the Laplace transform of a step input is (from Chapter 7):
LIMII
M!
s
(8.9)
V(s)
1
FIGlJRE 8.2
g(s)
Yes)
Block diagram.
194
Chap. 8
S0 "
00 00 ill
_~_~_~l
I~~IT
I I I I I I I
I I I
I
I
111
I I I I I I
I I I I I I
C
0
w
E '5
ill
rlr
I I I I I I 1 I I I
TI I I
rlr1I I
2
Vlau
FIGURE 8.3
Y(S) =
'IS
ill)
+1 s
(8.10) (8.11 )
Y(s) =
k!W S(TS + I)
From the table of Laplace transforms in Chapter 7 (the reader should be able to derive this result, using a partial fraction expansion):
L
and the solution to (8.11) is then:
I [. S(TS
I]
+ 1)
1_ 1'';'
'I']
(812)
y(t)
= k",U[Ie
(8.13)
Notice that we can represent the solution of (8.13) with a single plot, by dividing (8.13) by k!1U to obtain the dimensionless output:
(8.14)
A plot of (8.14) is shown in Figure 8.3, where we have used fIT as a dimensionless time.
'X,,,,,.'" ~,,'~.
As a numerical example, consider the case where V:;;;:: 5 ft\ F:;;;:: 1 f(\/min, and the steady~state concentration (inlet and olltlet) is 1.25 Ihmol/ftJ . Consider a step change in inlet concentration from 1.25 UHno]/ft J to] .75Ibmol/ft J . Theil:
Sec. 8.2
195
U(s)
!>.if
s
1
0.5 s
0.5 I s
Y(s) .~
5s
(8.16)
Since we desire to find the actual concentration, we can convert back to the physical variables, froHl the relationship:
y
and (8.17) can be written:
C, => C(I)
C, y(l)
(R.17)
C(I) ~ 1.25
+ 0.5 [I  e '/51
Ibll1ol/ft ,
(8.18)
Notice that C(t 0> DO) """ J .75, as expected. This can also be obtained by applying the Final Value Theorem to (8.16) (mel using (8.18). A plot of (8.18) is shown in Figure 8.4.
1.7 1.6
~ 0
f'
1.5 1.4 1.3
0
.0
10
I(min)
15
20
25
}i'IGUU.E 8.4
(813)
Process engineers often find process gains and time conslanls by performing step processes.
196
Chap. 8
GAIN ESTIMATION
\VL' ';l'l' 1'rOn] (0.1+) thaI :lftCI termined:
I
T. the eli, ternl approachc" O. 'fhe \aluc or t:. can he de\(1) as I ) (large)
k..
lililt
::,.C
it
(~I'J)
ie.,. the pn)("cs" gain ie., thL' clldllgC in output {as it appnwcl1('" \id('d hy the c1wngl' ill illpLll.
(I)
UU [I
of the ultimate
1'i.'''pOIlSC (I1CW
hy finding thl' [inll' where thl' output. 1'(Tl. IS at \It'ad> \ltC) 'fhi" rule is al\o O)WiOllS b> 1()O~in~;l1
S.3: \\hCll/I.:::: I,
\(lllk~L!:::: O.6.r2.
You "Iwuld 1)(' ('~Hd\tI. Ik'l';HIS(' t11l'; is onl) trllc fur firsl un!.:'r jll\)(\:>SI.:''' \Iith \I<:'p Illput at I ::;: U,
Ill)
tillll'lkl;l) ~Illd :1
If
input is
11111 a
Sll'll
Ch;lll,~L, elL:..
rOll s!wuld get ill Ilu' !whil of i1ssocioring ullits \I/tli ({II (~r f/ie \'(/rioblcs, ()[l\iou"ly. the pmccss time cOlhlan!. . 1T1ll\1 h,\\c units or limc hecausc c 1/7 must he diull'llsionk"s. /\ho, thc prOl'css gain, k. must havc units of Oulput/input to he dimcIlsioll;dl) C01FistCili.
SLOPE METHOD
till'
c"tinl(llil1~ the tilllc COllstant is to rcnli/c tl1<lt the initial slope 01 output step response for a I'jrsturdcr Im1ce;.,s is k~l{h. as "how!1 \x'](1\\. 'raking the cit' ri\,lti\t' of (S.13):
or
dl(1)
k::"( .
7
ill
and l'\alllatillg at (:::: O. we find
[,'
ilql
II)
ill
Sec. 8.2
197
'5 Q. '5
0
"' "' C
ill
'ii;
ill
E '6
2
tltau
FIGURE 8.5 Slope method for time constant estimation (dimensionless output;;;; ylk!1u).
If we extrapolate this slope to the final value of the output that is achieved, we find the time constant 1", as shown in Figure 8.5. This is a dimensionless plot, so the intersection at tIT::;: I indicates an intersection at t::;: 'T in physical time. Parameter estimation for first~ordcr processes llsing a step response is illustrated by the next example.
EXAMPLE 8.2
A process operator makes a step change in an input from 20 to 17.5 gal/min (gpIll) and finds that the output eventually changes from an initial value of SO psig to 55 psig, as shown in Figure 8.6 below. Find the process gain and time constant for this system.
56 55
0> 'ii;
Q.
54 53 52 51 50 0
5
10
time, min
'5
'5
0
Q.
15
20
25
FIGURE 8.6
198
Chap. 8
\Ve call inlll1cdialely calculate the process gain from k =' .lr/:J.u "'" 55 SO psig/17.5 20 gplll ::;: 2 psig/gpl1l. \VC can cdculatt' the time constant in a 1ll11l1hcJ' uj' different \"a)'s. (lnt'
6_~2(;'i
the output is SO + 0.632())::;: :'13.2 psig. From the plo\. this occurs at I :::::.5 minutes. Another \\it) 10 find the time constant is to e\lWPOJatc the initial slope of the response III the final \,due. This occurs at r:::=:'1 minutes, as Sh(1\\'I1. Th.' identified pnKcss transff'l" function is thell:
 2
Ss + I
NOlin: thallhc gain (2 pSig/gpllll and timc cOIIQanl C'1 min) haH' units associated with tilt'llL
8.2.2
Impulse Inputs
C:nnsidcr a fir:;torder process \vith an impulse input of magnitude A. The tran:;form of a unit impulse (0) is 1. so L[A0]:::= A. The first order Laplace domain respomc is:
Y(s)
.~
TS
+ I
U(s)
. .
kA
cc
is
(820)
kA c
i
(821 )
Dividing by kit \ve find the dimc.nsionlcs:; OUq1ul respollse shO\\'n ill the 1"igUl\~ 8,7 belo\\. The prime characteristic of a firstorder :;),':;tem is that there is an immediate rcspome to an impulse input. In practice it is difficult to actually implement an impulse function. /\ close approximatioll can be made by implementing a pul:;e input over a shon period of time. as SI1O\\11 in the next cxamp1t:'"
0.8
0.6 0.4
c 0
c
w E D
0.2
0
0
t/tau
FIGURE 8.7 [lnpulse Response for output is \'(f)/k.\.
it
Sec. 8.2
19U
EXA~ilI'I>E8.3(:0,n')""isonI"'hnpn'sc' ,,ndI',,tsc~npllts'~~~~In the previolls example an impulse of magnillldc A was applied to the process. Consider il pulse input, where an input value of D..1l is applied for tfl units of time, as shown in Figure ~L8. The tolal applied input is then A :;;:; till 1{"
j
1 1 .
o
FIGURE 8.8
Frolll Chapter 7 we find that:
Pulse jnpuL
U(s) ~
!:111 [I  e s
"'I
So, the output for a firsHmJer process with unit gain, is:
yes) yes)
llu
S
11
D.ll
e li,"'j
TS
+1 !lll e (,.'
s(Tsf
I)
s(Tsf I)
1'(1)
co
(H)h]
11(IXpulse)
(8.22)
where fl(t)::: 0 for l < '" nnd I for t 2 The i rnpuJ sc response i,~:
and the total input applied over the If! lillle units is !:if( fV
yet)
The pulse and impulse responses are compared in Figure 8.9 for
1!
(impulse)
tf'::;:;
(8.231
.:0:
O. IT and A
1.
0.8 :; 0.6
'i
0.4
'!: 02 ;
i ,
o
".
2
Vlau
FIGURE 8.9
responses,
.:0:
200
Chap, 8
8,3
change forC\'cr after a step input change. Selfregulating hehavior is shown by the systems
presented in the following example. One key idea to nntc is that a chemical reaction
EXA\IPLE S.4
A C:STR with a
First~()rder
Readion
Nu\\, ('x [end the F':Xamplc S.l to include () single dccnmpositilln reaction. The component material balance i~:
d\ (
cit
\\'hcrc f:. j ie; the rcadlr1!1 r;llc constant.
FC,
SlllCC
F(
F, \'
Je; c()n.~1;1ll1
dC rtt
and wc
(',Ill
\'
r(
I' V I I'
Thl' dnialinn "ariahle form uf our
d((
d)narnil~
nwdc! ic;
,I
df
OJ
1 k.;
d( (
(It
IC
(,)
I 1 I I'
(C~c,,)
(S.27)
I
;]llt!
V
C
~
"' r k,
and
11
F I'
I,
I'
I
C 1\1
r
\
r k)
Sec. 8.3
201
,mel thCldOlC, we know the soluuon tOJ d step change IllIllJet cOllccnlldllOn dt I:::: 0
stilled ldnk wIth ICdcllOll ,Ile less thdll those to! d stilled !dllk WIthout lCdC!1{)/l TillS means tlMI dB 1Iliel composltlon chdllgC has d L1S(CI dy nalHlC eltcelIll a system \Vah ChCI1llCdl lCdClltHl 'Ihlll III d system With Just mlXll1g
<1
~~~~
Note that the previous examples \vcrc linear because the flow rate was constant. If the tlowratc weJ'e changing (i.e., was considered an input), the models \vollid be nonlinear (actually bilinear), because of the terms where an input llluitiplics a slate variable. The linearization techniques developed ill Chapter 5 must then be llsed before a j,aplacc transform analysis can he performed. fn the following example, linearization must hCLIsed be~ cause of the secondorder reaction term.
EXAiVlPLE 8.5
Hcre we cxtend the previous examplc to include a secondorder reaction problem. We will as~ Slime that the rate of reaction (per Ulli! volume) is proportional to thc square of the concentration of the rcacting componcnt. An example would he A +;\ } H. As beforc, \ve afC making the simplifying assumption that the fluid dcnsity is not a function of the concentration. Again, assume that Ci Is thc Input. The component material balance is:
dve
d/
(B.2B)
d/
,md we can calculate the steadystate concentrations from dC/rtf;:;;o 0
(B.2~)
k ~ C' ,
,~
F V Cs
(B.JO)
Notice that (X.30) is LJuadratic in C\_, <lud will always have olle positive and one negativc foot (the rC<lder should verify this by using the quadratic formula). Obviously, only the positive root makes physical seusc. Now, the problem with obtaining an analytical solution to (g.29) is the nonlinear tenn. We can use the lineariz.<.llion technique from Chapter 5.
d(C  CJ .
dl
de
"II.
(C  C,)
.<\
to find that:
/'
I
d(CCJ+(C d/
CJ
F+ ,C) ( V 2k ,,
2 k,
C,)
(C,
C,J
(B.J I)
202
.'\gam.
\Vt'
Chap,8
prucess grlln
/

I'
2" C,
\,
/,J
I'
I
time COnsli\nt
I (I
      ,~~~
SUllllllarizin!. the pmCll1lcters for each of the previolls cxalnplcs arc shown in Table R.],
t,x.0.1
Lx.. K.4
\'Jixing Tank
No Rxn
PnlCCY';
Crain. k
F
\'
,
I
Prnccss Time
(~onslal1L
\'
..
I
\'
F 1;1
EX.\:\IPLE 8.6
Here
\\'l'
,
( ('
(
." min
o.~ min I O.J2 1'1' lhlllOl I min
AJJ case"
(S1'R with firstmdt'l RXII
1
k,
C"
1.25 Ih11101
foll()\\'ill~
n
steady
sldll!
CSTR with sccundordcr Rxn All cases concentratiollS: Ivlixinp tank with no Rxtl CSTR with firstOHler Rxn (STl~ \Vilh sCC\llIdonkr Rxn
Sec. 8.3
203
CSTR
SecondOrder RXll
Mixing Tank
No Rxn
Process Gain. k Process Time Constan t,
I
T
(min)
0.5 2.5
For all of the example s, assume that a step change in thcinJet concentr ation occurs at t:::: O. Tbat is, Cj changes from 1.25 lbmol flu] to 1.75 IbmoJ fr J at t::;: 0 minutes. In terms of deviatio n variables, this means that u increase s from 0 to 0.5 Ihmol ft3 at t::;: O. Recall that the solution for a fifst~order system with it step input change of magnitu de A is:
Y(I)
und since our solution is For the mixing tank r"or the CSTR with firstord er Rxn For tile CS'fR with secondo rder Rxn
kA [J  e'hl
II
_e'h]
0.5 [I 
e,j']
C(I)
e(r)
0.625
+ 0.25 [I  e ,j' 5]
 c 1/).51 (8.35) Notice that solution s for the 11lixing tank (8.33) and the CSTR with firstord er Rxn (8.34) are exact because these systems arc inherent ly linear. The solution to the CSTR with secondo rder Rxn (835) is only approxim ate, because it is based on a Iincarize d approxim ation to a nonlinea r model. The actual rcsponse of the nonlinea r model (using ode45) is compare d with the linear solution (8.35) in Figure 8.10. Notice that the initial response is similar, but the longter m rc
= 0.625 + 0.25 [I
0.9
linear
t)
0.8
nonlinear
0.7
0.6
10
t(min)
15
20
FIGUR E S.lO Reactor concentr ation responsc to conccntr ation, for a secondo rder reaction.
it
204
Chap. 8
spO!1se of the lincar model deviates significantly from the nonlinear model. Indeed, we can cal" culatc the longterm response without doillg any lllllllcricaJ integration, as showll below,
C("j
0.625 + 0.25
F F
O.S750
C~ + \lk, e',
Vk~ (
o
0
InF;x<llllple X.6 we were able to find the new steadystate for the nonlinear system by solving a single quadratic equation. };'or the general case, with a model composed of a set or nonlinear equations, one would need to solve a sct o!" nonlinear algebraic equations. 'fhis would he done twice, once to find the initial steadystatc, thcn again to find thc final stcadystate after a new input change.
EXA:VlPLE 8.7
l'hc most common rnodel for process control studies is known as a firstorder + dcadtilllc process 11l0dcL and is written in the following form
T
dt I ."
k u(t , 0)
II
(8.3()
where 0 is known ,'IS the time delay. A.ssul1lc that )'(0);;;;; 0 and 1/(0);;;;; O. The input. put yare functions of timc; 1/(1) must be specified to solve for I'{t). To understand how this equation might arise, sec r;igure 8.11.
lind the
OLlt~
c' ,
c,
F
C
FIGlJRE S.li
rVlixing tank.
Notice that if the inlet pipe Iws a sigllit'icant volume, there will be a delay between a change in the concentration at the inlet pipe and the concentration at the outlet of the pipe. The delay can be calculated as:
Sec. 8.3
Examples of
Self~Regulatjng Processes
205
H , V" F
where Vp is the volume of the pipe. The relationship between the concentration at the exit of the pipe and the inlet of the pipe can be found by:
C; (t)
Cj(t  0)
That is, the concentration at the exit of the pipe is equal to what the conccntnllion at the outlet of the pipe was () time units in the past. The modeling equation is:
dC
dl
V C , V q(t)
F F
( ..~ 
1("
cit
Cit  0)
I
c,
Taking the Laplace transform of (8.36) we find:
Tis
V
'j=
CO"
+ Y(s)
0_ k e
0,
U(s) U(s)
(X.37)
(TS
Vis) or,
'is l I
Vis)
(X.3X)
(X.39)
where:
K(S) 
TS
(X.40)
Clu
(XAI)
keos 0/1 , I s
(XA2)
Vis) Vis)
kou
elf,
S(TS + I)
Mu c'"
(XA3)
[Is ~
T
'TS
+ .
,,] 1
(XA4)
206
Chap. 8
I'{t)
()
fOJ
,It I
Id" [I
1.II"j
l'or!
\!uticc lh:ll (x ....J."i) 1\ merely a traml~lri(ln urlhe first(lnkr n>,p(ln~l' h~ 0 time Ul1ll\. Cumidcr till' (olhl\\in,'; pin! (FIgure S.121 of lile reSpmlS(' nt" ~\ .y\tcrn [I) a step input Ch:Ulf'l~ o( llwgnitude U,S at lilll<.' I ~: O. VV'L' '.t'e illll1lClIiaiely that the llllw ,klu) i\ 0 =::; Illinlllt..'\ Sinn' tile d1aIl~~' ill \)utpUI ,rfrer (l long penoel of time i\ ..1" = I k ..111, \\C \C'C thaI I. :: (ulli(\ Dj il1put/('UlpU[), The' prUCl'\" lime COIl\!<lIl[ l'UTl ht' lktcrlllill('d from r!1l: <llll11llllt IlllullC. :ll"kr til(' dt'1:ly, that it [il!..;t'\ fp[ h,i.2 1( ol' tl)(' change (ll occur In this Cht'. th,' ril1lv COI1".t:lJH 1\ ,lppru,\i
matl'l: 5 minutc",
0.8 06
~
0.4 02 0 0
10
15
20
25
FHiCRE K12
Sl<:.'P input
~.lll::;:
r,~C\Plill\C of a fit'\tordn
+ dC:llllill1l' 15
tilllL' lJlllhlll1nl!c'l[u a
0,
8.4
INTEGRATING PROCESSES
'rhe P1T\ioLiS e\~l!llplcs were for sclrre,~ula[il1g proCCSSL:", If ,Ill input changed. [!lC)] Illl' pnJCc"" output camc [0 a Ill'\\ Slc<ldystalc, Another L~OIT11TlO!l cheJ1ljc;lI proccs:, is [he in(('gr,Hing proccss, a;; ;;!lo\\'11 in thc cxample hc](m.
An Integrating Systelll
Cunsidcr a \\;ller SIOr(igc lank \vith itllet and OUI!ct SII"(',\I11\ lh,il C(in bl' incll'pcndcntly <ldiu\tcd rJ1C C;1(J1"agc tank has d c("(lsssectiolwl ;nC,l pf JOO fl~. Initially. lhe CIO\\ in is cq\lalto the f10\\ put. winch i" 5 fl (/min, Tlw inittal height of \\',\\('1" ill the Idnk is 1. ft ,llld the height of till' l:lId, i\ 10 fl, At I :()() pm the inlet rlU\\Ta\(' is incre,i\cd to 6 ft'/lllln. \\'IlL'1l doc\ the tallk (l\Crf]()\\" Thl' m,\teriul balance (,t"slIming constal1l tk'nsityl is
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ z ....
Sec. 8.4
Integrating Processes
dV
207
cit
P,
E':,
(8.46)
where F j and F o arc the inlet and outlet flowratcs, and V is the tank volume. Assuming a constant crosssectional area: d1l
dt
(8.47)
:;;:;
L1SC
d(h '.
dl
hJ
l;~)
~ (P,
P,,)
( E'
"
~f) m
(8.48)
is constant, then:
dl
~ J(F~F)' A
I (\
(8.49)
dt
ku
(8.50)
where y:;;:; Ii
~ hI'
1/:;::
sY(s)
yeO)
k U(s)
(851 )
hI';::: O.
where yeO) ~ h(O)  hI" Assuming that we are, starting from a stcadyslate, y(O):;:; !I(O) So we can write (8.51) as:
s yes)
Of,
k U(s) k
s
yes)
U(s)
(852)
Using the notation D.U for tllC magnitude of the step increase:
U(s)
Lll/
s
(8.53)
and
Taking the inverse Laplace transform:
yes)
Liu
(8.54)
V(I) ~ L'[Y(s)] ~ L
y(i)
kilnl
,I.k Lll/I
(8.55)
(8.56)
208
nr.
Chap. 8
h. I
j,F I '
(6 ~ 5) ai/min
1t=.:J.ft
100 ft'
60n ruinutcs
10 hnms
Since the step change was madc at I :00 pm. the tank \vill overflo\\' at II :O(j pm. i\ plot of tank height versus time is slwwn in r;igurc 8.IT
10
9
8
"
5
4
100
200
300
time (min)
400
500
600
FIGL'RE 8.13
Intcgmtillg .system.
Notice in equation (8.52) t11at the process transfer fUllction has a pole at s ;::: O. This is a characteristic oj" an integrating system.
8.5
LEADLAG MODELS
Some dyuarnic systems. particularly involved \vith process controL have the follO\ving fonn for a lrallSfcr fUllction modcl:
Y(s)
Consider a slt'p input change
k"
T S
I I
i,r"
+ 1
U(s)
or magnitude t111
'
." _.,,,,h I
Sec. 8.5
LeadLag Models
TIlS
209
Y(s)
7,/'.
+ I All + I s
(8.59)
The reader should find that time domain response is (see student exercise II)
)'(1)
(8.60)
A plot of (8.60) is shown in Figure 8.14, for kAu :::: I. Notice if 'Til> T d the immediate in~ crease in the OlItput is greater than the ultimate steadystate increase, while if 'III < 'T d > the immediate increase in the Olltput is less than the ullimatc steadystate increase.
8.5.1
We have derived the step response for a IcadlIag transfer function. This transfer function does not usually arise in the modeling of a physical system, but it often arises in control system design. Our desire in this section is to show how to convert a lead/Jag transfer function to statespace form, so that a general simulation package can be used to integrate the corresponding ordinary differential equation. Multiplying through by the denominator term in (8.58), we find:
(T,t'
+ 1) Y(s)
(T"S
+ 1) 1I(s)
(8.61 )
2 10 1.5
I
7.5 5 2.5
kt>.u
0.5 1 0 0.5 1 0 5
10
15
20
25
FIGURE 8.14
Lead/lag response.
210
'~illg
Chap. 8
_ (.<1\
'j
"dr
.\(II))! \ .
_ (.<I!!
'/I "dt
!!(II))
!!
and we KllO\\ that to obtain the tr,\llsfer function fu rill , the illiti,tI conditions of aJI \'ari, abies \\('fC, ,!'isul1ll'd to he I(TO. so:
,/\
I,
" til
f Y
!!
We canllol sohc (XJd) 11) using a gc'ncra] purP{hC integrator. because it j" not in the "tall LIard forlll uf dr/dl ;::: j(x). Our gual Jl{)\\ is tn ddinc a !lC\V variahle that ,,,,'ill ,illow LIS to usc' ,I standard intci2r;llur Rl'arrangc (:\.63) [0 rind:
ill'
'II
(111
dr
 \'
!!
(x
61!
T,i\
i,,/I
(X.h:"1
'11
dr
<II
T
!
dt
rill ., dl
(8.661
Suhstitutill,l! the righthand side of (8,66) for the Icftiwild sidc of (8.6..J). wc find:
\ tII
(S.671
(8.681
dr
dr
and
\\l'
.\ +
rI
".
.. : )
1<1
II
(S J}<)I
I,i
x=cAx
ex
1I11
Du
 "
Student Exercises
211
dx
dt
cc=aX+bll
(X.70)
y=cx+du
where
a=
T"
C
(8.71 )
h
d
Td
(I
Tn T"
Td )

~d
We wilJ sec in Chapter II how (8.70) and (8.71) can be used within the context o1'a block diagram.
SUMMARY
'We have studied the response of a number of processes that have denominators of transfer function models that arc firstorder in the Laplace variable, s. The systenls were: firstorder, firstorder + deadtime, integrating, andleadllag. Most chelnical processes can be represented by a cascade of these types or modes. We found that stilTed lank chemical reactors arc linear firstorder processes, as long as they have firstorder kinetics (or no reaction) and the input 1'lowrate is not changing. For firstorder and firstorder + timedelay transfer functions, we disclissed how to e!ilimatc the parameters (which always have units associated with theJ,n) by applying a known step input to the process and observing the response. Firstorder + tirnedclay models arc commonly used in control system design. In lhe next chapter we study the transient response behavior of seconcl and higherorder systems.
STUDENT EXERCISES
1. As a process engineer, you are attempting to estimate the model parameters for a
process that you believe is firstorder (with no deacltime). At 3:00 pm, you lnake a step input change to the process. At 4:00 pm, the process output has reached 8(v;,{; of its final change. What is the time COllstant of the process? 2. Consider a water storage tank with inlet and outlet streams that can be illdepen~ dently adjusted. The storage tank has a crosssectional area of 100 1'f2. Initially, the flow in is equal to the flow out, which is 5 ft:'ljlnin. The initial height of water in the lank is 4 I't and the height of the tank is J 0 1'1. At 1 :::: 0 a ramp increase in the inlet flowrate is made, so that Fi(f) :::: 5 + 0.251 where the nowrate units are nJ/rnin.
212
Chap 8
Hm\' long docs it take the tank to overlhm"? Solve using Laplace transforms. ()bti.lin a general CXjJl'cssioll for SystClllS llJO(ll'lcd in Lin iatic)11 \ ,niahlt' (orlll hy:
dy
<II
\\'here:
fer function rclatioJlshirJ:
III I)
(l [
\(s)
Tn,\"
',jS I I
II(S)
4. Consider a chemical reactor that has fernorder kinetics. that is. the rate of reactioll
per unit volume is a constant (a feroorder Kinetic pararnell'r) that does not depend
on concentration. Compare this model with that of a stirred tank mixer. and a stirred
tanK reactor with firstorder kinetics. Perform a numerical study'. related to ExamplL'
X.5. by finding the 7eroorder paramcter thal yields the sanK' slcad;..'statc conc(':l1tration as the firstorder kinctic modeL 5. A process operator rnakes a step change on an input variable at 2:00 pIll and discu\,ers no output response is observcd until aflcr 2,10 p111. She finds that the output i" tHY>;: the way to its final steadystate aL 2:4::1 pm. YULl beliCH' Lbat this is a fir"L order + dcadtirnc process.
or
tlllli..'
JI1put
2001h/hr
cOO lh/hr 200lb/hr 225 Ib/1lr 225lh/hr 2251h/hr 225 Ib/1l1
output
2:..:15 pm
atter 5:00 pm
(i)
90"F
(ii) WhaL is the tinlc constant for this pnKcss (sho\\' unit.s)"?
6. As the process engineer for an operating ullil ill a process plant. you are trying to g('t a "feel" for the dynamic characteristics of a particular process. You have a discussion \vitb the operator about a process (w'hieh .ynt! feel is J"irslorderJ that uses stealll f]owratc as all input variable. and process ternpcralurc ,IS a measured variable. After the steam f]O\'vTatc is increased from 1000 lb/hr to lion Ib/hr (quickJy), lhe process fluid temperature changes from I O(tr~' (the initiaJ steadystate) to 11 O"F in 30 [ninutes. The temperature e\Tlltual1y renches a ne\\' steadystate \',duc of J 2()"F.'. 0) Find the process gain (show ulliIS). (ii) Find the process time constant (show units).
Student Exercises
213
g(s)
2.5
12s
Find the time domain output, y(f). Plot both the input and the outpul. 8. Consider the mixing process shown below, where a portion of the feed stream bypasses the mixing tank. 3. Show that the process has a lead/lag transfer function, if the input is Cj and the output is C\. (Hint: Write a dynamic balance around the tank and a static balance around the mixing point (after the tank outlet). Use deviation variable form.) b. Let F::::: 2 m3/min, F I ::::: 1 m3/min, Cr: : : I kgmollm3, and V::::: 10 !TI 3 . Find the statespace model and the transfer function representing this system. c. Consider a step increase of C to 1.5 kgmollm 3 . Find the response in C 3 to this change.
F,
C,
F,
C,
c,
C3
9. Compari.wm qllmpulse and Pulse Re.s])(JIlses. Consider a tank with constant crosssectional area, At::::: 1 m 2 , and assume that the flow out of the tank is a linear function of the height of liquid in the tank. 'The steadystate values of tank height and flowrate are I meter and 1 m3/hr, respectively. Find the impulse response of tank height if 1 m 3 (in addition to the constant steadystate flow) is instantanollsly dumped in the tank. Compare this with several pulse responses, where the additional I m3 is added over 0.05,0.1, and 0.15 hour periods. IO. Consider a chemical reactor where a step change in coolant flow rate frolll 10 gal/Inin to 12 gal/min (at t::::; 0) causes the change in reactor temperature shown in the figure below.
214
155
150
Chap.S
u..
"0
'"
ill
E 2'
ci
80
100
120
I"inel the gain, lime constant, and timedelay for this system.
Y(s) = k
Show that time domain response is v(
+ T,t', +
I)
= k ""
[I _
...
(I _T,,)
T,j.
After studying this chapter, the reader should be able to: Understand the dynamic behavior of sccond~ordcr systems. Understand the effect of poles and zeros on the response for higherorder systems. Usc the Padc approximation for timedelays. Understand the concept of inverse response. Understand how to simulate transfer function models using ODE solvers that require sets of fiL':'Iordcr ODEs.
Usc theMATLAB routine tf2ss to convert from transfer funclion to statespace
9.1
9.2 9.3
9.4
9.5 9.6
215
216
Chap. 9
The dYJ1atnic behavior of./lrSHJI"dc!" systems was studied in Chapter R. In this chapter, \ve
present results for higherorder systems and shmv I1mv to usc standard nutlll'l"ical integration routines for tinlc domain sirllulation of these ITHldcls. V,ic first study secondorder s)'ste111s, thcll generalize our results to higheronler systems.
9.1
 dc
h II( I)
(9.1 )
This is
UftC.Il
nT dr \vhcrc (obviollsly
o()
(h
!r~kll(l)
(9.21
* 0):
(/,
T'
(ill
2'7
(/,
an
h
ali
k
(
:::0;
;;;:0
:::0;
We discussed in Chapter () that single nth order ODEs do not naturally arise in chemical processes, The secondorder model shmvn in (l).l) or (9.2.) gCllerally m'ist's by changing a set of t\)".'o first~()rder equations (statespace model) to a single secondorder equ;ltioll.Fol a given secondorder ODE, there are all infinite numher of scts of two firSlnrdcr (statc~ space) models that arc equivalellt. Taking the Laplace transform of (9.21:
T'
lv'
Y(v) ~ sv(O)i,(O)]
+ 2CT I.IY(.I)
~ v(O)]
+ Y(s)
Vie
kU(v)
\vhere Y(s) indicates the Laplace transformed variablc. Assuming initial conditions arc zero. that is .\'(0)::: ."(0) :::: O.
find: (9.3)
Y(v)
\vhich can he represented as:
Y(I)
cc
g(s) U(s)
S
T'he choruC!crisfi( cquariol/ of the secondorder transfer function is T~S~ + 2~T can find the roots (also known as the poles) by Llsing the quadratic formula:
+ 1. \Ve
217
I II III
2T 2
(9.4)
1',
fJ 2
\:
T
\:
27
2
1 _.. _     T
V\:2_ I
(9.5) (9.6)
...
\:
T
v\:' .. I
T
The following analysis assumes that ~ > 0 and T > O. This implies that the real portions of PI ancljJ z arc negative and, therefore, the system is stable. The three possible cases arc shown in Table 9.1.
9.1.1
Step Responses
Now, we consider the dynamic response of secondorder systems to step inputs (U(s) :::;
!>u/s):
Yes)
~, , TT
2\:TS
!>u
I s
(9.7)
(:ASE 1
T
Ovcrdamped (t
Since
:> 0, the system is stable (the roots arc less than zero, since we are assured that \/~2~J< '). We btctor the polynomial T 2S 2 + 2'TS + 1 into the following form;
(98)
'>
~"
1)
1, we can see that the two roots will be rcal and distinct. Also, since we assumed that
We sec immediately from (9.8) that the poles (values of s where the polynomial,;: 0) arc;
1',
(9.9)
liT, ~ ..
(iT + V(('
1)/T
which gives the following value for the first time constant:
I
(9.10)
/\hu.
\\l~
_ \
~c
which gin::: the following \allle fur the second time cunstantT
(911 )
2~ TS
t
(9.12 )
\\'e
call \,Tile:
,,'
T
\\lllCh
T1
"
(i). 1.:1)
2\
Oi"'
\Ve call derivc (sec student excrcisc la) the fuIIO\\'ing solution 1'01 step ["eSpll!1SeS ()fllVenlalllpcd
SystClllS
fhcnlmnpl'cl.
S>
]
" c
T
T
If f)
v,here
"
unll
(

1'1('
ft).
I5)
and
\
T,
Nlltc thaL as in thl' case llf firstorder systems. we can divide hy k":'l1 to develop a dimensionless UUlpUL Also, the dimctl\ioliJcss timc is th and we can plu( Cllr\'es f(n dimellsionless outPUl as a fUllction of i;. Thi: IS donc III Figure 9. I. \vhich includes the critically damped l:asc. as discllssed ncxt. \los( chcmical processes t'xhihit ovcnJalllped behavior. The critIcally dampl'd .step l'eSpUIlSC is also .ShUV..rl ill ['igurc 9.1 (curn: with ~:::: I).
0.8 0.6
1.5
0.2
Various values 01 damping factor
o o
FIGLRE 9.1
10
t/lau
i5
Sec. 9.1
219
CASI: 2
Critically Damped
(~
= I)
The transition between ovcrdampcd and underdmnpcd is known as critically damped. We can derive 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 and firstorder step responses is that the secondorder step responses have an "S" shape with a rnaximum slope at an inflection point, whereas the firstorder responses have their maximum slope initially.
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 denominator polynomials. If the relative order is I, then output response has a nonzero slope at the linle of the stcpinput; the step response of a system wilh a relative order greater than I has a zero slope at the time of the step input.
CASE 3
For
Undcrdamped
(~
< 1)
S <:
l, from (9.5) and (9.6), we find that the poles are complex:
fJ= ..
~I
T T
P=(Xjf3
where:
ex
f)
We can derive the following step response for all undcrdamped system (sec student exercise I):
k!:l.u (I
T
('
(1(.
,,,in (I3t +
<I'))
(9.17)
where
f)
V'(
<I'
= tan
220
Chap. 9
Again, dividing by kD.lI, we can produce the plot shown in Figure 9.2.
2nd order underdamped
1.6
1.4
/:~
,varia JS values 0
I factor
1.2
/ I?': ,\\
//og 75'\>"
'/.
.
...
"
...
08
0.6
!
/
.0
\ /
/.
\
./
)/
0.4
t,\
1/
0.2
t
o
2
4
6
Utau
10
12
14
FIGURE 9.2 Step response of a secondorder undcrdampccl system as function of the damping factor (0.
it
A number of insights call be obtained from r;igure 9.2 and an analysis of the step response equations. Notice that the poles for the secondorder SystCll1 can be wrillen:
P  [(
+ jV(I(')! T
.. _ I
Observe that, for smaller S, the respollse is more oscil1atory. For S < I, the ratio of the imaginary portion to the real portion of the pole is:
imaginary
real
As the imaginary/real ratio gets larger the response hecomes more oscillatory. We also notice that a decreasing T corresponds to a larger negative value for the real portion. As the real portion becomes larger in magnitude (more negative) the response becomes faster. We use these insights to interpret po1cl7.ero plots in Section 9.3.
Sec. 9.1
Responses of
Second~Order Systems
221
l
c
rise time
I.oscillation j period of
%
FIGURE 9.3 Step response characteristics of undcrdamped secondorder processes.
. b decay mIlO = 
overshoot ratio =
Time
9.1.2
The following C0111mon measures of underdampcd secondorder step responses arc shown on r7 igurc 9.3 and defined below: (I) risc timc, (2) timc to first peak, (3) overshoot, (4) decay ratio, (5) period of oscillation.
Rise lime. The amount of timc it takes to first reach the new steadystate value.
Time to jirst peak. The timc required to reach the first peak. Notice that there arc an infinite number of peaks. Overshoot. The distance between the first peak and the new steadystate. Usually expressed as the overshoot ratio, as shown in the figure. Decay ratio. A measure of how rapidly the oscillations are decreasing. A h/a ratio of 1/4 is commonly called "quarter wavc damping". Period (d'osc'illation. The tilnc betwecn successive peaks.
The following example shows how to usc Figure 9.2 to estimate these values.
EXI\l\;lPLE 9.1
Consider the following transfer function, subject to a ullit step (L\.u ::::: 1) input change (assume time units arc minutes):
g(s)
, 4s"1 0.8s
Find the (1) rise time, (2) time to first peak, (3) overshoot, (4) decay ratio, (5) period of oscilJa tion, (6) value of yet) at the peak time,
222
Chap,9
sec that;
4 so
:::
2
II.K D,S
2i::'T

:=
0.8 so
\VC usc Figure 9.2 as lhe lJasis for the follmvil1g calculatio!ls,
~ =
0.2 is'
~
1)1, so
is'~
II"::::;;
l,g
= J.6 minutes
3.2 .. 6.4 Illinu(t's
::: 0.2
=::
1"
1.2. so
'II:::
;.c;
3. The
o\Trsh()()(
ratio is
I 15
15J I
(l.5J.
I I ~ IJ,\
I
9.6  3.3. so
f(,,, ::::
Although equation (1).17) C<ltl be used to solve the previous <;.'xarnple. it is often easier to usc the dimensionless plot (Figure 0.21.
9.1.3
Impulse Responses
NO\v, \ve cO[l;.;idcr the dynamic response of secondorder systems to impulse inputs.
Y(s)
+
2~7S
CASE I
O\'crdamped
(~
1)
C<.l.SC
(,~I ~ sinh
thl~
~)
dimensionless rimt'.
Sec. 9.1
223
CASE 2
(:riticallJ' Damped
(~:::::
I)
The impulse rcspOilsC for the critically damped case is (see student exercise 2b):
y(t)/kA =  7 e
T liT
CASE 3
Vndcrdampcd
(t / 1)
2(~):
The time domain solution for the nnderdamped case is (see student exercise
Y(I)/kA
T
eU/' sin
(VII
0.6
'f'r.,.+,
,.....................
%
0
'5
w w
0.4
C
0
'w c
'"
0.2
i5
'" E
0.2
0.4
6
tltau
10
FIGURE 9.4
of~.
224
Chap. 9
9.1.4
Consider the case where the input is a sine fUllction. with amplitude A and frequency (,):
lI(r)
The Laplace transform is:
c:::C
A sin
(ll!
when applied to the secondorder transfer function and inverted response after a long period of lime is the periodic function:
y(l)
\vhcrc:
[0
the
lillle
domain. the
kA
\
(9181
(9191
(sec student exercise 3). The amplitude of the output is:
kA
and the phase angle is (b. Often, system behavior is discussed in tenns of an amplitude
ratio, which is the amplitude of the output eli vided hy the amplitude of the input. The amplitude ratio is:
k
"'~I
EXi\IVIPLE 9.2
g(s)
A Imv frequency sine forcing ((,) ::::; 0.1 min I) yields the input/output response shown 111 Figure 9.5. Notice that the output lags slightly behind the input. and the amplitude of the output is slightly smaller than the input amplitUde. Contrast this result with the folhnving case 01" a higll frequency input.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ."':,'"ifi
Sec. 9.1
225
0.5
j
1.5
20
40
time, min
60
80
JOO
FIGURE 9.5
A high frequency sine forcing (l') Ufe 9.6.
Low frequency sine input response. 5 min I) yields the input/output response shown ill Fig
0:::
0.5
u
y
"
~
"
a
0.5
j
a
FIGURE 9.6
2
time, min
Notice that the output lap significantly behind the input, and the amplitude of the output is much smaller than the input amplitude. A particularly interesting type of behavior that can occur with secondorder undcrdamped systems is known as reSOll(///(.'C pe(lking, which occurs in intermediate frequency ranges as shown in Figure 9.7, where a frequency of 1 fad/min is llsed. Here the output amplitude is significantly higher than the input amplitude although the input/output gain is I. At lower ([;igme 9.5) and higher (Figure 9.6) frequencies the output had a lower amplitude than the input, while al an intermediate frequency (Figure 9.7) the output had a higher amplitude than the input. This phenomcna can only happen in systcms with complex roots.
226
Chap.9
10
time, min
15
20
FIGlJRE 9.7
The concept of phase angle is illustrated by Figures 9.5 through 9.7. At low frequencies (Figure 9.5) the output barely lags the input, and therefore has a phase lag of almost {) deg. At inlt'Tmcdiate frequencies (Figure 9.7) the output Jags the input by (jO", and ill high frt'qucncics IFigure 9.(l) the output lags the input hy almost ISO". Also noll' that the notion of "high,"' "intcnncdialc.' and "lil"/' frequencies is relative (dependent Oil T). Lm',!, medium. and high frt'ljUCJKit'S cnllcspol1d roughly to (,jT 0::; 0.1, J, and 10. re::;pcctivcly.
T'he method of sincforcing a system is llsed in the analysis of feedback control systel11s and is knO\vn as frequency response analysis. Bode diagrarns arc llsed 10 plot the amplitude and phase angle as a function of rrcqlll~ncy. Vv'e do not provide further analysis here. but refer the reader to any textbook on process control for 1110re detai 1.
9.2
a sccond
order system with numerator dynamics with the gain/time constant form:
s(s)
k(T"S + J) .//(1) (",.1+ 1) (T!S+ I)
W201
(s 1',)(.1  1',)
//(s)
Sec. 9.2
227
where:
PI
The gainltimc constant form has the following time domain response to a step input (sec student exercise 4):
(9.21 )
The reader should show that, if Til:::: T2' the response is the same as a first~ordcr process.
EXAMPLE 9.3
yeS)
(9.22)
The step responses are shown in Figure 9.X. Notice that negative numerator time constants yield a step response that initially decreases hefore increasing 10 the final steadystale. This type of response is known as inverse n\"jJollse and causes tough challenges for process control systems.
"1 = 3 "2 15
varying
"n
60
FIGURE 9.8
namics.
Step responses of a secondorder system with numerator dy
Notice also that a numerator time constant that is greater than the denominator timc constant causes ovcrshoot before settling to the hnal steadystate. Also notice that the inverse response becomes "decr>er" as the process zero (117 11 ) approaches a value of zero from the right.
228
Chap. 9
9.3
+ I
(T,I'"
I )(T,I'"
I) .. (Td,,"
(9.23)
I)
hm
([II
hiS
(f
I hll ) I do
(1,/'!'
(9.24 )
IS
The \'alues of \' that cause the numerator oj' (9.23) or (9.24) [0 equal zero arc known as the "zen},,' of the transfer function. 'fhe val LIes of s tll,l! cause the denominator of (CJ.23) or
(lJ.24)
to equal /cro arc knowll as the "poles" of the transfer function. The "pole/el'o" for111 is:
C, )(.1
g/,(I)
cJ ("
cm ) p.,l
\\Ilcrc:
.
k
II
i
J
I', )
i'i , (:)
The notation il ( fl,) is shorthand for ( fll)( P2) (Plll. Notice ~ll~() Ihm the poles ;m:
Ill::: I,ll
(l).271
and that complex poles (or Zt~ros) must occlIr in cornplcx conjugate pairs.
EXA\II'I,E 9,4
+ 1)( 15.1
t J)
~~~~~
~ "'_Itj:.l;:~
Sec. 9.3
229
" 20s + 2
1 ISs
g(s)
and the polezero f(mn is:
lOs 1 I)
18s 1 I)
15
Notice that the zero for Example 9.4 is positive. A positive zero is called a righthalfplane (RHP) zero, because it appears in the right half of the complex plane. Righthalfplane zeros have a characteristic inverse response, as shown in r'igurc 9.9.
Also notice that the poles are negative (lefthalfplane), indicating a stable process.
Righthalfplane poles (positive poles) arc unstable. Recall that complex poles will yield an oscillatory response. A polezero plot of the transfer function in Example 9.4 is shown
in Figure 9.10 (the pole locations arc (1/3.0), (1115,0) and the zero location is (0.1,0); the coordinatc~ arc (reaJ,imaginary)). For this system, there is no imaginary component and the poles and zeros lie on the real axis (Figure 9.10).
1.5
'"
0.5 0 0.5
1
20
40
60
80
100
FIGUU.E 9.9
Inverse response.
230
Chap. 9
Real axis
F[G(:RE II.! 0
As poles move further 10 the left they yield a ra...;ter rcspnnsc. while illcrcclsing the n1<lglliludc of the illlagillar.y porti 1 11 makes the rcspcH1S(' mure oscillatory, 'fhis bchavim j"
slllllillaril.l~d in
Figure 0.11. RcC<.q also that a process with a pole at the origin (and nOlle
in the righthalt'planc) is kllO\vn ,IS an intcgmting system. that is the systcrn nevCl setllts [() a stcadystate when a step input change is made. Mulli[J1c righthairpjtmc zeros lUSt' multiple "changes in direction" for e\ample. \vilh two RIIP leros. the step respollse is initially ill nile dirceti(HL switches dirL'ctioll. then ::witches back to the initial direClion.
f),tI
more oscillatory
Imaginary aXIs
r
faster response
x
Inverse response zeros Real axis
unstable poles
1
FIGUHE 9.11
n/cm).
[(Teet of polc/l'J'o location (lJ) dynamic hd1avlor (\P(llt"'. As poles hCc(l1l\t' more negative. !Ill' rt'SPC1I1SC is la\lt'l'. As the 111Ia~il1dry/n::nl ratio increa'ics. lhe response becomes mme uscill~llor:
Sec. 9.4
231
1.5 1 0.5
y SecondOrder Pade' Approximatlon
.J
0 0.5 1
Pure TimeDelay
5
time
10
rirst~
!,::>
r
FIGURE 9.12 Comparison of step responses for pure timedelay with order and secondorder Pade approximations. Dcadtimc::: 5,
B
e
0,=
s
(9.29)
+
The secondorder Padc approxilnation is
0
2
0,,=
o \' + 2
02
,
y'
12
2 o 0 " 1 + ,. + 12' 2.
(9.30)
A comparison of the step responses of first and secondorder Padc approximations with pure time delay arc shown in r"igurc 9.12,
EXAiVIPLE 9.5
xes)
Ss
5s + I
232
Chap.9
 2.Ss 7.Ss
and the secondorder Pade appro\i11latio/l .yields
2.0SJJ\:  2S1
1041
a cOlllparison {If the step response.s (If
11.58.\3,' + 7.51'
~(s). gl(s) and g~l(S) is "llUwn in [:igurc 9.] J. Notice tllat the firsturdcr aPllW\llllati(Hl has an inverse response. while the sl'l'())Jd~ordcr appmximatill)l has a "double inverse 1'l:.'SP(1!1"t'." The reader should I'ind that th,'I\' 1\ it sin,!,'Jc Ilo\itin,' len) fur NI{S) and there arc t\\'() po.siti \'c. complexconjugate lcros of the J111I11Cra\(lr tr,lIlSfcr functi(lI1 \)f g ~(.\).
0.5
y
10
15
20
25
FIGURE 9.13
9.5
Sec. 9.5
State~Space Form
233
y(S)
k
_I 2{7S 1_ I lI(s)
, d'" C dl i
2{7 dl
dy
+ Y c.c k U(I)
(931 ) (932)
LeI:
.r] ::::
and: so:
Divide (9.31) by
72
X2 ::::x 1
(9.33) (9.34)
y
to obtain: d'y
::::;~rl::: \:2
dt 2
2{ +. dy + ..
1"
tit
and since:
(935)
y =
[1 0]
1::1
1
(936)
The student should show that defining y::;;: x 2 leads to the following statespace model:
. 2{
=
I.
XII
X,
7
I
7'
()
I I]
.', ()
l.xll +
7' [u]
(937)
(9.38)
234
Chap. 9
J'vlATLAH has routines for converting fron] transfer function fonn to stalcspi.]CC form (tf2ss) and vice versa (ss2tf). tL2ss is llsed in LxarnpJe 9.5.
EXAiVIPLE 9.5
U.7071 \
1 I/(s)
den
and
ClllCl"
0.7071
a
b :
cc.1
1.S000
()
Notice that the slale space models ill Exmnplc 9.5 are dif{l~rent than the malices that arc obtained from (9.3."1) and (9.36) or (9.:n) and (9.38), hut the differellt forms vvould all yield the same results for the output variable via simulation. Rcmcmber that a transfer function relates inputs to outputs but docs not represent the actual stales of the s)'stern. There arc an infinite number of statcspace models that \vill yield the sank' input/output lllodel. After finding the statespacc form for a transfer function, we can use any available numerical integrator to solve problems. MATLAB rOlltines of interest include od(:, 4 (), in.itiaL and step.
9.6
9.6.1
step
A quick \vay to generate stCJ1 responses is 10 use the MATLAB function step. This call be used \vith either a statespace or a Laplacc domain model.
Sec. 9.6
235
g(s)
\vhich can be written:
50 s'
2(IOs
+ I) + 15 s + +2
15 s
g(s)
20s
50
The following MATLAB commands arc llsed to generate the response shown in I;igure9.J4.
Dum den
=
,0:
n,
[y,x] = step(num,deD,t)
12
0.8
"
0.6
OA
02 0 0 10 20
time
30
40
FIGURE 9.14
236
0.4
0.3
Chap,9
0.2
"
0.1
0
01
10
20
time
30
40
FI(~LRE 9.15
for tilt.' Sll'p response of a transfer fllllction IllUdel. The nUlllhet' or urguJl1CnL" determine,,>
\\'hether a tntl1.';fcr function or statc space rnodel is used by lllC step function, and whether the lime \ ('c\(X has hel'll specified or not.
9.6.2
impulse
plot (t,Y)
'rhe plot is
SIl0\Vll
(disl'(Hl
titlllOlIS) dfcct Oil the output. because this is a relative order olle sy'slcm.
and usc:
= impulse(num,den,t);
SUMMARY
The step responses of the classical seconu order system (o\'erdampcd, critically' damped, and undcrdampedl were presented. In addition. \ve sho\ved the effect of ll11rncrator dynamics (and particularly righthalfplane zeros) 011 the rc"ponse or a sccondorder sy'stenL The Pad0 approxilnations for dL'<ldtiJl)c \vere presellted. You should understand the effect of the location ()r poles and /eros 011 the speed and quality of response of a transfer fUllCtion model. The process gain is sllnply the ultimate change in OLltput divided by the change in input.
Student Exercises The MATLAB routines used were transfer function to state space step response impulse: impulse response
tf2ss:
237
step:
Critical concepts from this chapter include: damping factor natural period numerator dynamics Padc approximation for time~dclay relative order
STUDENT EXERCISES
1. Derive the step responses for the following secondorder systems. a. Overdamped b. Critically damped c. Underdamped 2. Derive the impulse responses for the following secondorder systems. a. Overdamped b. Critically damped c. Underdamped 3. Consider a sine input with magnitude A and frequency w. Solve for the time domain value of the output for the following secondorder systems. a. Overdampcd h. Critically damped c. Underdamped 4. For a secondorder system with numerator dynamics, find the step response for the following. H. Ovcrdampcd. b. Underdamped. c. Critically damped. 5. A second~order system has the following Laplace transfer function form:
Y(s)
2.5
+ 5s +
U(.\)
where the time unit is hours. The initial steadystate value for the output is 20 psig and the input is 4 gpnl. At t::;;: 0, a step input decrease is made, from 4 gpm to 3 grm.
238
Chap, 9
a. \Vhat is the final value of the outpUt'? h. \\,'hcn docs the Olltput first reach this final \,tllIe',J
('. \\:hal is the minimum value of the output',)
d. \VhCll docs the output hit this minimulll \aluc'? e. PInt the response.
6. ('ullsickr the follO\ving secondorder
Ol)F~:
d\
'II'
dt'
(T
I T,)
d\'  ill
=::
/I
u(()) ::: ()
a. Find the Laplace lransfmm of the elitTerential equatioll. \Vrilc this cxprC'\SI(ll1 in
the form of \'(s)
::::: ,l,'(s) II(S}
b. Nnw. assullle that a step clwngc of magnitude .\ !l1 tilt' variahk /I Dccur" at tinlc::: 0, Find the lime domain resulL y(l), c. Nm\'. assume that a step change or lllaf,:JliWc!c ,\ in the \<triahle ({ OCClII', at time::: O. Find the time domain re"ult. y(lJ. hy lhing a parti,lI fraction c\jI<llhio1] and sol\ing for the iJl\er"c Laplace transform by ll'lllti. d. Plot tilL' tirOL' domain respullse. yUl from p;lr! c. Llsing 11ll' t()lh1\\ing parallkllT \',due" k:::::: I. '1:::0; J.,~::::; 10. and try s('v('lal plots. \arying III from J to 10 c. Plot the time domain re::.potlsc. r(f) from part c. u"ing the follc)\\ing p;lr,II1WtL'I \allil'S k::;::: I. II::: 3.,~:::: 10. and lry sl'\l'ral plots. \arying from 10 to ()
'II
d.r I I til
,[
,[
II
dr,
"
til
"
ell
and the static rclation"hip y:::::: XI + x:~ where XI and x::, arc two state \'ariahles. r is the output \,lriable, and II is ;m input \ariahlc. a. Show that the twn equations call he combined to yield a single ODL in the Corm of problem 6. Find k and I I I a" a rUlIction of k I' k::.. 'I' '::,. b. No\\'. assume that a step change of magnitude ~u in the \ariahlc II OCCULS :H time:::: O. Find the time domain result. y(fl. hy ming a partial fraction l'.\jlaIlSloll and solving for the iJl\erse Laplace transform by hand. c. Plot_l.'t(l). x:,(t) and YU.l if j,l/:::: I. k 1 :::: ~I. k 2 :::: 2. 11:::0; J. and '2:::; 10. R. As a proct'ss engineer with the Complex Pole Corporation. you arc as"igned a unit \vitll an cxotlll'nnic chemical reactor. In order to learn Innre ahout the dynilll1ic" of the process, ),'OLJ decide to make a step change in the input variable. which is ('()ulant lenlperaturc. from 10"e to [SOC, Assume that the reactor \vas inItially at a srl'~ldy slate. You obtain the follmvingplot for the outpUl variable. \vhich is reactor tCJllpcr~ aturc (notice that the reactor temperature is in OF).

~~rg.iF,r
Student Exercises
290 285
u.
ID "0
~
239
I I I I I I
~t
I I
~
...J____
I I 1 I I
'"
~
0
 
l~rIf
I I I
I I 1 I
I I
~
 I I
~I
iii ID
2!
I I
I I
I
I I
I _____1
I I
I
II I I
I
I I  tI I
1I I __ I I I I
I I !I
''" "
r
I I I I I
___ I
  t I I I
1I I
I I
 tI I
I I I
20
40
time, minutes
60
80
100
a. What is the value of the process gain? (show units) h. What is the value of 1''1 (show units) c. What is the value of~? (show units) d. What is the decay ratio? c. What Is thc period of oscillation? (show units) f. Write the secondorder transfer function. (). A process is described by tile f,Jifowing finear ordinary differential equation;
4
d~'
d1
1~2
dv
tit
+y
2.5
d 2l{
(0)
du(O) dl
~~ ~
1 :=
U(I)
2I
The units for time are minutes. a. What arc the values of the poles of this process (give units)? b. When docs the output of the process reach a maximurn value? c. What is the maximum value or the process output? 10. A process has two poles and one zero. The poles are located at I 0.5) and the zero is located at 0.5. Sketch the type of responsc that you expect to a step change in
240
Chap.9
input. Explain. F,'ind the transfer function and verify these results assuming a gam of
one.
(1,0.5)
x
x
(0.5,0)
(1,0.5)
[ ~: I [
a. b. c. d.
2AOS 0.833
2.238
II x, [ + [
x,
Xl.
7 [ 1.117 /I
Y 
10 11 [x,'[
~ g(s) lI(s).
Find the transfer function g(s) where yes) Find the poles and zeros. Plot the response to a unit step input. Plot the response to a unit impulse input.
12. A process engineer responsible for the operation of a complex chemical reactor has the process operator make a step change in the coolant f10wrate from 10 gpm to 15 grm to the reactor at 2:00 pm. The reactor temperature is initially 150"F at 2:00 pm and drops to a low of 115P at 2: I0 pill. Eventually the reactor temperature cornes to a final stcadystate temperature of 125"F. Assuming that the response is secondorder (k!T 2 \.2 + 21;TS + I), find k, 1;, T (show units).
13. The output of a sccond~order, 1I1lderdamped system has a rise time 01" I hour. and a maximum value of 15[" (in deviation variables), aner a stcp change at time { =: o. After a long period of lirne. the output is 12"F' (again ill deviation variables). a. What is the value of 7'1 b. What is the value of C c. What arc the poles? (also, show their location in lhe complex plane) 14. A step change of magnitude 2lb/min is applied to the input of a process. Thc resulting oulput response, in dcviation variables, is shown in the figure below.
_____________________________
~_,=_jf__kLl'*;1t
Student Exercises
40
241
30
20
10
o o
17
/
50
\ >,,_/
,
100
.............
/
.....

150
200
250
300
time (min)
Step response of a physical system, in deviation variables.
a. Pind the period of oscillation, rise time, and time to first peak, for this system. Show your work. h. Find parameters (show the units) in the transfer function, g(s) :::::: k/(T 2S2 + 2~TS + I), by using the dimensionless plot, Figure 9.2. Show your work. IS. Consider the following thirdorder transfer function, where ~ is a parameter. Find the conditions on the parameter [3 that will give an inverse response.
g(s)c
(5.1'
I
Show your work and explain your answcr. 16. Consider the following transfer function:
11(.1')
S2
+s 2
s2+4s+3
a. 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 final and 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 statespace model:
I~; I I
x, + 10.00155111 0.00248
242
Chap. 9
Find the lrallsfn l"unctiulls n.lating the input tu c<lch output. Find the step rc"poll_sc
01" l'<ldl output.
011 a 11lJlnhcr of processes (flV), rile '\~'illjtillg the plot below. Associate each process with a rCSpn!1Sl' ClIl'\t'
21'
<';(,\)
2\
II
C:(.\ )
III
.l::(.\)
= =
.:s
1(.\
IV.
2\
(;'(.1)
!)
Is
2
15
"
0.5 0
05
0
10
19. ('ollsidcr (\
SC(nIH!
I)
let 11 represent the qmtlkr denominator time constant. ,,\S';';\lllle a step change ill inpuL. Shc)\\' thal a max.imulll ill \'(l)/kj./{ occlirs if 'II T, and tkJl a llliIllJ1lLl111 (illdicating ill\ erst' rcspllllsC) occur.., if Til O. i\l..,o 'ibmv th,lt there is IlO L'.\lrellW ill Lhe 'tep respoll"e if 0 '11 To. (llim: Reali/e LhaL a lTw.\imUIll or rninilllllill oel'I.I!"" at \/1/1 ~ 0.) 20. ('ol1sidcr the tran"fer fU1Jction g,,(s)
12.\1 2
L I
Student Exercises
243
gJs)
b. Write the gaintime constant fonn g,,(s) c. Write the gainpolezero form r; (s') =
'I"
h.l' +
1)(7 21' + I) .
(.1'1',)(.1'1'2)
21. The reader should show how the firsl and secondorder Pade approximations relate to a Taylor series expansion. The 'I'aylo1" series approximalion to a timedelay in the Laplace domain is
(J2.S2
,'
1  IJ.I' I
O\J
2'
:V
Ots 4
05S 5
4'
5'
06",6
61
Use long division of the first and secondorder Pade approximations and cOinmenl on the number of terms thai arc consistent with the Taylor series expression. 22. Consider the following interacting lank problem. Assume that the flow between tanks 2 and I is linearly proportional (rJ 1) to the difference in lank heights and that the outlet flow from tank 2 is proportional (f3 2 ) to tank height 2. Develop the transfer function models relating the inlet Ilowrate to both tank heights.
23. Consider an exothermic chemical reactor that has the f{Jllowing transfer function relationship hetween the inlet flowrate (input) and the reactor tcmpcrature (output).
~
<'
The units of the input arc liter/min and the output is in deg C. a. Find the values of the zeros and poles. Is tbis systcm lIndcrdamped or overdamped? b. For a step input change of +3 liter/min, find how the Olltput changes with time. How much docs the temperature decrease before increasing? Compare plots of your analytical solution with those obtained using the MATLAB function
step.
c. What is the ultimate change in temperaturc aftcr a long period or time'! d. If the steadystate input and output values (in physical terms) arc 10 liter/min and 75C respectively, what arc the physical values of thc results in band c'!
244
Chap. 9
c. If a step decrease in the input of ~3 liter/min is made, what would he the results in b, c, and d? 24. Consider a CSTR with a firstorder irreversible reaction A > B. The modeling equations are:
The following parameters and steadystate input values characterize this system:
F
= 0.2 min l
V k
ccc:
liter
The input is CAl and the output is Cn. You should be able to show that the stcadystate values of (~ and CjJ arc 0.5 gmolliitcr. a. Show that the transfer function relating the feed concentration of A to the COIlcentration of B is:
y(.I") =
0.5
(5.1" + 1)(2.5.1" + I)
. . gmol B/lilcr .... 15, and the tllne lIl11! IS Il1lIlutcs. gmol A/liler
:;:0
b. At time t 0, the input begins to vary in a sinusoidal fashion with amplitude 0.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 using the MATLAB integration routine ode45. Remember to use the correct initial conditions. Also, remember that the transfer function results arc in deviation variable form and must be converted back to physical variable values. d. Discuss how the amplitude of the output changes if thc input frequcncy is changed to 5 mitr t . 25. Oftcn higherorder process transfer functions arc approximated by lowerorder transfer fUllctions. Considcr the following sccondorder transfer function:
Student Exercises
1
245
1)(11 1)
Find the value of 'T in a firstorder transfer function, Ij('TS + 1), which best approximates the step response of this secondorder transfer function, in a leastsquares sense. (Hint: Define an error as a function of time as e(t):::: Y2(t)  YI(I), where }'2 and YI are the step responses of the second and firstorder responses respectively. Find I \vhich minimizes e2(t) when t > inf'.)
1
(71
"
1)( TI
1)
a. POI' a unit step input change (Au = 1), find the time at which the rate of change of the output is greatest (i.e., find the inflection point). b. Compare this rate of change with a unit step response of a firstorder systelll with the following transfer function:
1 g(l) ~ (27,V + I)
c. Plot the step responses for a and h, for sponses.
'T
27. Pharmacokinetics is the study of how drugs infused to the body are distributed to other parts of the body. The concept of a cOinpartmental model is often used, where it 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 (the rest accumulates in compartment I). Similarly, some of the drug that diffuses into compartment 2 diffuses back into compartment I, while some is eliminated by reaclion and 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 COI11partment of interest, the following halance c<.J.uations arise:
~ (k,o
+ k 12 ) x, +
k 21 x,
II
where XI and x2 ;::: drug concentrations in compartments I and 2 (f.1g/kg patient \vcight), and u rate of drug input to compartment I (scaled by the patient weight. /Lg/kg min). Experimental studies (of the response of the compartment I concentration to various drug infusions) have led to the following parameter values for the drug atracurium, which is a muscle relaxant:
::;0;
246
Chap.9
(k lO
+ +
(k 2ll
0.094 min
I
I
0.015 min
a. [,'inc! the poles and zeros of the transfer function that relate the input,
olltput, xl'
II,
to the
b. Find the response of the concentration in compartment I, Xl' to a step input (If I /Lg/kg mill. What is the value at 10 minutes? What is the value after a long pc~ rind of time? c. Find the response of the concentration in compartment I, Xl' to an iII/pulse input of 10 f.Lg/kg. What is the value at [::: 0'1 'What is the value at 10 minutes'! 28. Consider the following delaydifferential equations:
dX 1
dl
x,(1  8) I 1/(1)
dx)
dt
...
2x
J
using the firstorder Pacte approximation for dcadtimc, write the corresponding (approximate) pure differential equations. (llin!: define a new variable x3;:;;: xz(t  H).) Solve the equations using ode45, for an initial condition in all states, and a value of 1 for the input
or ()
10
Chapter 6 presented simple examples for transforming a statespace model to a single 11th order ditlcrcntial equation. Once the single differential equation was obtained, the methods of characteristics and undetermined coefficients (Chapter 6) or Laplace transforms (Chapters 79) could be used to obtain a solution. A general method for converting a slatespace model directly to the Laplace domain is presented in this chapter. With the transfer function representation, one can easily obtain the corresponding single nth order differential equation. After studying this chapter, the reader should be able to: Convert a statespate model to a transfer function model analytically. Convert a slatespace model to a transfer function model using the MATLAB routine Sf32tf. Discuss interesting effects from polezero cancellation, The
rm~ior sections
arc:
10. J
]0.2
A SecondOrder Example
The General Method
10.3
247
248
The goal of this chaptn is 10 take
il
Chap, 10
y~CxjUll
yes)
<;(s) lies)
and usc this mode] to solve for the response;.; of each output to each input. \Vc will also usc this technique to easily find the 11th order differential equation corresponding to l'<ICh output variahle.
10.1
A SECONDORDER EXAMPLE
Consider the follo\ving tv\'ostatc, singleinput. singleoutput model:
dX I
dl
(111'\"1
+
(1 1.',1.":,
+
hi] II
( I0 I ,
dr")
dl
{ 10.21
( IO.JI
s X,es) s X.(s)
',(0)
( I ()l,
{ 10.) I
x,(o)
iJ", (J(I)
d" (J(s)
c,. X,es)
( 10(; I
( 10.71
lI,el X,es)
!I"
X,es)
( I O,~ I
III order [0 generalize this procedure later. we \vritc (10.7) and (10.8) in matrix form:
(,,)]_.] 0"
.. (/: 1
11,",1 \
1 h"
hill U(s)
Ih
h" lues)
21
or,
(/,Ii
( I () _ I C)
(/) I
~~~~~~ ~,
Sec. 10.1
A SecondOrder Example
249
yes)
We scc (10.9) is of the form:
[e"
(10.10)
(sl
with the solution for Xes):
A) Xes)
II U(s)
(10.1 I)
(10.12)
yes)
combining (10.12) and (10.13):
C X(I) + D U(s)
(10.13)
yes)
c"
[C (sl ~ A) 'II
+ D] U(s)
(10.14)
yes) .. [C (sl
or,
A) 'II] U(s)
(IO.IS)
yes)
G(s) U(s)
(10.16)
In this example, since there is a single input and a single output. G(s) is a single transfer function, which we call g(s). The transfer function is the ratio of a numerator and a denominator polynomial:
g(s) ..
H(s) D(s)
afC
The reader should show that the polynomials in (10.17), based on (10.15) exercise 4):
H(s) ~
"l S
+ "0
(1O.18a)
(HU8b)
ell btl
+ en b I,
bll
{In
(IO.19a)
flo =
elJ [0 12
blJl +
C l2
ra
21
bl ] ~
alJ
h21 1
( 10.1%)
(lO.19c) (lO.19d)
Since the inpuHmtput relationship is wrillen:
250
Y(s)
We call further write:
Chap. 10
or.
till
II,
dl
V'/e no\\ have all automated procedure to find the transfer function for a singleinput. singleoutput. twoslate S}'stel\1. An example is shmvl1 below.
Example 10.1
('oll"idcl <l llncari;cd Illode! of a l)iorc<ll'tOL wlth the sl'cundstatl' \"ariahk (SUbslralt' c{llKCIlIJ,1 liun) Il1c,l"urcd and with dilution ralt' (I:;V) as the input \ari;\hlc,
A=
B
l
II
II
II 7';1111
c
[)
[II I]
c:;;:
C (sf  A)
B:
O.9().')()
A)
!O.7~O(J
s + 2.."640_
A)'
2.:'i640 IJ.7SIII1
2..'1640 s
0.67920
( (d
A)
o 7';00\ I,
\
2.:'1640 s
U.6792(J
0.7';011 II [
. .).XL).J
"l;l~21 S
'
2.5640 s I O.h7920
Sec. 10.2
251
+ 0.67920
so,
yes)
and we easily find that
s/
t 2.5640 s
d\' , de
+ Z.5640
dy
' dt
,j
0.67920 \' 
3.RZ55
dll dt
+ 1.14765
II
10.2
dt
(lIIX I
Ol/JT"
+ h ll
bllJlu m
(10.20)
I.~"
.,
.,
i,
I
=
[all
_a",
a'''.lx,
a"" x"
I [""
+ "",
(10.21 )
,'' 1['']
(,/1 _
Id"
d'l
\11
d'2
252
which has the form:
Chap, 10
x~Ax+Bu
(10.22)
y~Cx+Du
where the dot over a slale variable indicates the derivative with respect to time. Recall from Chapter 5 that the eigenvalues of the Jacobian matrix (A) determine the stability of the system of equations and the "speed" of response. Now, taking the IJaplacc transform of (10.22):
Xes)
(.II
A) 'lIli(s)
DIV(s)
(I'
C(sl~A)'ll
X
n)(n
n)(n
Ill)
gll(S)
g pes)
g'm(s)
G(s)
g" (s)
g,,(s)
R,m(s)
10.3
will generate the numerator and denominator Laplace domain polynomials for the transfer function between input number m and the outputs, in descending order of s.
EXAMI'LE 10.2
Here we consider the linearized biorcactor model, with two inputs. The first input is dilution rate, the same input llsed above. The second input is the substrate feed concentration. We will also consider both state 1 and state 2 to be outputs, and modify the C and 0 matrices so that ss2 tf provides the transfer functions between the input and both outputs.
Sec. 10.3
253
2.5640]
[0,0.9056;0.'15,
A 
B=
['1.5302,0;3.8255,0.3]
13
1.5302
3.825'3
o
0.3000
" c
c
c:o
[1,0; 0, ] ]
1 0
1
[0,0; 0,0]
"
D
""
0
0 0
Input I
The numerator and denominator polynomials relating the first input to the two outputs arc found using the following command:
[nuffi,den] "",ss2tf (A,B,C,D, 1)
num =
[]
0
den
1 .5302 J .8255
2.5640
0.4591 1.1476
1.0000
0.6792
where the first row of the num matrix is the coefficients of s in the gil (s) polynomial. in dccreas~ ing order from left to right. Similarly, the second row of the num matrix is the coefficients of s in the 1;'21(8) polynomial, in decreasing order from left to right:
11 (,)
l'
"l') ~
.1"
We realize that the eigenvalues of the A matrix and the poles of the transfer fUllctions will be the same. 'fhis is verified by the rooLs and eig cOll1mands
254
((lot,;
dll;:;
Chap. 10
O.30()O::1
eiq (al
an,;
. 3 () CJ CJ
call
\\I'ilt'
fUIlCliulls
fOHn"
I ,,"iJ02 (s + O.J)
(s
1\\herc
\~C
+ 2.2(40)(0"
+
0.3)
III(S)
3)Q55 (s
0._')
',.11 11.,1 1(,\)
is +
~.jA(I)(.,
!J'''.
canccl~
sy"kIl1S
(s
j.
).5J02 2.2(40)
/I
1_
(s)
3./{255
(s + 2.1(40)
II,(S)
(s)
(1))17 \
fOOls
\Vi.' \I.ould notice the Il'ropok cancellation if we ;\Is() lIsed the TOC)t~3 cOll1llwnd \() find the of the IHlIJ1Crator polynomial
q'Tot:? (nurc(l,:))
 () . 3 C1 (I 0
'>rU(I\ '; ([;1 :Ti{~;, :))
().~jOCC
and
\\"l'
sec that tbe rool of the Jlllll1craloJ pulynomi;l! is the same a" one of the
nl(l!s
of the de
nOlllinalor p()Jynomial.
Sec. 10.3
255
Input 2
The numerator and denominator polynomials relating the second input to the two outputs arc found using the following command:
[num,den]=ss2tf(a,b,c,d,2) num : : :
o
0.3000 2.5640
0.2717
o
den
o
0.6792
1.0000
,tnd we have the result that;
v,(s) y,(s)
( )
1/
0.3 s
( )
I ().t,7 ')7l) 1/, s _
+ 2.5640 s
The relationship between the second input and the second output is particularly interesting. The secoodinput has no steadystale effect on the second output, as can he seen from the final value theorem. Assume a step change of magnitude !YJ.u z in input 2.
y(t,
~) =
s yes ) 0)
10.3.1
y,(s) =
(.I'
constant form:
y,(s)
.I'
256
2 ,     1.5
Chap. 10
y,
:;,..,
0.5
o
0.5
1
0.5
time
1.5
FIGURE 10.1
or,
 0.6759 y,(s) = 0.4417 s + I LI,(S) 1.6897 y,(s) ~ 0.4417 s + I fl,(S) The step responses for a unit step input change are shown in Figure 10.1.
0.4
y,
0.3
2:
"
0.2
0.1
10
15
20
FIGURE 10.2 Unit step change in input 2. Notice that the steadystate value of Y2 docs not change.
Student Exercises
257
Dum
0 0
d.en
0 0.3000 2.5640
0.2717
o
0.6792
1.0000
[y,x,t]=step(nuffi,den)
plot(t,Y)
SUMMARY
We have shown how to converl a statespace model to a transfer function model, for IllUItiple inputs and outputs. We have also seen some interesting results regarding polezero cancellation. One has to be particularly careful with polezero cancellation if a pole is UIlstable (positive), as will beshowll in Section 11.3. The following MATLAB routines were used:
ss2tf:
eig: roots:
converts state space to transfer function form matrix eigenvalues roots of a polynomial
STUDENT EXERCISES
1. Compare the step responses of the following three transfer [unctions: 1 a. gt(s) ~ (0.4417 s + 1)(3.3333 s + I) 1 b. g2(s) ~ 0.4417 .\' + I c. g,(s)
.
~
1
3.3333 s
Which has a faster step response? Why? 2. Consider the following statespace model (a 5stage absorption column)
258
Chap. 10
A=
0 0 0 O. I25 0.325
B=
a. Convert this model to transfer function form, assuming that all of the states arc outputs, using ss2tf.
b. Find the response of all of the states to a unit step in input I. Usc the fUllction
step. c. Find the response of all of the states to a unit step in input 2. Usc the function step. d. Compare and contrast the curves from band c. 3. Consider the following model f()f an isothermal CSTR with a single ltTcvcrsi ble reaction (sec Module 7). Find the transfer function matrix relating bOlh inputs to both
states.
I
4. I"or a
dX,] ai dX2 dt
OA = [ 0.2
~ O.2IU + 1 0.5
O'
x,
0.5
0.211'//'.1 o
II)
2~state, singleinput, singleoutput process, derive the relationships shO\\1l in (10, I 8) and (10.19).
5. For the following statespace model, find the transfer function matrix rcl'llill,!.! all
four inputs to both outpulS,
A=
OA
I3 B_[0  SD
4.5
D.3.1
D.l
7.5
1.5
C= [Io
Student Exercises
259
at
III
=
_ 1
10
OJ 1 2
[\,1 + [
\,
7 ] 2 25
II
}'::::: x 2
Show that the eigenvalues of the A matrix are liS and 112, so the system is unsta~ hie. Also, plot the step response. Derive the transfer function relating u(s) to yes) and show that the unstable pole is cancelled hy the positive zero. This problem will be analyzed in more detail in Chapter 11. 7. Consider a chemical reactor with bypass, as shown helow. Assume that the reaction rate (per unit volume) is firstorder (r = kC 1) and C 1 is the concentration in the reactor (the reactor is perfectly mixed). Assume that the volume in the reactor (V) and the feed fJowrate (F) remain constant. The fraction of feed bypassing the reactor is (l ~ a)F and that entering the reactor is of. Assume that the fraction bypassing the reaclor docs not change. 'l'he inlet concentralion (C in ) is the input variable and the mixed outlet stream composition (C2 ) is the output variable. Write this lllodel in statespace form, using deviation variahles.
x':::AxIBu
y=Cx+Du
F
(X
(1_(<)
C,
C2
If
to y.
minI.
260
Chap. 10
8. Consider the follmving set of series and parallel reactions (from Module 7)
A+A~f)
kj
Material balances
OIl
k = ' 1nio' I 6
'i
.1
Itllll
k,
liters
6 mol min
and the steady Slate feed and reactor concentration of component A arc: III
IlHl]
liter
CA\
. liter
mol
a. Find the steadystate dilution rate U/V) and concentration of (shO\v all unih). h. Linearize and put in statespace form (find the numerical values of the A, B, and C matrices), assuming that the manipulated variables afC dilution rate (FIV) and
d. Find the transfer functions relating each output to each input. Find the poles and
zeros for each transfer function and make plOlS of the responses to unit step changes in each input. Comment on your results.
BLOCK DIAGRAMS
11
The objective of this chapter is to introduce block diagram analysis. After studying this chapter, you should he able to: Analyze the stability of a block diagranl system.
cancellation.
Write a set of differentia] equations to simulate systems modeled by transfer fUllctions in series.
sE~ries,
paral1(~1 J
Systems in Series
Blocks in Parallcl
11.5
11.6 11.7
Feedback and Recycle Systems Routh Stability Criterion Applied to Transfer Functions SIMULINK
t 1.8
261
262
Block Diagrams
Chap. 11
y(s)
FIGl'llE 11.1
~cntatlun.
\\'\, han: shown 110\\ Laplace transforms (irc Llsed to reduce differcntialcljuatiollS to algehraic l"clatiullships. Algehraic equations arc mllch casier to Irlanipul ethan difrl'rt'l1liall~qll{\tiol1s. Similarly, hlock diagrams allO\v us to easily Illanipu . complex modds that ,Ire cumpo...;cd of subset'; of simple illudels.
1ll()(k~l:
!lr(i)
!II
r(l)
11(1)
( I I. I I
r(s)
g(s) 11(.\)
( lUI
g(s)
'TS+
( 11.31
engineers usually try' ,1Ilel solve problems b) 'iketelling diagrams to undC)";,lal1d rL'1iltionships. Process control engineers usually lise block diagrams to urllkr.:;lllIJ the illpu["output relation"hip" in a dynamic system, A block cli,lgrarn represcntation \1!'(11.2)isshowninFigure 11.1. \\\~ can sec that II(S) is tIll' input to the trallsfer functiun block <lnd yes) is the output i'i(lillthc transfL'r function block. Block. diagr,un" \vill he particularly useful \vhell analyzing \'ulllpkx dynamic sy'slellls. which may be represellted as hlocks ill serics or parallel and 'illl kedhack. Tiley are particularly,' mcful for feedback cOI11rol Sy"tClll design and analysis.
!'!'()CCSS
lilpLiLOUlpUI
shown ill
u(s)
.~I
FIGliRE 11.2
9, (5)
2(5)
~I
9, (5)
If.
"""'5.
Y(5)
Sec. 11.3
PoleZero Cancellation
y(s)
or,
g,(s) z(s)
cO
y(s)
where:
g(s) I/(s)
( 115)
g(s)
c=
g,(s)g,(s)
(Ii,.)
and
( 118)
g(s)
where:
( 1191
1<,1<2
'rhe same idea can be continued for any Dumber of transfer functions in series. The ~~;tl!~ dent should notice that the poles of 1.1 system composed of many lran:':lfcr functions in series arc simply the poles of each transfer function. This leads to the following conclusion about tbe stability ofsysfems lvi/II tran.~ler.fllnctirms in series:
If([ system is composed (?(traJl.~r('rli/ll('ti()lIsin series, (llId ifal! r?!'t!wse tralls(cr/il1l(,t;o/iS (/ie s/(/ble, then the overall system ;,<, stable,
Also, the 7.eros of a system or transfer functions in series are simply the zeros of the inchvidual transfer functions.
11.3
POLEZERO CANCELLATION
Again, in this section we consider two blocks in series, as shown in Figure 1 J .2:
y(s)
Oc
g,(s) z(s)
(1l.IO)
264
Block Diagrams
Chap. 11
If WC ;lre not careful. we Gill O\t'rIUUK possihle prublems \\ith sy'>lCllh in scries, if \\c look onl> at the u\'crilil input/output rclati()lhiJip. 111 the Ile\! cX<JI11pic \\c slw\\' problems
\\jtll f)ofL <em ('(f!lcellu{ioJ).
EX"'IPLE 11.1
Cu[]sidt'f the' follO\\illg lead/la~ in s(Tic" \\ itll <111 L11l.\['lhk' firstorder' ": :'lCllI
2.\
g:(s)
).,
I I
(11.11 )
2\ 
( Il.l .2)
'I 1/(\)
"1'(,\)
g{i) 11(\)
II(S)
I I I _~ )
(l
ph) "iedl j!iH,II11('tCI'S <.'annul hl' kll(1\\'ll pnl't~(11) Whal tillS I11C,II1S h Ill,]l gt'll(~r(lll) the 1l1l111Cf<.llu]
llf g (\\ \,ill I1Pl ('\;It:ll) cmCc'l the dCllOminatur of g~(sl. in pr:lctin'.
COllsjtkr II n:ali:li . . . (,;dSI:\ \\ h.. . re .t.':(si ha) ,[ sl,iglH t:rrOl in the \'alul' (If till' poll'
t;,(s)
I  :U)()O!l ' I
ill 14)
thell \\ C
find
thdl
2\
I'{s)
.:.()OUll
.:\
I (),()Ons\~
I J
I I ~I
nnt
11d\<"
pnfcd p\lkllt:n\
Cdlll..:l'llilIHlIl.
\(J
thnc
thc 1\\0
11HldL'I\ I 11 1J) dllt! ( I 1.1,"'\), LCl II (\ ) I"cpl"CS,'lll lhl: (lutpul ill ( 1 I.I,~I ;\Ild \'JI) rl']1rL'~cnt tile \lUl
11
I:' I
Ill.
I I I 1(1)
\(5s
I)
\'(1)
111 17)
Sec. 11.3
Also,
PoleZero Cancellation
265
y,(s)
s(
~I (J.60lJSs' :;:
2\'
+]
2.9999s + I)
(lUg)
y( t ) " I 2
7 e'/5 7.(JOOl
er/2.(l{)(Il
(11.l9)
and we call sec that, at low t, (ll.19) is almost identical to (11.17). As time increases, however, the unstable exponential tcrm in (11.19) begins to dominate. This is shown dearly in Figure 11.3.
Y1' stable
0.5
0.5
10
time
15
20
25
FIGUREl1.3
Comparisollof(11.17)and(1119).
Note that if we had used the statespace form for the model represented by equations (ll.JO) through (Il.J 2), we would have discovered the instahility, cven for the perfect parameter case. The following example analyzes the statespace form of l~xamplc 11.1.
EXAMPLE 11.1
Refer to z(s) as the output of the lead/lag block. FrotH Chapter 8 we find the following statespace realization of the lead/lag:
dx
dt
z;::~
'Trt
x+'T!'u
'T(/
266
Block Diagrams
Chap.11
T"S
T,t\
+ [
5s ~ . I
dl." dl
, so:
)
,\
+
2
II
7
)
II
(11.20j
(11.2 J)
dv
dl
Suhstiturill12 (11.21) into (11.22). we find
I ,
\'
dy
I
\'
dl
rf we usc notation
III
II
( 11.23J
r 1 :=:.\
Xl
c::;;:
\\c can \\rile ( II 20) and (11 2J) in the following form:
dt j
dt dx.
5 2 x,
I 10
Xi
7 5
II
(1 J .24)
dl
Using the usual :,talcspace notation:
II
( 11.2'1)
Ax
Bu
Y
\Ve \tTlle
(.'
xl l) u
(hi
dl
:"
I I()
dx,
1_ dl
~]i:' I
I
( Il.2hl
II
1 J
\\it' c<lsily' find Lhat the eigenvalues of the /\ matrix arc 1/5 and Ill. The positive eigenvalue in dicatcs thatlhis S.ySlCJll is llllst;\hlc.
Sec. 11.4
Systems in Series
267
The previous example illustrates the importance of not cancelling an unstable pole with a righthalfplane zero. It also shows how slalc~space analysis can always be used to address the stability of a system.
11.4
SYSTEMS IN SERIES
The dynamic behavior of chemical processes can often be represented as a scries of simple models, such as firstorder transfer functions. As an cxmnplc, consider the following process, which is characterized as II firstorder processes with a gain of 1 and a time conslant of 5:
(I 1.27)
The step responses for 11 I to 5 arc shown in Figure 11.4. Notice the characteristic Sshape for all orders greater than 1 and the additional lag associated with each higher order.
11.4.1
Although we analyze processes lIsing transfer functions, to obtain time domain responses we must usc a IllHllcrical integration package. Consider a system of II firstorder processes in series, as shown in Figure! 1.5. IJere we write the sct of ordinary differential equations that describe this process.
dl
T,
Xl
k,
T,
( I 1.28)
1
(53 + 1)'
o~L.L~~~~c::::':::c::::l o 5 10 15 20 25 30
time
FIGURE 11.4.
268
Block Diagrams
XILlS)r'XIL(S)
gutS)
)~S)
FIGURE 11.5
n processes in series.
Notice that we can think of the output of the first process as the input to the second
process:
x)
72
+ 7 z X'
2
( 11.29)
To solve (Il.28) through 01.30) we can lise the numerical integration techniques developed in Chapter 4 or the analytical expressions developed in Chapter 6. We can also write (11.28) through (! 1.30) in the following statespace form:
dX j dt dx z dt
1
T,
0
1
T2
0 0
1
0
0
x,
x2
,
u
( 11.26)
T,
k2
T2
dX n
dt
0 0
0 0
Tn
0
X"
Tn

dX n
kl/
Tn
,Ii
X"
0 0
In Example 11.2 we show how to usc the MATI,AB routines series and conv to find a transfer function that represents two blocks in series.
EXAMPLE 11.2
where:
g,(s)
~
1.5
2, + I
,2
3 (s)  4s +
~
g(s)
g/,) g,(s)
Sec. 11.5
Blocks in Parallel
(0
269
enter the numerator and denominator polynomi
We use the following MATLAB commands als for each transfer function:
numl
>:> denl
[1.5]
[2 1]
num2
den2
[3];
[4 l];
the series command generates the llurucrator and denominator polynomials for the transfer
function g(s):
0 4.5000
den : : :
8 6 1
M(s)
4.5
gs~
0
1 6s 1 1
cony
cony is llsed to multiply two polynomials. Using the previous example, we multiply the numerator polynomials to find:
num
den
~
den
861
11.5
BLOCKS IN PARALLEL
Sometimes the behavior or a chemical process can be modeled by transfer functions in parallel as shown in Figure 11.6.
270
y, (5)
Block Diagrams
Chap. 11
9, (5)
+
u(s)
Y(5)
+
9, (5)
Y2 (5)
FIGLREI1.6
System"
In
parallcl.
\\'C
can
\\Tite
\'1(.1)
+ Y:::(.I),
(II ,I)
{1112}
or,
1"(S) \\'here:
g(s) u(s)
{ I I .11}
( 11 ,3~1
gl(s)
and
g2(s)
'loS
+
( II,ft)
1
so
g(s)
TjS
fl..
(1117)
\\'C
find:
(] J
.38)
kiT,s
I)
',I
1) (T,S
( 111'))
I)
5ec.11.5
where:
Blocks in Parallel
271
" ",
~
I 1<2
j
(I lAO)
T"
",
We will assume thallhc transfer functions gl(s) and g2(s) arc stable, so Tl and T2 >, O. The goal of this section is to show a system where inverse response (discussed in Chapter 9
",
k2T l
"2
(I IAI)
and Example 9.3) behavior can occur. 11.5.1 Conditions for Inverse Response
Recall that a transfer function will have inverse response only if there is a righthalfplane (positive) zero. Since the zero is "117/1' this system will have inverse response only if Til < O. We find that Til <:; 0 only if k j and k2 are of opposite sign. We can arbitrarily assume that k 1 :> 0, which means that k2 <: 0 is necessary for inverse response. For inverse response, the condition:
means that
or,
kl
+ k 2T l <0 + k]
", + ",
"
<:
", + ",
kzlk[ for
m~
in~
Physical examples of systems with inverse response include: steam drum level, rcboilers in distillation columns, chemical and biochemical reactors. A reason that inverse response behavior is important is that it creates tremendous challenges for tight process control. We can usc theMA'fLAB routine parallel to simulate lwo systems in parallel, as shown by the next cxample.
EXAMPI,E 11.3
Considcr Ihc following systcm of (wo firstorder processes in parallel (Figure 11.7):
g,(s)
2 5s +1
272
8,(S) 
Block Diagrams I
lsi 1
f
Chap. 11
g(s)
1
Is
5s +
+1
[2] ;
num!
denl =
[5
[~lJ;
1];
num2 
den2
[1
1];
[num, den]
;0:
parallel (numl,denl,Ilum2,den2)
nulU =
0 3 1
den
5 6 1
[y,x, t]
stE~p(num,c1en);
[yl/xl]
sLep(numl,denl,t);
[y2,x2]
step(num2,den2,L);
p1ot(t,y,t,yl,t,y2)
2
y,
y,
10
15
20
25
30
FIGURE U.7
added together.
..__
Sec. 11.6
273
This previous example has shown that inverse response occurs in systems where the gain of the "s(ow process" (larger time constant) is larger in magnitude (but opposite in sign) than the "fast process" (smaller time constant).
11.6
yes)
but and So we can write (11.44) as:
g lv) /1.(.1')
(I 1.44)
1/(.1')
~
~
(l1.4S)
(I 1.46)
z(s)
yes)
Solving for .y(s) we find:
( 11.47)
yes)
Notice that we can view this as:
(11.48)
y(s)
where
(I 1.49)
(11.50)
g,(s)
u(s) r(s)
+ +
~
g (s)
1
I
'
z(s)
g2(s)
f4FIGURE t 1.8
Feedback diagram.
274
Block Diagrams
Chap. 11
r(,)
+ +
u(s)
g (,)
1
y(')
L....
z(,)
gz(,)
f
r(s)
..I_g_cl(_S).JI.
y(S)
Equivalent block
and we know that if the poles of gcl(s) arc stable, then the feedback system is stahle. \Vc realize that the two block diagrams shown in l'igurc 11.9 arc equivalent.
EXAiVlI'LE 11.4
Feedhack syst('Jll
(11.51 )
k2
'2S
_of
( 11.52)
glv)
1i,(s)Ii,(I)
I I)  k,k)
,
I)
k1k!)
('1T,S2 1 ('I
'2)sl
(11.5.1 )
and Xd(s) is stable if the roots of '1'2S2 + ('I] + T2 )S + J  k 1k 2 arc stahle. We recall frum the I{outh stahility criterion that aJi of the roots of a quadratic polynomial afC negative if the l'oelli cients of the polyllOlniaJ are positive. If we assume that 'I and 1"2 arc positive, then (11.53) will be stable if I k1kz is positive. For stability, then, k 1k 2 must be less than I. [,d's consider the folJowing IlUinerical example:
Sec. 11.6
275
g,(s)
k]
lOs 1
Since k l ;;;;; 2, then k 2 must be less than 0.5 for stability. As a Ilumerical chc(k, lei k 2 :;;:; ~ I. Solving for the roots of
T1lzS l
(T I
+ 7))S
j
k/<2
we find
50."J + 15s1 3
which has the roots (using the quadratic formula)
 0.151 0.1936j
(we can verify this result using the MATLAB routine roots) Since the real part of the rools is negative. the system is stable. This is verified in the MA'rLAB simulation presented in Figure I J.I 0, where the response of the output to a unit step change in r is presented.
1.2
0.8
'"
30
40
FIGURE 11.10
We can also Lise the MATLAI:3 feedback function to obtain the closcd"Joop transfer function, as shown below.
2
5s
I lOs +
276
numl ] ;
Block Diagrams
Chap, 11
den]
[5
1];
"
den?
''
1I ;
[nurn,c]cn]
den
S (j
'\)v'l'
T ')
11.7
determine if a
277
RouthArray
rf all or the coetlients or the characteristic equation (11.54) are positive, then develop the following ROllth array:
Ro\v
I
an
{fll_!
(In __ 2
(ln4
(111_ )
2
3 4
J/+I
an
172
(;2
3
", '"
h3
where 1/ is the order of the polynomial. Notice that the first two rows consist of the coefficients of the polynomial. The clements of the third row arc calculated in the following hlshion:
({n2 {In __ ]
a/PII
(lll_'_
and so on.
[~lcmcnts
and so 011.
A sufficient condition for an rools of the characteristic polynomial to have negative real paris is that ali of the elements in the first colunm of the Routh array arc positive.
yes) or,
yes)
where:
g,,(s) res)
g,(s) I  g,(s)g,(s)
278
And the trails!''')
fUlll'llOJlS
Block Di8grarns
are:
Chap. 11
( )S
I )(1,
I)
A
lOs
Our g(lal h ((i rIml k, til (lSSUrl' __ lahility nl the clnscdluup We e:lsil) find the traw,fci l'ullclinil. gi.\):
g(s)
s~'.tl'1ll
"111h
( I50s'
9).\"
I}
ISs ~
2/,;,)
lSs
?k,
of the rlmn
150
IN I
,
4
rile
\)5
2L
1>1
cl
ilCCC,I.\UrI
II
C()I1c1lliull is that all (II > n, Ilhidl is sari'Jit'd if J  2k, > 0, u!" k, ().:'i. 'I'll(' sufficient conditiull is s<lli:Jiec! d' all uf the cudfkiClIl' in till' fil\( ('Ohllllil (\1 111<.' Routh array arc pmitilt'.
(u/

h
hi
1."1
1/,11"
a
(1,,
IX
ISO
90

II
2k ,)
II
a)) ,
(III
hi
2k
II
\(lillt'
The hi l'lillditioll is satisfied if k~ > :=;) while the ('I cUlldlljOI] is the ditioll. \Ve then kl\l? the folluv,'illg rcstrictioll on k, fur st;lhility'
5.2
0.5
11.8
SIMULINK
III the prC\ious sections \VC 11;\\c shown hO\\ \1XfLAB routines can be' usnJ for hlod; dl agr,iIll analysis and simulation. The ohjeetJ\"c of this sectirHl is to Lise the bind dl<l~rall1 simulation features 01" SIMULINK.
Summary
279
Clock
time
ffj
Step input
;=;G~sI~
.J'J
output
g2(s)
FIGlJRE 11.11
Consider the block diagram system from Example 11.3. A SlMLILJNK block diagram is shown in l~'igure 11.1 I, Notice the use of step, transfer function, sum, workspace and clock blocks to generate the nccessary input and output information. The parameters menu is used to specify the intcgration type (L1NSIM), final time (30), and minimnll (0.01) and maximum (I) step sizes. The results arC the same as shown in r'igure J 1.7. More information on SIMULINK is provided in Module 4 in the final section of the text.
SUMMARY
Block diagram analysis is irnportant because it allows us to think about a system of processes in terms of a cOlnbination of the individual processes. We have shown how to analyze the slability of a bloek diagranl systelll, particularly if there are recycle or feedback processes. \Vc have shown how inverse response processes can arise from systems in paralleL We have also shown potential problems with polezero cancellation when analyzing transfer functions in series. The following MArLAR routines were used:
series:
two models in series (either transfer function or state space) multiplies two polynOinials two models in parallel (either transfer function or state space) two models in feedback form (either transfer function or state space, and either positive or negative feedback) find the roots (zeros) of a polynomial
280
Block Diagrams
Chap. 11
STUDENT EXERCISES
1. Consider a firstorder process that has a positive pole (Ilcgati\c tilne co]]stant). indicating that the process is openloop ullstahle.
5s +
It is desirable to design a feedback cOTnpcnsatOJ g2(s), so that the feedback systl'rn is stable. Assume that g2(S) is simply a gain:
A'~(s)
J,:,
Find the range of gains that \vill make the following feedback system stable.
u(s)
r(,)..~
g (s)
1
y(s)
,(s)
g,ls)
c.
k
)'OUT
Find the values or II. (if allyl that \vil! ensure stahility of the system. Shmv and explain y'our reasoning.
u(s)
wurk
r(s)
g (s)
1
y(s)
z(s)
gz (s)
r.
3. Find the analytical solution for a unit step applied to the following process:
ge,)
(5.1
1)'
Student Exercises
281
u(,)
r(')
+ g (3) +
1
g2(3)
Z(3)
I
Discuss how the values of k2 and 1'2 effect the dynamic behavior of y with respect to a unit step input change in r. Use SIMULfNK and show compare plots for various values or k 2 and 1'2 to illustrate your points.
12
One purpn;c or thi" chapter i\ to summari/c the technique'> LhaL ha\c been dnelc)pcd ill Chapters:) through I I to :,ol\c lincar ordinary dilfCfl'lltial equation;.,. Since the focus 11:1" beell on initial \;due problems. \Vc also intrntlucc techniques to soh'C huundary \U]Ul'
()[)I:: problems ..Also. since the emphasis has hCl'll on cOlllinoLls (dilTncJltial equatiun
h<lsed) rnodcls. dJlothn objccti\c is to introduce discrete IllDdcls. ,After Slutly'ing tIlis chapter. the student \llOUld he able to: Lsc till' prublclllS
dl~Haclcri"'lic
di~crcte
time mo(\eh
12.1 Background
12,2 Linear Boundar) V<lluc Prublcms 12.3 Rc\ic\\ of \kLhods for Linear Initial Value ProlJ!cms 12.1 lntruduction lo
Discrctc~
rime i\lodcls
282
Sec. 12.2
283
12.1
BACKGROUND
Thus far in this text, all of the problems that we have solved have been initial value ordinary differential equations. '1'0 solve these problems we simply need to know the initial values of the state variables, and how the inputs change with lime. The models arc then integrated to find how the states change with time. Ordinary differential equation models may be constrained to satisfy boundary conditions. Boundary value problems often arise when solving for the steadystate behavior of a dynamic system modeled by a partial dif~ ferential equation. 'T'ypically, a boundary value prohlem has distance as the independent variable and the boundary conditions lhat must be satisfied are tbe values of the state vari~ abies at different locations (typically at each "end" of the system). Recall that in Chapter 11 we required ninitial conditions to solve an nth order initial value ODE. Similarly, we require n boundary conditions to solve an nth order boundary value ODE. Most chemical processes that can be modeled as secondorder boundary value problems (e.g., the reactiondiffusion equation) arc twopoint boundary value problems. A secondorder split boundary value prohlem has a boundary condition at one end and another boundary condition at the other end. If both boundary conditions were at the front end, then our problem would be an inital value problem. U' both boundary conditions were at the rear end, then we would have an initial value problem by simply redefining the independent vari'lble and forming an initial value problem in the opposite direction. In this chapter, \ve first cover linear boundary value problems in Section 12.2 and review methods to solve linear initial value problems in Section 12.3. We provide an introduction to discretetime models in Section 12.4 and show how to estimate parameters for discretetime models in Section 12.5.
12.2
+ aox
( 12.1)
where 1 0 _ at and 02 arc constant coefficients, _r is the state variable (dependent) and the independent variable (often distance). The solution to (12.1) will have the form
z is
( 12.2)
A+
an
( 12.3)
llsing the method discussed in Chapter 6. The constant coefficients (e J and ( 2 ) are obtained [rom the boundary conditions.
dx
dz
7 x 4
( 12.1.1
x(z
0)
( 12,)) { 12,hl
x(z=I)=1
We solve for the eigenvalues by using the characteristic equation:
A'
4A
+ : _.
( 12.7)
AI
A, (lilt!
3.5 0.5
(J 2.SI
( 12.91
Substituting the boundary conditions results in two equations and two unknowns: 2
=
c1
j
c;~
( 12111
I (2 eO' S
C e:1.S
(12, J 2)
which yields:
C 1 ""
0.36968
",  1.63032
A plot of the solution, x:;:;; 0.36968
2
e 35z
1.8
1.6
1.4
1.2
1
0.2
0.4
0_6 z
0_8
FIGURE 12.1
Sec. 12.2
285
More generally, the boundary conditions may consist of some function of the state variable and its derivative. The more general linear boundary condition is the form:
dx ",
dz
I<"ox=d
EXAMPLE 12.2
+ 4x = 0
subject to the new houndary conditions,
dx
(124)
dz
+x=1
al z ,. 0
(12.13)
dx
dz
Since the solution is:
=0
at z
(12.14)
( 12.15)
dx
elz
and boundary condition (12.13) yields:
(12.16)
3.5 C j e '5
Solving these two equations for c 1 and
c2'
0.5
('2 CO,')
(12.IX)
0.37394
(12.19)
286
which is showll ill Figure 12,2.
0.1
Chap. 12
o
X;
0.1
0.2
0.3
0.2
0.4
0.6
0.8
z
FIGURE 12.2 Solution to Example 12.2.
We have illustrated how the method of characteristics is llsed to solve lincar bOllndar) value problems. 'rhe solution to nonlinear boundary value problems generally in\'llIH':' it
crativc methods. For example, consider a single secondorder nonlinear problem \vitll
boundary conditions at each end. 'We know that the secondorder equation can be COI1verted to two firstorder equations. Typically, one boundary condition will fix an '"inititd condition" for one of the states. A second initial condition can be iteratively guessed (lising a QuasiNewton method, for example) until the equations, when integrated. yield the correct value for the end boundary condition. This approach is shol,vn in l~xalllpl(' 12.,~ for the linear system considered in l':xamp1e 12.1.
EXAiVlPLE 12.3
Consider the
valuc problem:
7
4
with thc boundary conditions:
x(z x(z
~
cc
x~O
( 12.11
0)
( 12.5)
(12,61
xl'"" X
1)
It can be shown that (sec student exercise I), by defining equations arc obtained:
Sec. 12.3
287
( 1220) (1221 )
X, (2
0)
( 12.22)
We sec that \"2(2"" 0) must be "guessed," then the two equations can he integrated from z:::;:; 0 to z cz J. The value of x I at z:::;: I is then checked; if x I (2 ;;;:; 1) is not equal to I (within an acceptable tolerance) then values of .:r2(z ;:;;: 0) arc iteratively guessed until the final value is satisfied. This method is known as the "shooting method." 'fhe reader is encouraged to llSC this approach to
solve exercise I.
12.3
x=
f(x,u)
(12.23) (12.24)
y ~ g(x,u)
where x is a vector of n state variables, u is a vector of m input variablcs, and y is a vcctor of r output variables:
.:\:/I
YI c~ gj(xl"",xn,uj"",utI/)
12.3.1
Linearization
288
Chap. 12
() .. II
_rJg'l
allj
X"II,
where X,I" H,I" and Y.I, represent the steadystate values of the states, inputs, and outputs, which solve:
() =
f(x"uJ
( 12.25) ( 1226)
y, = g(x"uJ
After linearization, we have the state space form:
x'
= A x'
+ B u'
+
Dn'
( 12.27)
y' = ext
where the deviation variable vectors are:
X' =
II'
(J2.2n
x  x,
U ~ II
( 12.29) ( 12.10!
Generally, the (') notation is dropped and it is understood that the model is in deviation variable form:
x=Ax+BII y=Cx+DII
Once the model is in this form, a number of techniques can be used.
(12.31)
(\ 2.32)
12.3.2
3.
x(t)
= e A'
x(O)
Vl
( 1233)
= V
eAt
(12.14 )
The MATLAB function for matrix exponential is expm. b. For a constant step input at time zero (Chapter 5):
X(I)
( 1235!
c. For inputs that are constant over each time step (from t to t + Cit) (Chapter 5): x(t + !J.I)
which is often written as:
(1216 )
Sec. 12.3
289
( 12.37) model, which is
x(k
+ I)
o. e AM x(k)
+ (e A "'  I) A
B u(k)
where k represents the ktll time step_ This represents a discussed in more detail in Section 12.4.
discretc~timc
12.3.3
Rewrite the StateSpace Model as a Single nth Order Ordinary Differential Equation
+ ... +
by first writing the characteristic equation:
all
dx
(lJ
tit +
u() J:
==
( 12.38)
All
{In_1
AIl 
+ ... + G 1 A +
al! = 0
( 12.39)
and solving for the roots (eigenvalues) of the nih order polynomial. 1f the roots arc distinct, the solutionis of the form: ( 12.40) where the coefficients arc found llsing the n initial conditions. h. Solve the nonhomogeneous problem using the method of undetermined coefficients (Chapler 6):
dnJx
J "",,, J
dx
rt
+ ... +
ii,
 .f
+ ""x
f(1t(t
(12.41)
using 11 threestep procedure, i. Solve the homogeneous problem to Find: (12.42) ii. Solve for the particular solution by determining the coefficients of a trial function (see Table 6.1, Chapter 6) that satisfy the nonhomogeneous equation:
xl'(t)
iii. Combine the two solutions for:
(12.43)
x(t)
~"
Xf/(l) + xl'(t)
( 12.44)
c. Use Laplace transforms to solve the nth order equation (most useful for nonhomogeneous equations) (Chapters 71 I): (1245) which corresponds to the differential equation:
290
Chap. 12
(12.46)
= b/I dtll
dllu
b III
(12.48)
For physically realizable systems, b ll = 0, Onen many of the leading hi terms arc zero. If the leading r terms in the b polynomial arc zero, then the systcnl is referred to as relative order r.
12.3.4
Previously we have assumed that: the statespace model has already been converted to a single nth order differential equation. We can also transform the set of n firslordcrlincar state space equations directly using:
( 12.49)
Generally, the Laplace transforms technique is used for nonhomogeneolls problems, that is, systems that have an input forcing function (such as a step).
12.4
l1
.
_~XJ!
.
_nhlll
or,
x~~Ax+Ru
(1231 )
Sec. 12.4
291
x::;:ax+!Ju
( 12.50)
(12.51 )
In a similar fashion, the solution to (12.31), for a constant input (u(t):::: lI(O fronl 0 to tis:
X(I)
where:
( 12.52)
(1253)
and
G = (t/>I) A 'B
( 12.54)
Equation (12.52) can be used to solve for a system where the inputs change from time step to time step (t to t+6.1) hy using:
X(I + AI)
More often this is written as:
tP x(t) +
u(t)
( 12.55)
x(kc I)
tI' x(k)
+ "u(k)
(12.56)
where k represents the kth time step. The output at tillie step k is written:
y(k)
C x(k) + D u(k)
( 1257)
The stability of the discrclcstatcspace model is determined by finding the eigenvalues of (J>, If the magnitude of all of the eigenvalues is less than I, then the system is stable.
12.4.1
Continuous time models transfer function models arc characterized by the Laplace tranform variable, s. Similarly, for discrete transfer function models, a discrete transform variable, 7., is uscd:
Y(z)
where:
c.c
G(z) U(z)
( 12.58)
G(z) =
IC (zl A) 'n
+ DJ
(12.59)
f,'or the case of a single input""single output system, (;(7.) consists of a numerator and denominator polynomial of the form:
g Z
.( ) = bnz
anz
lJ
Ii.
+ +
bl/_Izl(
ali jZ
II
I I
( 12.60)
292
Chap. 12
;1.
The transfer function is normally written in terms of the bachvards shUt operator, Multiplying the transfer function by Z'II/tII , we find:
+ hoz n + {loZn
The backwards shift operator is defined as;
(1261 )
y(k ~ 1)
so y(k ~ 2)
:=
= z' y(z)
1
( 12(2)
[l.V(Z),
y(z)
then represents:
__. b ll t
f /, Zf{
+ ... + {lIZ'n
+
{l1l_IZ1 _2 1
f
. " __ 11 aoZ
t 1(") 4.
( 12(3)
(an
+ ... +
j
(ljZn+l
+ ((OZ'II) Y(2)
(hI] + b ll
+ .. +
I
btZlll1
( 12(4)
a"y(k)
=
+ a"ly(k ~ 1) + ...
I
""u(k)
h"o,u(k 1)
h"u(k
11
1)
( 12.(5)
Usually we arc solving for y(k+ I), and without loss of generality we call assume all :::; ].
y(k
=
I
1)
I
{["ly(k)
I
a,y(k
I
1)
I
{[oy(k
11)
( 12(6)
"ou(k +1)
"o,u(k)
+ ",a(k
11 ~ 1) + "ou(k ~ 11)
Also, for rnost systems there is not an immediate effect of the input on the output, so
discretc~til11c model
is fin..;torder:
~c
y(k
or,
I
1)
I
I/"y(k)
hol/(k)
( 12671
y(k + 1)
I/oy(k) + h"u(k)
y(z)
boz J
+ lloZ
( 126~)
Physically realizable systems will always have at least a z I factor (unit time delay) in the numerator. A firstorder discrete system with N additional units of limedelay is written
y(k
or,
+ 1)
I
I/"y(k) = hol/(k
N)
( 12N))
Sec. 12.4
293
y(k
I
I)
aoy(k)
I
boll(k N)
EXAMPLE 12.4
Consider a statcspace model from the isothermal chemical reactor module (specifically, the Van de Vussc reaction); A = 1 2.404R
0.R3:n
II
c~
 2.23Rl
7.00001  1.11 70
[0 I[
J)
1 ~I
(I) =0
For a sample lillle of 0.1 the discrete Slatespace model is (using (12.52)( 12.54), or the MATLAB c2d function):
r0.0661
O.7R63
0 1 0.7995
1'
6222 1 0. 0.OR49
and the discrete inpuloutpulmodcl is (using (l2.59), or the MATLAB ss2tL function)
g(z)~
 0.0751 z 1  I.oR57z
I I
I
I
which has poles of 0.7995 and O.7g63 (which have a magnitude less than J, sO the system is stable). The zero of the numerator polyllOll1iai is 1.3339. The step responses of the continuous and discrete systems arc compared inr'igure 12.3. For a sample time orO.?5, the discrete Slatespace model is (using (12.52) (12.54), or the MAfLAB c2d function):
(I)
n.1 k66
o ]
Chap. 12
05
04
o
S 0.3
continuous de It := 0.1
S o 0.2
0.1
0.
o
0.1
~~~~~~~~L~ _ _
2 time
FIGURI'; 12.3
,old
thl~
~3E;2tt
funClion):
g( z)
0.1564z
0.3513z
whidl has pole; at 0.1866 and 0.1647, indicating stability. The zero of the numerator polynomial
IS
15199.
A comparisoll of the step responses of the continuous and discrete models is ShO\Vll in Figure 12.4. Notice that the discrete sample time is too large to capture the "inverse respollse" hehavior of the continuous systelll.
0.6
05
0.4
S 0. S
0
0.3
0.2
0.1
0
0.1
2 time
FIGURE 12.4
Sec, 12,5
Parameter Estimation of
Discrete~LinearSystems
12.5
y(k)
(/,y(k  1)
1)
hO/(k
2)
(12.71 )
(IU2)
where,
Y~
Y(I).J
,
['1'0)1.'] 0 ellee
.
,
y(N)
<p(N) ,
. ", I [
: U o
hi bo
( 12.73)
<p(k)J
( 12.74)
.. ~ ~   ~ . _ ~   ~ ._ ~ ~ ~  ~ . . .
EXAMPLE 12.5
Parameter Estimation
D.I:;;:;
A unit step input is made to a system at time t::;: 0 (k:;;:; 0). The sample lime is response data are shown below and plotted in figure (2.5.
k
r(k)
o
I
0
0,1564 0.45l2 11,5513
2
3 4 5
0.5770 0.5830
296
0.6
Chap. 12
o
0.5
o
0.4
'5 J3.
0 "
0.3 0.2
0
0.1
o o
J__
__'__
.L_
2
sample time
FIGUREl2.S
1'(4) 1'(5)
y(O)
y( 1)
1/(0)
o
1/(1)]11(:)
IJ
y(4)
The solution is:
y(3)
u(4)
o
0.1564 0.4522 0.5513
hi
:::,]
[ ~:~~~]~]
0.1564
ho __
0.2409_
thal W:lS
which afC the same parameters that we found for the discrcle transfer function model converted from the contiullOU\' Illodel with a sample time of 0.75.
References
297
This sirnplc cxample illustrated the step response of a perfectly modeled system (no measurement noise). The approach can also be applied to a systenl with arbitrary inputs and with noisy measurements. The data was analyzed in a batch fashion, that is, all of the data were collected before the parameter estimation was performed. There are other approaches that are useful for estimating model parameters in real time, often using the model parameters to modify feedback control laws. These approaches arc beyond the scope of this textbook. The MATLAB System Identification Toolbox is useful for these types of problems. A good reference is the text hy Ljung.
SUMMARY
There were multiple objectives to this chapter. The first was to introduce analytical solution techniques for boundary value ordinary differential equations. The second was to provide a concise review of techniques to solve linear initial value ordinary differential equations. The final ohjective was to introduce discretetime modcls and discuss parameter cstimation for these models. For continuoustime models, the eigenvalues of the statespace model must have negative real portions for the system to be stable. Equivalently, the poles of the continu~ ous transfer function models must be negative (the eigenvalues of the statespace m(){icl are equal to the poles of the transfer function model). Analogollsly, the eigcllvalues of the discrete statespace model mLlst have a magnilUde less than one to be stable. Also, the poles of a discrete transfer function model must have magnitudes less than one to be stable. Continuollstimc input/olltput (transfer function) models with zeros that arc positive exhibit inverse response. Similarly, discrete transfer function models with /,cros that have a magnitudc greater than one (yet have a negative real portion) exhihit inverse response.
REFERENCES
The following text provides methods to solve houndary value ordinary differential equation models. Rameriz, W.P. (1989). Computational Methods j(Jr Process SimulatioN. Boston: Butterworths. Many process control textbooks provide coverage of linear discretetime models. Sec, for example: Ogunnaike, B.A., & W.H. Ray. (1994). Process Dynamics, Modeling and Control. New York: Oxford. System identification (model parameter estimation) is covered in the text by Ljung Ljuog, L. (1987). System NJ: PrenticeHall.
fdent{flcati()Il,~The()ry for
298
Chap. 12
STUDENT EXERCISES
1. Consider the following secondorder boundary value problem:
J!x
dz 2
where:
+ 4 dx +
tlz x(z x(z
=
7 x 4
.
0) = 2
1)
Show that, by defining x I ::::; x and 1:2::::: dx/dz., the following equations arc obtained:
dx,/dz
cc
x2
~
dx,/dz = ..
and that one of the intial conditions is:
7 4 x,
4x 2
We see that x2(;: = 0) must he "guessed," then the two equations can be integrated (using ode4 ~j) from? :::: 0 to ? :::: I. The value of x I at z ::::: 1 is then checked: if xIV:::: I) is not equal to J (within an acceptable tolerance) then value,,> ofx2L~ :::;: 0) arc iteratively guessed until the final value is satisfied. This method is known as the "shootingmclhod". Usc [zero to solve for the initial condition that satisfies the end boundary value.
2. Consider the reaction/dispersion equation
ac;\
iJl
let:
CA
C'AO
and: define:
y
'T :::
z
I,
D.,/{
I}
p =
"
/),,/
and:
k /,'
J),l7
II
to show that:
ilC
PI'
ilC
ay
(1221
Student Exercises
299
and:
dC" (L)
=0
dz
u. Perform steadYSlate calculations (analytically) using lhe Danekwerts boundary conditions for: i. P(':::;I, D II ::;:;:; I, 10, 25 (compare on same plot) ii. 1',.= IO,D o = I, 10,25, 100 (compare on samcplol) iii. Pe = 25, D(/ :::: I, 10,25, 100 (compare 011 same plot) iv. 1',. = 100, Do = I, 10,25,100 (comparc on same plot)
3. Consider the following continuous statespace model:
A 0'
3.6237 . 1 0.8333
5.50511
 2.9588
Ii=
I.
0
 1.2660
II
C . = [0
D
=
a. Find the continuous transfer function model. b. For a sample time of 0.25, find the discrete statespace and transfer function models. c. Compare the step responses of the continuous and discrete 11lOdcls. What do you observe'!
4. Consider a unit step change made at k:::: 0, resulting in the output response shown in
1.2
o
o o
0
c.;0
0.8
'5 50,6
0
0.4 02
0
_._.L
.1
20
40 60 sample time
80
100
300
k Y k
y
Chap. 12
0 0
II 10 9 7 8 6 3 4 5 2 0.3403 0.6105 0.8494 1.0234 1.1244 1.1616 1.1531 1.1184 1.0746 I.OJ3h
20 18 19 17 15 16 13 14 12 1.0023 0.9828 0.9744 0.9742 0.9790 0.9860 0.9929 0.9985 1.0022 Estimate the parameters for a discrete linear model with the fonn:
f
g(z) ~I _
boz 2
 ({oZ2
SECTION
IV
PHASEPLANE ANALYSIS
13
'rhe objective of this chapter is to introduce the student to phaseplane analysis, which is one of the most important techniques for studying the behavior of nonlinear systems. After studying this chapter, the student should be able to:
Usc eigeIlvalues and eigenvectors of the Jacobian matrix to dUlracterizc the phascplane behavior
Predict the phaseplane behavior close to an equilibrium point, hased on the linearit.ed model at that equilibrium point Predict qualitatively the phaseplane behavior of the nonlinear system, when there arc multiple equilibrium points The major sections of this chapter arc: (3.1 13.2 13.3 13.4 Background Linear System Examples Gcncralit,ation of PhasePlane Behavior Nonlinear Systems
303
304
PhasePlane Analysis
Chap. 13
13.1
BACKGROUND
Techniques to find the transient (time domain) behavior of linear statespace models \verc
discussed in Chapter 5, Recall that the response characteristics (relative speed of response) for unforced systems were dependent on the initial conditions. Eigellvalue/eigenvector analysis allO\vcd us to predict the fast and slow (or stable and unstable) initial COIlditions. If we plotted the transient responses based on a number of initial conditions, there would soon be an ovcnvhclming Ilumber of curves on the transient response plots. Another way of obtaining a fecI for the effect of initial conditions is to usc a pIUlS('~p/(/IiC plot. A phaseplane plot for a two~slatc variable system consists of curvcs of OIlCSUltC variable versus thc state variable (xl(t) versus xi!)), where each curve is hased on a dif~ fercnt initial condition. A phasespace plot can also be made for threestate variahks. where each curve in 3~spacc is based on a different initial condition. Phaseplane analysis is one or the most important techniques for studying the behavior of nonlinear systems, since there is usually no analytical solution for a nonlinear systcm. It is obviously important to understand phaseplane analysis for lincar sysll'!1E before covering nonlinear systems. Section 13.2 discusses the phaseplane behavior of linear systems and Section 13.3 covers nonlinear systems.
13.2
EXAJ\ilPLE 13.1
( 11.2)
[0
xl(r)
(13,4 )
5r.
Sec. 13.2
305
where xI" and x 20 arc the initial conditions for xI and x2' We could plot Xl and x 2 as a function of time for a large Humber of initial conditions (requiring a large number of time domain plots), hut the same information is contained 011 a pllaseplane plot as shown in Figure 13.1. Each curve corresponds to a different initial condition. Notice that the solutions converge to (0,0) for all initial conditions. The point (0,0) is a stahle equilibrium poiot for the system of equations (13.1) and (13.2)~thc plot shown in Figure 1:1.1 is often called a ,I'table node.
'1
:;::
(0,0) is a
EXAMPLEI3.2
X,
tl
X1 (1) xit)
=
(13.5)
4 Xl
l
(13.6)
'fhe student should find that the solution to (13.S) and (13.6) is:
= x lo e
(13.7)
(13.8)
x 20 e"l
The phase~plane plot is shown in Figure 13.2. If the initial condition for the x2 state variable was 0, thell it trajectory that reached the origin could be obtained. Notice if the initial condition x2(1 is just slightly different than zero, then the solution will always leave the origin. The origin is an unstable equilibrium point, and the trajectories shown in Figure 13.2 represent a saddle point.
306
PhasePlane Analysis
Chap. 13
The x j axis represents a stahle subspace and the Xl axis represents an unstable subspace ["or Ihi\ problcrn. 'l'he term saddle can he understood if you view the x J axis as the line (ridge) hct\\ccn the "horn" and rear of a saddlc. A baJJ starting at the horn could cOllceptually roll d(l\vn the sdddie and remain exactly on the ridge between the horn and the rear of the saddlc. In practice, d small perturbation from the ridge would calise the ball to begin rolling to olle "stirrup" or [Ill' other. Similarly, a small perturbation in the initial condition from the Xl axis in l~xal1lpk L\2 would cause the solution to diverge in the unstable direction.
Phaseplane plot for Example 11.2. The point xl' ::::: (OJ)) is a
Figures 13.1 and 13.2 clearly show the idea of separaticcs. A separatrix is a line in the phaseplane that is not crossed by any trajectory. In l<'igure J 3,1 the sepnF{/liccs are the C\lordinate axes. A trajectory that started in any quadrant stayed in that quadrant. This is he cause the eigenvectors arc the coordinate axes. Similar behavior is observed in Figure 13,2, except that the xJ coordinate axis is unstablc. Solving the cquations for Examples 13.1 and 13.2 and the phaseplane lrajccl(ll'il's were straightforward and obvious, because the eigenvectors where simply the cnordin,th' axes. [n general, eigenvalue/eigcnvector analysis must be llsed to determine the stahle dnd unstable "suhspaccs." The eigenvectors arc the separaticcs in the general case, Examplc 13.3 shows how eigenvaluc/eigenvector analysis is used to rind the swllie and unstable subspaccs, ,md to define the separatices,
Sec. 13.2
307
EXAMPLE 13.3
= =
2x 1 + x 2 2x l
X 2
( 13.9) (13.10)
i1
Using standard statespace notation:
x=
The Jacobian matrix is:
Ax
(13.11 )
1.5616
and the eigenvectors arc:
', t
,0.27031  0.9628
8719 0. 1 0.4896 1
Since A] < 0, ~I is a stable subspace; also, since 1.. 2 > 0, ~2 is an unstable subspace. A plot of the stable and unstable subspaces is shown in Figure 13.3. These eigenvectors also define the sepa ratit:cs that determine the characteristic behavior of the state tn~jeetories.
Unstable Subspace
Stable Subspace
FIGlJRE 13.3 Stable and unstable subspaces for Example 13.3.
308
'file lime domain solution to (13.11) is:
PhasePlane Analysis
Chap. 13
(JJ.12)
x(l)
V e'\' V
x(O)
(13.13)
X(I ~ )
0.2703 0.9628
(U~Tl91
Ie
LS(,I(,t
0.4896
('2.561(;/
 o. 81J72 1 x(O)
0.2782
if x(O)
_ I  0.9628
0.2703
Ithen
xt)=
( I
The phaseplane plot is shown in F'igure 13.4, where the separatrices clearly define the phascplane behavior.
FIGURE 13.4
Sec. 13.2
309
'fhe previous examples were for systems that exhibited stable node or saddle point behavior. In either case, the eigenvalues and eigenvectors where real. Another type of behavior that can occur is a spiral focus (either stable or unstable), which has complex eigenvalues and eigenvectors. Example 13.4 is an unstable focus.
EXA1VIPLE 13.4
lJn~tHhlc
=x l
2 x.,
( 13.15) (13.16)
x=
The Jacobian matrix is:
i\~
A x
 2
with eigellvalues I 2j. This systenl is ullsfablc because the real portion of the complex eigenvalues is positive. 'file phaseplane plot is shown in r:igufc 13.5.
FIGURE 13.5
310
PhasePlane Analysis
Chap. 13
Another type of linear system behavior occurs when the eigenvalues have a zero real portion. That is, the eigenvalues arc on the real axis. This type of system leads 10 closed Cllnes in the phaseplane, and is known as ccnter behavior. Example 13.5 illustrates center beha\'ior.
EXAMPLE 13.5
Center
(1117 )
iLUS)
The Jacobian matrix is:
;1~
_ 4
and the eigenvalues arc () 1.732 Ij. Since the real part of the eigenvalues is zero. there is a peri odic solution (sine and cosine), resulting in a phaseplane plot where the equilibriul11 point j" ~\ cenlcr, as shown in Figure 13.6.
FIGURE 13.6
Sec. 13.3
Generalization of
Phase~Plane Behavior
311
Examples 13.1 to 13.5 we have provided an introduction to linear system phaseplane behavior. We noted the important role of eigenvectors and eigenvalues, and how these relate
13.3
A=
Ian
CC ()
{[II
( 13.20)
del(A!  A)
which can be \vrittcn as:
( 13.21)
del(HA)
==
2 A 1r(A)A
+ del(A)
()
( 13.22)
( 13.23)
A, =
and.
V./c notice that at least one eigenvalue will be negative if 'r(A) < O. We also notice that the eigenvalues will be complex if 4 deteA) > tr(A)2.Remcmbcr that the different behaviors resulting from Al and A2 are: Sinks (stable nodes): Saddles (unstable): Sources (unstable nodes): Spirals:
Rc (A,) < 0 and Rc (A 2 ) < ()
We can then usc Figure 13.7 to find the phaseplane behavior for secondorder linear ordinary differential equations as a function of the trace and detenninanl of A. In Figure
312
PhasePlane Analysis
Chap. 13
de1(A)
spiral
source
Center
node
sink
node
source
saddle
FIGURE 13.7 DYllarnic behavior diagram for secondorder linear systems, Thcx<lxis is tr(A) and the yaxis is dd(A).
13.7, the xaxis is the trace orA and the .vaxis is the determinant of A. For example, sider Example 13.1, where A
COlJ
 I 1
'i
()
4
tr(A)
dct(A) c= 4
'fhe point (5,4) lies in the second quadrant in the node sink sector, as expected. since the two real eigellvalues arc negative (indicting stable node behavior).
Sec. 13.3
313
l<jgurc 13.8 shows the phasc~planc behavior as a function of the eigenvalue locations in the complex plane. For example, two negative eigenvalues lead to stable node behavior.
13.3.1
A qualitative assessment of the phasc~planc behavior can be obtained by plotting the slope marks for the vector field. Consider a general linear 2statc system
Eigenvalues
PhasePlane Plot
""i.. . ~ iRe
1m
3table node
~ ~e
x i ....
1m
3table fOCIJ3
FIGlJRE 13.8
314
PhasePlane Analysis
Chap. 13
Eigenvalues
PhasePlane Plot
~e
f~ ~
unstab1JJ tocos
~
r
m _
Jm
saddle
He
~e
"
FIGURE 13.8
Continued
( /3.24)
X2 = all x I
+ an x 2
I
( 13.25)
We call divide (13.25) by (/3.24) to find how x 2 changes with fCS]lcotto x,:
dX 2
a 21
Xl
dx]
(/326)
al1xj+1l12X2
LA
Sec. 13.3
Generalization of
Phase~Plane Behavior
315
and we can plot "slope marks" for val lies of xl and x2 to determine an idea of how the phase plane wil! look. Let us revisit Example 13.3. The slope marks can be calculated from (13.27):
dX 2
dXj
2x, 2 Xl + x 2
( 13.27)
Figure J 3.9 shows the slope marks for Example 13.3. These arc generated by forming a grid of points in the plane, and finding the slope associated with each point; short line seg~ mcnls with the slope calculated arc then plotted for each point. Notice that one can lise the slope marks to help sketch state variable trajectories, as shown 111 Figure 13.10. Saddle point behavior found in Example 13.3 is clearly shown in l<'igurc 13.10.
13.3.2
Additional Discussion
Phaseplane analysis can be used to analyze autonomous systcms with two statc variablcs. Notice that state variable trajectories cannot "cross" in the plane, as illustrated by the following reasoning. Think of any point of a trajectory as being an initial condition. The model, when integrated from that initial condition, must have a single tn~jectory. If two tn~jcctories crossed, that would he the equivalent of saying that a single initial condition could have two different tnyectories. If a system was nOlH1utonomous (for examplc, if there was a forcing function that was a function of time) then state variable trajectories could cross, because a model with the same initial conditions but a different forcing function would have different tn~jectories. An autonomous (unforced) system with n stale variahles cannot have tn~jectories that cross in nspace, hut may have trajectories that cross in less than nspace. For exam
FIGURE 13.9
316
PhasePlane Analysis
Chap. 13
FIGIJRE 13.10
pic, a thirdorder autonomous system cannot have trajectories that cross in 3spacc, but the trajectories Illay cross when placed in a twodimensional plane.
13.4
NONLINEAR SYSTEMS
In the previous sections we discovered the types of phaseplane behavior that could be observed in linear systems. In this chapter we will find that nonlinear systems v,'ill orten have the same general phaseplane behavior as the rnodellincarizcd about the equilibrium (steadystate) point, when the system is close to that particular equilibrium point. In this section we study two examples. Example 13.6 is based on a simple bilinear model, while Example 13.7 is a classical bioreactor model.
EXAMI'LE13.6
rtf
dZ 2
z,(z, + I)
( 13.28)
tit
(13.29)
Sec. 13.4
Nonlinear Systems
317
F'rJllilihrillm I: trivial
1. 2s
Equilibrium 2: nontrivial
Linearizing (13.28) and (13.29), we find the following Jacobian matrix:
Zl'~ +
<'1.1'
]j
.
Equilibrium 1 (Trivial)
The Jacobian matrix is: and the eigenvalues arc:
A
11. 1
[~ (~]
=  v'3
11.) = \/3
We know from linear system analysis that equilibrium point one is a saddle poim, sillce one eigenvalue is stable and the other is unstable.
.0.866 I _
~,
0.5j
I0.866
0.5
The phaseplane or the JincarJ/cd model around eqnilibriulll point one is a saddle, as shown in I"igurc D.l I. The linearized model is
FIGlJH.E B.ll
Phaseplane of the [~xample 13.6 model lillcarized around trivial equibrium point. This point is a saddle point.
318
0 3
PhasePlane Analysis
Chap. 13
x
1
11 x
where x = z 
z,
Equilibrium 2 (Nontrivial)
3
;1
0 011
A2
[\\10
AI
So, we know from linear system analysis that equilibrium point eigenvalues arc stable. The "fast" stable eigenvector is
The "slow" stahle eigenvector is
The phaseplane of the linearized model around cquilhrium point two is a stable node, as shown in Figure 13.12.
FIGURE 13.12
The phaseplane diagram of the nonlinear model is shown in r;'igllrc /3.13. Notice h()\\, the linearized models capture the behavior of the nonlinear model \Vhell close to one of the equiIbrium points. Notice, however, that initial conditions inside the "right" saddle "blow up," while initial condititllls inside the left saddle are attracted to the stable point. Slopefield marks are shown in F'igurc 13.14.
Sec. 13.4
Nonlinear Systems
319
FI(;lJRE 13.13 Phaseplane of [~xaJnplc 13.6. Tn~jcclorics (except those of the righl side of the saddle) leave the unstable point and arc "attracted" 10 the stable point.
,~~
FIGURE 13.14
320
...
PhasePlane Analysis
_~~
Chap. 13
EXAMPLE
n.?
Consider a model for a bioreactor with MOllOd kinetics (sec rVIoduJe 8):
dx(
tit
D)
x,
/lX 1
03.3(1)
(.'i  x,) IJ
JJm;nXI
(13.31 )
km +
where:
/tIll:)X
~y!
(13 ..J2)
== 0.53
~
k", == 0.12
y
Xj
11.4
4.11
is the biomass concentration and x2 is the substrate concentration. There arc (wo steadystate (equilibrium) solutions for this set of pararneters.
J:quililniulII I: trivial
Xl.>
= 4.0
L'quilibriu/II 2: nontrivial
1.4523
xb
0.3692
/L,\
X:!.\( kIll f
x1.J
E()uilihrium t (Trivial)
The Jacobian matrix is:
A ~
I 0.114563
 1.286408
IIA
with eigenvalues of; ~l = 0.114563 and A] == 0.4 indicating that the steadystate is unstable (it is a saddle point).
The unstahle eigenvector is:
Sl
I.  0.9285
0.3714]
This steadystate is known as the "washout" steadystate, because no hiomass is produced and the suhstrate concentralion in the reactor is equal to the feed suhstrate concentratioll.
I~I
Sec. 13.4
Nonlinear Systems
321
Equilibrium 2 (Nontrivial)
 1
3.215929] 8.439832
with eigenvalues of
0.4
and
~, ~
0.99241  0.11234
[.. 0.9285
3714
1
The phasr>plunc plot of Figure 13.15 sbows that the trajectories leave unstable point I (0,4) and go to stable point 2 (1.4523,0.3692). More detal! of the phaseplane around the unstable point is sho\Vn in Figure 13. J 6, while Figure 13.17 shows more detail around the stable point.
s
4.0
3.0
2.0
1.0
1.0
2.0
FIGURE 13.15 Phaseplanc for bioreactor with Monnd kinetics. x is biomass concentration and s is substrate concelltration.
322
PhasePlane Analysis
Chap. 13
0.0          FIGUIU~
         0.05
13.16
Phase~planc
britlln 1).
0.4
1.5
(Equilibrium 2).
Sec. 13.4
Nonlinear Systems
323
0.5
x,
0 0.5
1
1.5
1
0
X2
Example of center
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 periodic behavior. This is illustrated in the following section.
13.4.1
In Section 13.2 we noticed that linear systems that had eigenvalues with zero real portion formed centers in the phase plane. The plwscplanc trajectories of the systems with celltel's depended on the initial condition values. An example is shown in Figure 13.18. A somewhat 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 <)) hehavior is that limit cycles are isolated closed orbits. By isolated, wc mcan that all inital pcr~
1.5
r~~,
x,
0.5
o
0.5
1
1.5
L
'
x,
Example of limit
324
Phase~Plane Analysis
Chap. 13
wrbatiol1 from the closed cycle eventually returns to the closed cycle. Contrast that ,",vith center behavior, where a perturbation leads to a different closed cycle. Limit cycle behavior will he discussed in more detail in Chapter 16.
SUMMARY
As j10tcd earlier,
phasc~plane
llOll~
linear systems. We have spent. time analyzing autonomous linear systems, because the nonlinear systems will behave like a linear system, in the vicinity the equilibriulll point (where the linear approxiIl1ation is most valid). A qualitative feci for phasc~planc bdl<lvior can be ohtained by plotting slope marks. Notice that: we have shown examples of nonlinear systems that have multiple equilibrium points (steady~state solutions). Phaseplane analysis can be used to determine regions of initial conditions where a system Illay converge to one (stable) equilbrium point and regions where the initial conditions Inay converge to another (stable) equilibriulll point By sketching the linear behavior around a particular equilibrium point and by using slope marks, we can qualitatively sketch the phaseplane behavior of a given nonlinear system, Clearly the phase~planc approach is limited to systems with two state variables. Analogous procedures can be used to develop phasespace plots in three dimensions for threc~state systcllls.Linearization and analysis of the locally linear behavior in terms of eigcnvalues and eigenvectors can still be used for higher~order systems, but the phase behavior cannot be viewed for these higherorder systems.
or
FURTHER READING
Strogatz, S.ll. (1994). Nonlinear Dynmnics and Chaos. Reading, MA: Addisoll
Wesley.
STUDENT EXERCISES
linear Problems
r~<or the following linear systems, usc l'igurc 13.7 to determine the phasc~planc bchaviOl Also, calculate the eigenvalues and lise Figure 13.8 to verify your results. Develop your own phaseplane diagrams for any situations not covered in Figures 13.7 and 13.8.
~I
1.
_2 x
Student Exercises
325
2.
I ~ I:
1:
I
,::.~.
2
31 x
3.
I~ ~IX
~] x
4.
5.
x=
~IX
1
6.
2J 2 x
7.
Compare
I
x [:
I~
0. 25 1 2 x
8. 9.
x x
1 2
OSI x
1
~I
I
_~] x
0 2 0
10.
It.
=:
r; 3": r: ]
o
0 0 0 2 0 0
_~
12. A process engineer has linearizcd a nonlinear process model to obtain the following statespacc model and given it to your boss. Your boss has forgotten everything he learned on dynarnic systcms and has asked you to study this modcl using linear systcm analysis techniques.
x
where:
Ax
10 1.0
 1.0 1 0.0 .
326
PhasePlane Analysis
Chap. 13
with initial conditions x,(O) ~ 0.5 and x2(0) ~  0.25. What are the eigenvalues of the A matrix? Use bothMATLAB and your own analytical solution. b. Show a phaseplane plot, placing xl on the xaxis and x2 on the yaxis. 13. Consider a process with a statespace A (Jacobian) matrix that has the following eigenvalues and eigenvectors. Draw the phaseplane plot, clearly showing the direc~ tion of the trajectories. The eigenvalues arc:
3.
14. An interesting example of phaseplane behavior is presented in the book hy S(ro~ gatz (1994). He develops a simple model for love affairs, using Romeo and Juliet to illustrate the concepts. Consider the case where Romco is in love with Juliet, but Juliet is fickle. The more that Romeo loves her, the more that Juliet resists his love. When Romeo becomes discouraged and backs off, Juliet becomes more attracted to him. Let:
J.:!
'itl = cit
dx f. _____
axz
~
bx
dt
'
where a and b arc positive parameters. Show that this model has center behavior and discuss the meaning from a romance perspective. 15. Consider a more general formulation of the RomcolJuliel problem in 14 above. In this case, let:
dX J dt
Hf
Student Exercises
327
wherc the paramcters lljj can bc either positive or negative. The choice of signs specifics the romantic "styles." For each of the following cases (parameters a and b arc positive), determine the phaseplane behavior. Interpret the meaning of the results in terms of romantic behavior.
a.
(i~L
::0;
ill
dl
a x]
+ b x2
dx, ~ b x
t
::o;~ax]+hx2
b.
dx]
ill
dx')
dt e.
4::o;bxax
1
dx]
ilt
(L'lz
rll
Nonlinear Problems
1().
As a chemical engineer in the pharmaceutical industry you are responsible for Ii process that uses a bactcria to produce an antihiotic. The reactor has been contaminated with a protozoan that consumes the bacteria. Assume that predatorprey equations are used to model the system (x1 ~ bacteria (prey), x2 ~ protozoa (predator)). The time unit is days.
=axI'YxIXZ
Y2
Z,
328
dYI
PhasePlane Analysis
Chap. 13
"I
,,(I~y,)y,
dh
,11=
~13(Iy,)y?
c. l'ind the eigenvalues of the Jacobian matrix for scale equations, evaluated at YJs and Yzs. Rcali:r,c that Yt.v and Y2s arc 1.0 by definition. [,'inc! the eigenvalues in teflllS of (X and ~3. d. The parameters are (X :;::: ~1 ::::: 1.0 and the initial conditions arc )'1 (0) : : : ; 1.5 and Y2(0) = 0.75. i. Plot the transient response of)'J and )'2 as a function of time (plot these curves on the same graph using MA'l'LAB). Using your choice of integration methods, simulate to at least ( ::::: 20. ii. Show a phaseplane plol, placing)'1 on the xaxis and)'2 011 the yaxis. iii. \Vhal is the "peaktnpeak" lime for the bacteria? By how much time docs the protozoa "lag" the bacteria? c. Now consider the trivial sleadystate (xis::: r2.1':;:::: 0). Is it stable? Pcrfonn simulations when xj(O) 0 and x2CO)"* 0, What do yOll find?
f. What if" (0) " 0 and x2(O) = 0'1 g. What if,,(O) = 0 and '2(0)" 0'1
17. Consider the bioreactor Illodelused in Example 13.7 with substrate inhihition rather than MOllod kinetics (sec Module 8 I'or more detail)
"X.'
"I
(iL~ I ) )
'
where:
JLma\:
''
km
Sf
0.12 4.0
y
k,
and Xl is the biomass concentration and Xl is the substrate concentration. Assumc that the steadyslate dilution rate is D.I ,::: 0.3,
h. Analyze the stahility of each steadystate, l'ind the Jacohian, the eigenvalucs,
and the eigenvectors at each steadystate.
Student Exercises
329
c. Construct a phase plane plot. What do you observe about the unstable steadystale?
d. What would you do if it was desirable to operate the reactor at an unstable steadystate? 18. Perform some time domain plots related to the phaseplane plots for Example 13.7. Discuss how these plots relate to the phaseplane results.
19. A chemical reactor that bas a single secondorder reaction and has an outlet f10wrate that is a linear function of height has the following model where the outlet f10wrate is linearly related to the volume of liquid in the reactor (F:;:; f3 \I).
dC dl
F ~'(Ci" ~ C) ~ kC'
=
dV
Lit
F
1/1
'"V
t'
The parameters, variables and their steadystate values arc shown below: inlet flowrate (I liter/min) gmollliter) C::::: reactor concentration (O.S gllloi/liter) V = reacto volume (I liter) k = reaction rate constant (2 Iiter/(gmol min)) f3:;:: I min]
Fill :;;:
('ill
= inlet concentration (I
the square root of tank height. The flow from tank I is a function of \/h l ill' while the tlowrate out of tank 2 is a function of \Ih}
330
PhasePlane Analysis
Chap_ 13
13,
ft25
c_
25
_
mill
13 2 = V6
~~
5 [(2
A 2 cclOlt'
[('
5
111m
hJs
10
14
''['his chapter provides an introduction to bifurcation theory and chaos. After studying this chapter, the reader should be able to:
Sec the similarity between discrete time dynamic models and lluillcric;:1! methods Dctcnninc the asymptotic stability of a solution to the quadratic map
Unclcrstand the concept of a hi fllrcation Understand the significance
Understand how to find pcriod2, pcriodA, .. _, perioda solutions or the universal number 4.6691 96223
When a parameter of a discrclc~timc model is varied, the llUlnbcr and character of solu~ lions may changclhc parameter that is varied is known as a bU;tfcutiol1 parameter. For some values of the bifurcation parameter, the dynamic model may convcrgc to a singlc valuc aftcr a long valuc of timc, while a slnall change in the bifurcation parameter may yield periodic (continuous oscillations) solutions. For some discrete equations, valucs of the parameter may yield solutions that appear random these are typically "chaotic" solutions. Chaos can occur in a single nonlincar discrete equation, whilc threc autonomous (no explicit depcndencc Oil time) ODEs arc required for chaos in continuous models. The major sections in this chapter arc:
14.1
Background
A Simple Population Growth Modcl A More Rcalistie Population Model Cobweb Diagrams
331
332
14.5 14.6 14.7
14.8
Chap. 14
14.1
BACKGROUND
Many engineers and scientists have assumed (at least. until roughly twenty years ago) [hill
simple models have simple solutions and simple behavior, and lhat Ihis behavior is predictable.lndeed, the main objective for developing a rnodel is Llsually to be able to predict
behavior or to match observed behavior (measured data). During the past thirty years, a nurnhcr of scientists and engineers have discovered simple 11lOLlcis \v!lerc the shortterm behavior is predictable, hut sensitivity to initial conditions make the long~tertlJ predictillil impossible. By initial conditions. \\,ie mean the value of the variables at the beginnillg of the integration in time. All example is the simple weather prediction model of Loren/. (1963). which is a system of three nonlinear ordinary differential equations; the Lorell/. 1l1Odcl is covered in more detail in ChaptGr 17. Another example is the population grO\vth model used by May (1976), which is a single nonlinear discrete time equation. fhis population lllodel is the topic of this chapter. The cOllllllonly accepted term for the dynamic hehavior a system that exhibits sensitivity to initial conditions is clwos.Tcrms for the branch of mathematics related to chaos include nonlinear dynamics, dynamical systems theory. or nonlinear science. \in\' chaos books, written for a general audience, appear frequently: some of the more interesting olles arc referenced at the end of this chapter. This chapter will not make you an expert on nonlinc.'lr dyn<1111ics, but it will help you understand what is meant by sCl1sitil'itr to initiol ("ollditiollS and practical limits to longterm [Jredictability.
or
14.2
wherc
Ilk
hk
die.
~
population at the beginning of tilne period k number of births during tinlc period k number of deaths during time period k
Now assume that the number of births and deaths during tillle period k is proportional to the population at the beginning of time period k.
Sec. 14.2
333
( 14.2) (14.3)
(Xd
(14.4)
(l+r)II,
r;::: (Yb ~ eXd'
(14.6)
where
0' fl k
( 14.7)
where ex ::::; I + r;::: I + ex/}  c"r/ (obviously, The analytical solution to (14.7) is:
0'
where /lois the initial condition. 1"1'0111 inspection of (14.8) we observe lhal
if (X < 1 The population decreases during each lime period (converging to 0). if (X > I The population increases during each time period (+ 00).
if ex;::: I
+
alpha
D
0
<ii
~
<D
1.1 +
~
0
1.5 + 0.5 0
0
"3
alpha
10
00
alpha
4 time step
10
FIGURE 14.1
334
Chap. 14
These results arc easily rationalized, since births<dcaths, births>dcalhs, and births == deaths for the three cases. The result for 0: > I is consistent with Malthus. who in the nineteenth century 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 bacteria case, the mnounl of nutrients or the size of the Petri dish will limit the maximum number of bacteria that can be grown). In the next example, we show a simple model that "constrains" the maximum population.
14.3
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:
Xk , I ~
g(x k )
( 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 of the current guess (iteration k). Equation (14.9) shows how the population changes from time period to time periodthat is, it is a discrete dynamic equation. Since (J4.9) is the same f011n as (14.10), we will learn a lot about the quadratic map frOTH analysis of the direct substitution technique and vice versa. You will also note that many numerical integration techniques (Euler, RungcKutla) have the fOHn of (14. [0). Since (14.9) is a discrete dynamic equation, we can determine the steadystate behavior by finding the solution as k ;. 00. Writing (14.9) ill a more explicit form,
(X
xlc.
(14.11 )
.:r, 
(X
.Y./"
(J
(14.12)
"X,'  (" x,
~
I) x, ~
(14.13)
We can use the quadratic formula to find the steadystate (fixedpoint) solutions:
0 and
u
(y
(14.14)
It is easy to see from (14.9) that if the initial population is zero, it will renwin at zero. For a n0I12erO initial condition, one would expect convergence (steadystate) of the population to (0.'  l)/cl'_. We will use a case study approach to show that the actual longterm
Sec. 14.3
335
TABLE 14.1 Parameters and Non zero Solutions for Four Cases
Case
I
"
2.95 3.20 3.50 3.75
X ,I
2 3 4
(stcady~statc)
nonzero
stcady~stalc that
behavior can be quite complex. Table 14.1 shows the is expected from (14.14).
(X
14.3.1
Each case presented in Table 14.1 has distinctly different dynamic behavior. As shown in the following sections, case 1 illustrates asymptotically stable hehavior, cases 2 and 3 illustrate periodic behavior, and case 4 illustrates chaotic behavior.
xk
0.1 0.2655 0.5753 0.7208 0.5937 0.7116 0.6610
Xk+!
The 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 steadystate of 0.6610. This type of rcsponse for continuous models is usually called asymptotically stable hehavior since the output converges to the steadystate (fixedpoint) solution.
PERIODIC BEHAVIOR
The transient response curve forcase 2 is shown in Figure 14.3. The curve oscillates between 0.513 and 0,800, while the predicted resull (equation 14.14 and Table 14.1) is
336
Chap. 14
0.8 0.7
c
.~
S
0
00
C
0
"
c
m m
.~
E " '5
10
20
time step
30
40
50
FIGlJllE 14.2
steadystate.
0.8 0.7
c
S
0
0
00
m m
C
0
"
.~
" E '5
10
20
time step
30
40
50
FIGURE 14.3 Transienlpopulation response, case 2; oscillates between values (pcriod2 hehavior).
(\\,0
Sec. 14.3
337
0.6875. 'This type of response is known as pcriod2 behavioL In case 3 the transient response oscillates between 0.383, 0.827, 0.501, and runs as shown in r'igurc 14.4. This is known as pcriod4 behavior, since the system returns to the same slale value every fourth time step.
CHAOTIC BEHAVIOR
For Case 4, the transient response never settles to a consistent set of values, as shown in Figure 14.5; rather the values appear to be somewhat "random" although a dctcnninislic equation has been used to solve the problem. Figure 14.6 shows that a slight change in initial condition from 0.100 to O. J 0 J leads to a significantly different poinHopoinl rcsponscthis is known as sensitivity to initial conditions and is characteristic of chaotic systems.
0.9 0.8
0.
co
.~
"5
w w
0. 0. 0.
.~
'" 0.
E '6
'"
co
30
40
50
FIGURE 14.4 Transient population responsc,case 3; oscillates between four values (periodA belmvior).
338
Chap. 14
0.8
c
~ "3
0. 0 0.
0.6
C 0 iii c
ill
"' "'
ill
0.4
E '5
0.2
20
40
time step
60
80
100
FIf;LJRE 14.5
1\
c
:g
"3
0. 0 0. I I I I I I
I
I
\1
\
I I
E '5
ill
,
I
\ I
\
\ I
I
!
" "
\i
1/
\'
0 75
80
85
time step
90
95
100
FIGURE 14.(j Transient population response, case 4; chaotic behavior (Solid Line initial condition of Xo ;:;:: O. L Dashed Iincinitial condition of X o 0.10 I). 'This illustrates the sensitivity to initial conditions.
::;0;
Sec, 14.4
Xn + 1 1
Cobweb Diagrams
339
0,75
5
0,25
"'
L
0,25
'
'
'
0,75
x n
FIGlJRE 14.7 Cobweb diagram for the quadratic map problem. The initial point is '0::;:;; 0.1.
14.4
COBWEB DIAGRAMS
Insight to the behavior of discrete singlc~variablc systems can be obtained by constructing cobweb diagrams. Cobweb diagrams are generated by plotting two curves: (i) g(x) versus .r and (ii) x versus x; the solution (fixedpoint) is at the intersection of the two curves. For exampic, 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 I<'igurc 14.7. Since the X o value is 0.1, the x J value is obtained by first drawing a vertical line to the g(x)
Xn +l
0,75
0,5
0,25
o i<::
'0.25
' 0.5
"0.75
l
FIGlIlU: 14.8 C"se I (n ~ 2,95) rnap, convergence to a single solution (x = 0.6(1); corresponds to the transient response in Figure 14.2.
340
Xn +l
Chap. 14
0.75
0.5
025
FIGORE 14.9 Case 2 (LV:::: 3.20) map, oscillates between x:::: 0.5130 'Illd
"'' '' x n 1
0.7995 after initial transient; initial condition ol'xo:::: 0.1 corresponds to
0.25
0.5
0.75
i
curve to rind g(.ro) :::: 0.265, then drawing a horizontal line to the x :;:;; .r curve (since
xI :::; g(xo); therefore, tt :::: 0.2(5). A vertical line is drawn to the g(x) curve lto obtain g(x t ):::: 0.575), then a horizontal line is drawn to the x:::: X curve (so, xl:::: 0.575), "fhcsc
initial steps arc shown in Figure 14.7. l'igurc 14.8 shows that this process converges to the fixedpoint of x,~, :::: 0.661, for the case 1 parameter value of 0' :::: 2.95. Figure 14.9 shows that the iterative process eventually "bounccs" between two solutions for the case 2 paramctcr value of a;:;;:; 3.2. This is shown more dearly in Figure 14.10 where an initial guess of Xo = 0.5130 leads to solu tions of 0.5130 and 0.7995 (pcrioet2 behavior). Case 3 has pcriod4 behavior. as shown in Figurcs 14.11 and 14.12. Case 4 (Figure J 4. J 3) is an example of chaotic behavior. where the sequence of iterates never repeats.
)i
Xn +l
0.75
0.5
0.25 Case 2 (0 ~ 3.201 map, oscillates het\Vccll x = 0..') l_lO and 0.7995; initial condition or Xo = n.5130 (period2 behavior). FIGlJRE 14.10
o "''"'' xn
0.25
0.5
0.75
Xn+l
0.75
0.5
FIGURE 14.11 Case 3 (n ~ 3.50) map, oscillates between x:;:;o 0.3828, 0,8269,0.5009, and 0.8750, The initial condition is xo:;: 0.1. This COITcsponds to the transient response in Figure 14.4
(pcriod4 behavior),
025
o "'
"0.25
'.
0.5
'0.75
' x
1
o
Xn +l I
0.75
05
0.25
o "'
'0 _25
'
0.5
'__' x
0.75 1
FIGURE 14.12 Case 3(n ~ 3.50) map, oscillates between 0.3828, 0.8269,0.5009, and 0.8750, initial condition of Xo :;: 0.3828 (period4 behavior).
0.75
0.5
0.25
...L
'
.L..
0.25
0.5
0.75
.J x n 1
FIGURE 14.13 Case 4 (" ~ 3.75) l.nap, chaotic behavior; corresponds to the transient response in Figure 14.5. 341
342
Chap. 14
14.5
or
14.5.1
There is a single steadystate solution untillY::;:: 3, where a bifurcation to two solutions occurs. 'fhe next bifurcation point is {Y ;:: 3.44949, where four solutions emerge. A period~X bifurcation occurs at 0' ::: 3.544090, periodJ6 at (X ::: 3.564407, j"Jeriod32 (:It Ct ::: 3.568759, and period64 at (X ;:: 3.569692. Chaos occurs at 0'. :::;; 3.56995. Notice that there are some interesting "windows" of periodic behavior, after the onset of chaos. For example, at (X ;:: 3.83 we find a window of period3 behavior. The period3 behavior occurs after approximately 60 time steps, with an initial condition of 0.1, as shown in Figure 14.15. This behavior is shown more clearly in Figure 14.16 which is simply the data from
0 9
o. 8
0 .7
/~/'~~
1.
'
o. 6
x
0 .5
0 .4
...................
~./~
'~
o. 3
0.2
o.
0
2 9
3.2
3 4
U.
3.6
3.8
FIGURE 14.14
0'
Sec. 14.5
343
3.83
0.
'fg
S
0. 0.
ill
if> if>
0.
C g
if>
E i3
C ill
0.1
20
40
time step
60
80
100
3.83, initial FIGUR E 14.15 Period3 behavior (after inllial transient) for Ci. ;;:;; 0.1. Periodic values are x;:;;: 0.15615 ,0.50466 , and 0.957417. condition
=0
!I
c
\'
\
I I
i
/
+
1\
I I I I
~ S
if> if>
0.
0.8
I
f
I I I
I
/
i' 'I
I,
/
,"
I' I I
tI
'\
+
Ii
I
I \
0. 0. 0.
ill
/ I
0.6 0.4
I /
I
\
I
I I I I I I
I
\
I I I
+
I
+
/
0. ijj
C ill
'"
+ /
I
,
\
+
" I "/
,
I
/ I I I I I
+
/
\
I
E i3
\ I
\
"
I
\
0.2 0 75
'I
\f
\/
Y
80
"
85
~
90
I'
4
t
100
95
time step
Pcriod3 behavior for (~ ::;: 3.lB. Values arc x ;:;: 0.15615, FIGlJR E 14.Hj and 0.957417. 0.50466,
344
Xn +l
Chap. 14
0.75
05
0.25
'
'_ _' X
05
0.75
FIGURE 14.17 PcriodJ bclwvior at 3.83. Values arc x:;:::; 0.156\ S. 0.50466. and 0.957417.
(X
0;::
Figure 14.15 plotted between 75 and 100 time ;.;tcps. The cobweb diagranl of Figure 14.17 also shows the pcriod3 behavior. Research has shown that pcriod:, behavior implies chaotic hehavior.
14.6
Definition
Let x'~ represent theJixedfJoillf solution of x'o: :;::: g(x*'), or g(x''')  x~':;::: O.
Theorem
Idx
<~
14.6.1
Here we will make lISe of this theorem to determine the stability or a solution to the quadratic map:
g(x)
(XX( I  x)
= (l'X  (U'
(14.15)
Sec. 14.6
345
So,
iJg
dx
.=<2,xx=<(1
2x)
For simplicity in notation, we will usc g' to represent i)g/(Jx. r~valLJatcd at x*, we have:
g'(x*)
<Y 
2exx* = ev (1
2x*)
(14.16)
Therefore, from (14.16) and the stability theorem, if the following condition is satisfied:
I,x (1
2x*)
I<
( 14.17)
Theil'. x* is a stable solution. Remember from (J 4.14) that there arc two solutions to x* :::: tx*(l.t*):
x*
c. 0
or
x*
<
Momentarily we will generalize the stability results !()r any value of cc First, we will study the four specific cases.
CASE 1
(Y
= 2.95
:=
0, we find:
Ig'(x) 11 < (I
At the other fixed point solution, x*::::
 2x*)
I 2.95 >
Ig'(x*)1
I <Y (1
= 0.9499 < 1
\vhich assures that the second fixedpoint is stable. 1;'01' 0' := 2.95, we expect the numerical solution to converge to the stable fixed point, x*:= 0.6610, since the olher fixed point (x*;:;;;; 0) is unstable. The stability results for cases I through 4 are compared in Table 142. Notice thaI case I is the only one of the four cases where lhere exists a stable solution. The reader . should verify that an initial guess ofx arbitrarily close to zero (but not exactly 0), will not converge to zero for any of the four cases.
r"'
0
Ig'(x*) I
2.95 3.20 3.50 3.75
x'~
Ig'(x*) I
0.9499 1.2000 1.5000 1.7500
2 3 4
0 0 0
346
14.6.2
Chap. 14
ca~:;cs
Notice thai we have been quite limited in our study, since we have only considered four with 2.95 S ex :S. 3.75. Now we will consider the general results for any ('( > O. Again, recall that there arc two fixedpoint solutions for a given value of (X
x*
()
or
x*
xI =
.'.:;"
(X
lX
STABILITY OF
then
x'o AS A
=
(X 
FUNCTION OF lY
2nO ::::: (X
Ig' (x~)1
I ex I
Also, since III < 1 is required for stability, then x{~ is a stable solution only as long as 1 < 0' < J. Otherwise, x('; is unstable (rccalIthal Ci < 0 docs not make physical sense).
STABILITY OF x~ AS A FUNCTION OF lX
SincexT~(lXI)/lxandg'(xT~lXZlY(lXI)lcx~lYZ(lYI)~lX+Z
(x'D + which indicates stability for I < (X < 3. Otherwise, is unstable. These results arc shown on the bifurcation diagram of Figure 14.18 for 0 < (X < 4. Generally, solid lines will be Llsed to represent stable solutions and dolled lines will be used to represent unstable solutions. As discussed above, a change of stability for x;j occurs at 0' ::::;: I. Also, changes of stability for x't occur at 0' ;:::: I and (Y :::: 3. The values of 0' where the stability characteristics change arc known as bifurcation points. The bifurcation that occurs at 0' = 1 is commonly known as a ';lranscritical" bifurcation (sec Chapter 15)an exchange of slability between the two solutions has occurcd. Notice that Figure 14.18 is a h(fllrcatioll diaRrarn based on a linear stability analysis. It differs frol11 an orhit diagram (sllch as Figure 14.14), because it docs not show the periodic behavior obtained from solving the nonlinear algebraic equation for the popula~ tion growth model. An orbit diagram cannot disp(ayullstable solutions, however.
then
Ig'
I , Ic, zi
x1'
14.6.3
The theorem states that if lag/ax I at the fixed point, the fixed point is stahle. Further, if ag/ox is negative, then the fixed point solution is oscillatory. If dg/ax is positive, the be~
Sec. 14.6
347
lrr,r.,.~...._,
bifurcation diagram
0.5
"I
..
stable
...X

UIlBtable
.. Xo
stable
I
f
1 I
o 1UIlBtable
..
0.5
I
I I
UIlBtable
I I 11..'~~~~~~~'
I .. IXI
0.5
FIGlJRE 14.18
1.5
2.5
3.5
havior is monotonic. We can then develop the fo]Jowing table of results from the stability
theorem
i)g
itr
<~l
stability
response
oscillatory oscillatory
unstable
Dg
ax
<.: 0
stable
a.r <
stable
unstable
monotonic monotonic
Although the linear stahility analysis is useful for determining if a fixedpoint is stable, it cannot he used directly to understand possible periodic behavior. This is the topic of the next section.
348
Chap. 14
14.7
CASCADE OF PERIODDOUBLINGS
We have noted that there appears to be a series of period doublings in route to chaos. The limitation to the method presented in Section 14.6 showed that it could predict that a particular fixed point was unstable, but could not identify the type of periodic behavior that might occur. In this section we will show how to find these perioddoubling bifurcation points and the respective branches shown in Figure 14.13.
14.7.1
Period2
When period doubling occurs, the [lopulation value at time step k is equal to the value at time step k  2. This can be represented by
(141 X)
or
then
(14.20) (14.2 I) (14.22)
Warning:
r:or the quadratic map, we call develop the relationship shown in (14.22):
Xk+2
aXkl1
(1 ~xk\l)
(14.23)
:=
a X"k
(I
~ J.~k)
Sec. 14.7
Cascade of PeriodDoublings
349
Expanding (14.25),
( 14.26)
or
(1427)
Notice that there arc four solutions to the fourthorder polynomial. We can find the solutions graphically by plotting g2(x) versus x, as shown in Figure 14.19 (for (X 3.2). If you closely observe the plot, you will find the following four solutions for pcriod2 behavior:
x"
We can sec graphically that the solutions x* ::::: 0 and 0.6875 arc unstable, since the slope of g2(x*) is greater than L (A period2 solution is stable if 1()(;;2(x/d.\:1 < 1.) Also, notice that the solution for x ::::: g(x) will always appear as one of the solutions for x ::: g2(x). If a solution for x ::::: g(x) is unstable, it will also be unstable for g2(x). We can sec that x ;::; 0.6875 is the solution for both .Y ::::;; g(x) and x : : ; g2(x), by observing [!igure 14.20. At this point it is worth showing the results of x versus g(g(.:r) for case I, which we know has a single, asymptotically stable solution. Figure 14.21 shows that there is a sin~ gle stable solution of X ::::;; 0.6610. This makes sense, because as k ) we know that x k :::: 0.6610; this Illeans that xk+2 = x k+ 1 = :r k ::::: 0.6610. We can sec fromF'igure 14.22 that n ;;;;; 3.0 is a bifurcation point, since absolute values of the slope of g(x) and g2(J::) ::::: I at x::::: 0.66667. Figure 14.22 is clearly a transition point between l<'igurc 14.21 and Figure 14.20.
00,
1,
/.
08!
('
,""
0.4'
I
I
/
X /
~
//~
j1"..," \ / /Vi
A
/f\
unstable
.I
0.2;J
./
stable
I I
/v oV
i
il
//~
02
i' Ii
unstable
\!Ii
OA
OB
DB
VlGlJRE 14.19
0';::;:
Plo! of g(K(X))
3.2.
350
Chap, 14
0,8
CT
" "
0;
>{
" '"
0,6
0.4
02
02
0.4
0,6
0,8
FIGURE 14.20
gl(x) versus.x for
J.2.
0,8
CT
0,6
0.4
02
0.4
x
0,6
OB
FIGtJRE 14.21
pcriod2 behavIor.
Sec. 14.7
Cascade of PeriodDoublings
351
0.8
'& 0
s:
0.6
"
0;
0.4
"
0.2
FIGURE 14.22 Plot of g(x) aod g'(x) ven,lIs x for n "'" 3.0.
14.7.2
Period4
When pcriodA behavior occurs, the population value at time step k is equal to the value at lime step k  4. This can be represented by:
X k +4
= xk
(14.28)
Using the same arguments that we used for pcriod2 behavior, we can find that since
xk+ I :;;;; g(..r k),
(14.29)
~ g(g(x kU
~ g(g(g(xk+')
XkI4 
_g'(x )
k
= g(g(g(g(x k))))
( 14.30)
We can obtain the solutions to (14.30) by plotting g4(x) verSllS x as shown in Figure 14.23 for C/. = 3.5. Again, do not confuse g4(x) with Ig(x)]4 g4(x) is an eighthorder polynomial with eight solutions as shown in Figure 14.23. Figure 14.24 shows that the solutions for x:::: g(x) and x :::;: g2(x) arc also solutions (although unstable) for x = g4(x).
352
Chap. 14
u
0.8
s
u
;,
;;
0.6
'" 0,4 ~
0.2
u
0 0 0.2
0.4
0.6
0.8
x
FIGURE 14.23
Plots of g4(x) versus x to find the pcriod4 values for Ci "" 3.5.
alpha = 3.5
0.8
;;
t;
'\ ., ., .,, , \
'~;\ ::'I
::
, "
:s '0,
C5 0.6
~OA
... ."
;,
\.
\ \
'"
~x
0.2
V\
0.2
0.4
x
0.6
0.8
FIGURE 14.24
0:::
3.5.
Cascade of PeriodDoublings
353
Periodn
1/,
By analogy to tnc pcriod2 and pcriod4 hehavior, we call sec that for any period have the following relationship
we
(14.31 )
v Ak lll
.~
""(.",.) () ./i
( 14.32)
Note that gll(Xk) will he a polynomial that is order 2n, and there will be 2n solutions, n of which arc stable.
14.7.4
Feigenbaum's Number
The quadratic map exhihits a period doubling route to chaos. As the hifurcation paralnetcr 0'. is increased, model goes through a series of period doublings (IJcriod2, perindA, periodS, period16, etc.). Feigenbaum noticed that the quadratic map had a consistent change ill the bifurcation parameter between each period doubling. Indeed, he found that any "onehump" (sec any plot of g(x) for the quadratic map) model will have a cascade of bifurcations which will yield the /"'eif;cn!Jaum nurnbcr. The r"eigenbaum Humbcr is calculatcd by comparing (X valucs at each sllccessivc hifurcation point in the following fashion
" Ct
lim
'1 ~ 4.669196223
( 14.33)
C'ii+ [  O:i
where C'ii represents thc parameter value at thc i th period doubling point, where the period is 11 ::::: 2 i . To obtain a rough cstimate of the Feigcnbaum number, usc thc valucs of (X for period16 (2 4 ), pcriod 32 (2 5 ) and pcriodM (2 6 )
e
3.56R759 3.569692
~ ~
3.5044IJ7 3.56R759
4.6045
which is close to 4.6692 A summary of thc bifurcation points is providcd in 'fablc 14.3. Chaos occurs when the pcriodis 00 (state sequcnce never repcated) at
0' :::::
3.56995.
TABLE 14.3
"
3.0 3.44949 3.544090 3.564407 3.568759 3.569692 356995
I 2 3 4 5 6
,j'j
4 8 16 32 64
oc
354
Chap. 14
SUMMARY
A lot of material has been presented in this chapter. You may be wondering how discretc maps and bifurcatiolltheory tics in with applications in chemical engineering. There arc at leastlwo important reaSOns for studying this material: We have shown that the quadratic map problem is conceptually identical [0 numer! cal methods that can be used to solve a nonlinear algcbraic equation. Since lhe qua dratic map problem cxhibits exotic behavior undcr certain values of the paramcter n. this tells liS that a poorly posed I1lHllerieal method lllay have silnilar problcms. f3c can~/ltl when llsing J/umerical methods.'
355
We noticed that a discrete population growth model is represented by the quadratic map problem. This population growth lnodel is a simple example of a discrete dyn,<lmic system, which was modeled by a nonlinear algebraic equation. In the future, we will be studying continuous dynamic systems, that is, systeills that arc modeled by ordinary differential equations (ODEs). It turns out that nonlinear OI)Es can have dynamic properties that are similar to the discrete population tllodel.For example, exothermic chemical reactors can exhibit bifurcation behavior and continuous oscillations in temperature and composition. One lnain difference is that a system modeled by a set of autonomous ODI~s must have at least three equations before chaotic behavior occurs. Chaotic behavior can occur in a discrete lnode! with only one equation.
Chaos can appear in numerical solutions to chemical engineering problems, such as phasc equilibrium calculations, as shown in the following paper: I.ucia, A., X. Guo, PJ. Richey, & R. Dercbail. (1990). Simple process equatiot/s. .fixed [Join! methods, and chaos. American Institute of Chemical Engincers Journal (lIICI1.I.), 36(5): 641~654.
356
Chap. 14
The book by Strogatz is an excellent introduction to nonlinear dyiHunics: Strogatz, S.H. (1994). Nonlinear Dynamics and Chaos. Reading, MA: Addison Wesley.
STUDENT EXERCISES
I. \Vhy arc the results for the simple quadratic map problem important to understand, when chemical and environmental process models arc obviollsly much more complex (hascd 011 ODEs)')
2. Usc MATLAB to generate transient responses for the quadratic map, for various values of n. Explore regions of single st:cady~statc solutions, as well as regions of periodic and chaotic behavior. Use Figure 14.14 to try and find regions of periodic behavior in the midst of chaotic behavior. 3. Derive the scaled logistic equation (14.9) from the following unscaled model for population growth.
where r and I. arc constants (Hint: [)efinc the scaled variablc, x::::: nr/( I + 1')1.). What is the physical significancc of L'!
4. Consider the "constant harvesting" model for population growth, where 'Y is a term that accounts for a constant removal rate per unit timc period (e.g., hunting deer or removing cells from a petri dish),
How docs 'Y effect the cquilibrium population values? (Show calculation, and COllsider stability of the equilibrium.) tAct tV ::::: 3.2. What 'Y values <Irc required for () (the trivial solution) to be a stahlc cquibrium solution? What 'Y valucs are required for a stablc nontrivial solution'?
5. Consider the "proportional harvesting" model for population growth, whcre the removal rate per unit timc pcriod is proportional to the amount of population
How docs 'Y cffect the equilibrium population values? (Show calculation, and consider stahility of the cquihbriuln.) Let (\' ::::: 3.2. What 'Y valucs arc required for 0 (the trivial solution) to bc a stable equibriul11 solution? What 'Y valucs are required for a stable nontrivial solution'? 6. Consider the pcriod2 behavior that occurs at a value of 0' ;:::: 3.2. Show that the values of x ~ 0 and x ~ 0.6875 are unstahle. (flint: Let h(x) ~ X(X(x and show thai I/{(x) I ;:> I at those values.)
Student Exercises
357
7. Using MATLAB construct the orbit diagram (Figure 14.14) for the quadratic map. S. F'ind the (real) fixed points 01'.\""+1::: \/t/,' and analyze their stability. Also, develop a cobweb diagram for this problem. 9. Consider the nonlinear algebraic equation, .f(x) ::: _.1;2  X + I ::: O. Using the direct substitution method, formulated as x::: _.r 2 + I ::: g(x), the iteration sequence is
x kl
::0:::
g(x k ) =  xl
j
Try several different initial conditions and show whether these converge, diverge or oscillate between values. Discuss the stability of the two solutions x';: ::: 0.618 and x* :::;; 1.618, based on an analysis Of{I,/(x~:).Deveiop a cobwcb di<:tgram for this SYStCllL
10. Consider the nonlinear algebraic equation,f(x)::: x 2  x + I ::: O. Usillg Newton's method,
Try several different initial conditions and show whether these converge, diverge, or oscillate between values. Discuss the stability or the two solutions .r:t: ::: 0.618 and x":::: 1.618, based on an analysis ofg'(x*'). Develop a cobweb diagranl for this system. 11. Consider the scaled LotkaVolterra (predator (Y2)prey (VI equations, \vhere
dv
til
, = a (I ~ v) V,
. .
The parameters are O~ ::: ~ ::: 1.0 and the initial conditions arc Yj(O) ::: 1.5 and YiO) ::: 0.75. The time ullit is days. Integrate these equatioJls lll11ncrically (using odc4 5, for example) to show the periodic behavior. 12. The IIcnon Inap is a discrete model that can exhibit chaos:
x, (k x,(k
+ I) + I)
x)(k)
j
I ~ax,(k)'
h x,(k)
For a value of!J::: 0.3, perform numerical simulations for various values of u. Try to rind values of a (try a > 0.3(75) that yield stahle period2 behavior. Show that chaos occurs at approximately a:= 1.06. 13. Read the paper by Lucia ct al. (1990) and use cobweb diagrams to show different types of periodic behavior that can occur when direct substitution is llsed 10 find the volume roots of the SRK equationofstale for the multicomponent mixture (CH"I' C ZH4, and C,H(,(J).
358
Chap. 14
% % % %
%
% %
%
% % % %
% finds g(x), g"2(x), gA3(x) and g"4Ix) % the quadratic map problem
%
x
g
x: g4
x:
Student Exercises
359
alpha*g2(i)*(1g2(i)); alpha*g3(i)*(1g3(i));
g3(i) g4(i)
end
'_, ')
15
The goal of this chapter is to introduce the student to the concept of bifurcation behavior. applied to systems modeled by a single ordinary differential equation, Chapters 16 and 17 will involve systems with more than one state variable. After studying this chapter, the student should be able to DClcnnine the bifurcation }Joint for a single ODE Determine the stability of each branch of a bifurcation diagram Determine the numher of stcady~statc solutions near a bifurcation point 'fhcmajor sections in this chapter afC: 15.1 15.2 Motivation
15.3
15.1
MOTIVATION
Nonlinear systems can have "exotic" 11chaviof such as multiple stcady~statcs'and transitions from stable conditions to unstahle conditions. In Chapter 14 we presented the quadratic map (logistic map or population model), which showed how a discretetime systeln could move from a single stable steadystate to periodic hehavior as a single parameter was varied. This would he considered a dynamic bifurcation of a discretctinle system, where the behavior changed from ()symptotically stable to periodic.
360
Sec. 15.2
361
conLinllous~timc systems.
steadystale bifurcation occurs if the number of steadystate solutions changes as a system parameter is changed. If the qualitative (stable ys. unstable) behavior of a system changes as a function of a parameter, we also refer to this as bifurcation behavior. This chapter deals with systems modeled by a single ordinary differential equation.
Bifurcation analysis is particularly important for complex systems such as chemical and biochemical reactors. Allhough only single variable examples arc used in this l1lod~ ule, the same types of bifurcation behavior afC also observed in chemical and biochemical reactors.
15.2
FIGURE 15.1
362
Chap. 15
15.3
TYPES OF BIFURCATIONS
1'he types of bifurcations that will be presented hy way of examples include: 0) pitchfork, Oi) saddlenode, and (iii) transcritical. We will also cover a form of h.vsteresis behavior and show that it involves two saddlenode hifurcations. Before we cover these specific hifurcations, we will present the general analysis approach. Consider the general dynamic equation: (15.1 ) where x is the slale variable and !.L is the bifurcation parameter. The steadyslale solution (also known as an equilibriulll point) of (15.1) is:
()
f(.qL)
( 15.2)
A bifurcation point is where the both the function and its first derivative are zero:
(15.3 )
Notice that thcrirstdcrivalivc is also the Jacobian for the singleequation model. Also, the eigenvalue is simply the Jacobian for a single equation syslem, so the eigenvalue is () at a bifurcation point. The number of solutions of (15.2) can be determined from cafastmehe t!lcory. [~quatioll (15.2) has k solutions, if the following criteria arc satisfied:
f(X,fL) = ()
af ... a'f
()x  ax?
(15.4)
and
( 15.5) In Example 15.1 this method is applied to a system thaI exhibits a pitchfork bifurcation.
EXAl\lPLE 15.1
Pitchfork BiflHTation
Consider the single variable system shown previously ill Section 15.2.
x f(X,fL) ~ fLx x'
(15.6)
the solutions
to.f(x,p~);:;;: 0
are
r,,()
x,.j =
V;~
x,<!
V~
Sec. 15.3
Types of Bifurcations
363
Notice that if 11, < 0, then xl' ;;::: 0 is the only physically meaningful (real) solution, since \/~ is complex if fJ. < O. The Jacobian is
Since the Jacobian i.o, a scahH, then the eigenvalue is equal to the Jacobian:
If Po. < 0, then the systcm is stahle. If Po. > 0, then the systcm is unstahle. NO\v, we can find the sta bility of the system, as a function of the hifureation panunetcr, /L.
I. ~ < O.
The only real equilibrium solution is '\,0;;::: 0, so the value of the cigenvalue is:
A  fL"
which is stahle, since fJ. < O.
II.
> O.
POI'
this case, there are threc real solutions; we will analyze each one separately. We X/'ll' X;'I' ami x e2 to indicate the three different solutions.
3 x?: 1 /J."
\1 fJ'
2 :1 .r e 
Il c
lIllstahlc
2
 VfL
Il" 
stable
3
.J
+ IL,.
Il"
+
~,.
2 J.l"
 stable
It is eomOlon to plot the equilihriulll solutions on a bifurcation diagram, as shown in Figure 15.2.
For Il <0, therc is a single real solution, and it is stable. r"m Il > 0 there arc three real solutions; two arc stablc and one is unstable. A solid line is used to represent the stable solutions, while a
dashed line indicates the unstable solution. Notice that a change ill the number of equilibrium solutions and the type of dynamic behavior oecured at 1.L;::;: Othe hUim'atioll poinl. The bifurcation point satisfies the conditions in (15.3):
!(X"fL,.)
{lnd
1.L;x,.
x',:
 0
ax
iJ/1
\,.l'
I
1.L"
364
Chap. 15
The slalc and parameter values that satisfy these conditions simultaneollsly are:
fl.,. ()
and
X"
=0
=6x""'0
a'I I ?
ax""!,,
and
ax}~",l'~
alII
(, I ()
This analysis indicates that the mnnber of solutions is three in the vicinity of the bifurcation point (sec (15.4) and (15.5)),
x
x~
stable
/.5
A~ 21'
x~
I'
unstable
A=
I'
I'
stable
FIGlJRE 15.2
It should be noted that there arc actually three solutions to the steadystate equation throughout the entire range of l..L values. For fJ... < 0, two of the solutions for Xc arc C'Hllplcx and uncis real. r:or fJ.. = 0, all three solutions for J:e arc zero. For f.L > 0, all three solutions for Xc are real.
Sec. 15.3
Types of Bifurcations
365
2 L_~.....,:,J o 2 3 4 5 FIGURE 15.3 Transient response for Example 15.1, /.L::::1. time
15.3.1
Dynamic Responses
Figure 15.3 shows the transient response for fJ,::;;: I for two different initial conditions; both initial conditions converge to the equilibrium solution of x = I. Figure 15.4 shows the transient response for JJ, = 1 for two different initial conditions; the final steadystate obtained depends on the inlial condition. Notice that an initial condition of X o :::: 0 would theoretically stay at x = 0 for all time, however, a small perturbation (say J 09 ) would eventually cause the solution to go to onc of the two stable steadystates. Example 15.1 illustrates pitchfork bifurcation behavior, where a single real (and stable) solution changes to threc real solutions. Two of the solutions are stable, whilc one is lln~table, It is easy to find cases where a (subcritical) pitchfork occurs, that is, where a single unstable solution branches lo two unstable and OIlC stable solution. For example, consider the system
j:
j(x,!'l
= fL<
+ x3
Example 1
J' = I
"0 =
0.5
0.Q1
1
"0 = 0
2
0 0.5
I
0.01
~
1.5
10
time
FIGlJRJ1: 15.4 Transient response for Example 15.1, IJ. =: l. The final steadystate reached depends ()n the initial condition.
366
Chap. 15
The reader is encouraged to find the bifurcation behavior of this system shown below (see student exercise 5).
2 r.,
0
1
21.5 1
1.5
Also, a perturbation of the pitchfork diagram can occur with the following system:
u;;:: 1
2
~
2
4
6
rou
EXAMPLE 15.2
\/;J:

x,,):
YJJ.
Sec. 15.3
Types of Bifurcations
367
which indicates that there are two solutions in the vicinity of the bifurcation point. Now, we can find the stability of the system, as a function of the bifurcation parameter, j..t,
I.
/.l <
O.
From
Xci
There are now two real solutions; we will analyze the stability of each one.
a. For solution J;
the eigenvalue is
the eigenvalue is
L,
Jl = a
.1l>.ble
,
uns1l>.ble
FIGURE 15.5
368
Chap. 15
Notice that there are actually two steadystate 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 > () both solutions for xl' arc real.
Dynamic Responses. Transient response curves for /L:= 1 are shown in Figure 15.6, for two different initial conditions. Initial conditiolls .ro > 1 converge to a steadyslate of x;;;; I, \vhilc .:ro < ~1 approach x = ~oo. It should he noted that a consistent physical (or chemit:al) ~bascd model will not exhibit this sort of unbounded hehavior, since the variables will have some physical meaning and will therefore be bounded.
Example 2.
Jl
=1
"0= 0
0.99
1
"0=0
_I
2
1.01
3
2
time
FIGURE 15.6 Transient response for Example 15.2, !L;;;: 1. Initial conditions or Xo > I converge to a steadystate of x;;;: 1, while Xo < I "blows up",
EXAIVIl']"E 15.3
Transcritical Bifurcation
.r
The equilibrium point is:
( loY)
The Jacobian is
Sec. 15.3
Types of Bifurcations
369
jJ.2x,.
fJ,
2
*0
which indicates that there are two equilibrium 1'>0Iu60I1s. Now, we can find the stabil1ty of the system, as a function of the bifurcation parameter, IJ.
with an eigenvalue:
A = fl.  2 x,.
which is stable (since IJ" is negative). b. This equilibrium solution is:
fl.,
II.
jJ.
2 }L"
These results are shown in the bifurcation diagram of Figure J5.7, which illustrates that the number of real solutions has not changed; however, there is an exchange of stability at the bifurcation point.
370
Chap. 15
L,
x=o
,\=j!,
x= j!, ,\ =j!,
stable
of,\=j!,
stable UIl.'ltable
x=o
,\ =j!,
UIl.'ltable
FIGIJRE 15.7
Transcritical bifurcation, Example 15.3.
Dynamic Responses. Transient response curves for the transcritical bifurcation arc shown in Figures 15.g and 15.9. Notice that the transient behavior is a strong function of the initial condition for the slate variable. For some initial conditions the state variable eventually settles at a stable steadystate, while for other initial conditions the state variable blows up.
Example 3.
j!,
= I
"0= 0.99
0.5
1
X
1
"0 = 
1.5 2 2.5
3
1.01
2
time
10
Flf;(JRE 15.8
J.L
Sec. 15.3
Types of Bifurcations
371
1
time
FIGUH.E 15.9 Transient response for Example 15.3, fJ. ;:;;; 1. Notice the importance of initial conditions.
The next example is significantly dillerent from the previolls examples. Here we allow Iwo parameters to vary and determine their effects on the system behavior.
EXAMPLE 15.4
Hysteresis Behavior
I. fJ;:;;; 1.
!(X,. fL) ~ 0 ~
II 
x,.  x,:
(15.10)
The steadystate inputoutput 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:
ax
ill I
XJl c
which is always negative, indicaling that there arc no bifurcation points and that all equilibrium points are stable for this system. Contrast this result with that for /L 0;;; I, shown next.
372
Chap. 15
,pie 3.
)l
=1
01
6
time
10
FIGURE 15.10
II. IJ;:;;; 1.
f(X,,,ll) ~ 0 ~ II + x,  x;
Notice that this is a cubic equation that has three solutions for xI' for each value of ple, consider u ;:;;; O.
ll.
(15.11)
For exam
At u;:;;; 0:
so,
x"
1,0, or I.
XC
"I, = 0,
x,,= 1,
Now we can vary the input, If, ovcr a range of values and construct a steadystate inputoutput curve. These results are shown on the diagram of Figure 15.10 (the easiest way to generate this figure is to create an Xc vector, and then solve Itt' = ~xc + x;. See student exercise 2).
Sec. 15.3
Types of Bifurcations
373
mu
2
1
..  ,..  ~ ......
'" O
\
~~
1
/
0
2 4
.~
3
15. t I
2
1
FIGUrU~
0=
r.
Notice that r<'igurc 15.11 cOiltains two saddlenode (or turning poioI) bifurcatio!l points (sec Example 15.2), The bifurcation (singular) points can be determined frolll the solution of:
( 15.12)
1 3
or,
x" = :!.::
(15.13)
whicll call he seen to be the x values at the upper and lower fuming points. Substituting (1:=;,13) into (15.11), we find thal the bifurcation points oc;_<;ur at the inp~!! values of lie ::::; 2/3\1\ as shown in Figure 15.10. N~)lice that for II. < 2/3V3 or II > 213\/3 there is only a single,. stable solution, while for 2/3"'/3 < II < 213Y'3 there arc three solutions; two arc stable and one is Ullstable. We have referred to the behavior of this cxarnplc as hysteresis behavior now let us show why.
Starting at Low Values ofu. Notice that if we begin with a low value of If (say, 3) a single, stable, steadystate value is achieved. If we increase II a slight amount (to say, 2.9), we will achieve a slightly higher steadystate value for x. As we keep increasing It, we will cO!l.!illue to achieve a new stahle steadystate valuc for x for each u. This continues untilll :::0 213V3, where we find that the stable solution "jumps" to thc top curve. Again, as we slowly increase II, the stable steadystate solution remains on the top eurvc.
374
Chap.15
Starting at High Values of u. Notice that if we begin with a high value of u (say, 3) a single stable steadystate value is achieved. If we decrease Ii a slight amount (to say, 2.9), we will achieve a slightly lower steadystate value for x. As we keep decreasing Il, we will con~inuc to achieve a new stable steadystate value for x for each u. This continues until /l = 2/3Y...1 where we find that the stable solution "jumps" to the bottom curve. As we slowly decrease Ii further, the stable steady~state solution remains on the bottom curve. This is termed hysteresis behavior, because the trajectory (path) taken by the state variable (x) depends on how the system is stattedup. Ajump discontinuity occurs at each "limit" or "turning" point (the saddlenode bifurcation points).
Discussion. Notice that there is a signific.1I)t difference between the inpUH)utput behavior exhibited in Figures 15.10 and 15.11. For fJ.'::::: ~1 (Figure 15.9), there is monotonic relationship between the input (Ii) and the output (x). For fJ.:::: 1 (Figure 15.10), there is a region of multiplicity behavior, where there are three values of the output (x) for a single value of the input (u). There has been a qualitative change in the behavior of this system as fJ. varies from ~ I to L The value of fJ. where this occurs is a hystersis bifurcation point. At this point the following conditions are satisfied (since there are three solutions in the vicinity of the bifurcation point):
f(x,l")
and
.af ) ..
<X
iJ.tj
The equations are:
a'f
*0
fJ. ~ 3x~
~6xe
~O
6
It is easy to show that, for a value of Ii
::::
*0
= /L" =
x"
which yields the plot in Figure 15 12, which is clearly a transition between Figures 15.10 and 15.1 L A three~dimensional plot of x versus u as a function of /L is shown in Figure 15.13. The behavior represented by this diagram is commonly known as a cusp catastrophe. At low values
Sec. 15.3
Types of Bifurcations
375
mu= 0
T~~'l~U.
" 0
1
FIGURE 15.12
of /L we observe monotonic inputoutput behavior, with a transition to multiplicity (hysteresis) behavior at JL :::: O. The turning points in Figure 15.13 can be projected to the /JIl plane to find the bifurcation diagram shown in Figure 15.14. A saddlenode (turning point) bifurcation occurs all along the boundary of the regions, except at the "cusp point" (J.L:::: 0, u:::: 0), where a codimcnsion2 bifurcation occurs. The term "codimensioll2" meal1~ that two parameter.~ (/J,u) are varied to
2
1 " 0
1
2 2
o
mu
u
:FIGURE 15.13
376
Chap. 15
achieve this hifurcation (Stwgatz, 19(4). The reader is encouraged to construct this diagrmn (sec student exercise 6).
1.5
0.5
~
one fixedpoint
three fixedpoints
a
0.5 1 1.5
1
0.5
0.5
1.5
mu
FIGURE 15.14
Two~pannnctcr (f.l,1I)
I
dir~
SUMMARY
We have studied the bifurcation behavior of some example single nonlinear ordinary
c=
cation parameter. The equilibrium (steadyslate) points afC The stability is determined by finding the eigenvalue, 'A, which is simply the Jacobian, ~flax lx,,,tLe' for a single equation system, JJ A is negative, the equilibrium point is stable. If "A.. is positivc, thc equilibrium point is unstable. A bifurcation diagram is drawn by plolting the equilibrium value of the state variahle as a function of the 11ifurcation parameter. [rthc c(]uilibrium ])oint is stable ("A..;:o;: D//fh I.r,_I.\( . < 0), a solid line is drawn. IT the equilibrium point is unstable, a dashed line is dr;'l\vn. The bifurcation points can be found by solving for i)/IJx.I.Y,.,jL" = 0 where l(x",J.l,,) O. Thcse same techniques can also be applied to systems of several equations, particularl) if the cquations can be reduced to a single steady~slate algebraic equation (in a single stale variable). This can he done for many simple chemical and hiochemical reactor problems.
Student Exercises
377
(~f Nonlinear
Strogatz, S.H. (1994). Nonlinear Dynmnics and Chaos. Reading, MA: AddisoIlWesley.
STUDENT EXERCISES
1. r'or the system in Exmnple 15.4:
x ~ f(X,fL)
.~
II +
[LX 
x'
with II ::::: 0 and fL = I, perform transient response simulations (using MATLAR) to show that the final steadystate obtained depends on the initial condition. 2. For the system in Example 15.4, we found that there are ranges of u where there are three equilibrium solutions for x (when fL =1). When solving for the roots of a cubic polynomial, either a complex analytical solution (see any math handbook) or a root solving routine (such as the MATLAR routine roots) must be used, Show how .t' can be considered the independent variable and u the dependent variable to obtain an easier analysis of this problem. Then, simply plot x versus u. 3. For the system in Example 15.4:
x ~ f(X,fL)
with fL ::::: 1, show that the "turning points."
saddle~node
II +
[LX 
x'
4. Consider the constant harvesting model of population growth (Hale & Kocak, 1991):
.r
~ f(x,k,c,h) ~ k x 
x2
where all of the parameters are positive. h is the rate of harvesting, while k and care intrinsic growth rate parameters, The problcm is, for fixed k and c, to determine the effect of the harvesting on the population. Since the population density cannot be negative, we are interested in solutions where x 2:: O. For a positive initial population density (xo) the population is exterminated if therc is a finite value of t such that x::::: O. Without finding explicit solutions of the differential equation, show the following: a. If h satisfies 0 < h <; k2/4c, then there is a threshold value of the initial size of the population such that if the initial size is below the threshold value, then the population is exterminated, If the initial size is above the threshold value, then the population approaches an equilibrium (steadystate) point. b. If h satisfies h > k2!4c, then the population is exterminated regardless of its initial size, c. Comment on the physical ramifications of palis a and b. Should models be used by State Fish and Game authorities to determine proper hunting and fishing Iim~ its?
378
Chap. 15
S. Show that the following system exhibits a pitchfork bifucation, with three real solutions (one stable, two unstable) for iJ < 0 and a single unstable real solution for fL > O.
.< =
2
f(X,fL) = fLx +
x'
,
o
1
~,
2
2
1.5
1
0.5
o
mu
0.5
1.5
x = f(X,fL) = II +
[LX 
xJ
Develop the cusp bifurcation diagram shown below. Find the values of if and /L on the boundaries between the one and three fixedpoint solution behavior.
.5
1.5
1
0.5
0.5
1.5
mu
~~~_ . _.
>r,_ _
lIIIblllll.
Student Exercises
379
x'
For a value of u :::: 1, develop the steadystate bifurcation diagram shown below. Find the values of x and jJ. where the saddlenode (turning point) bifurcation occurs. Notice that this is a perturbation of a pitchfork bifurcation. This type of behavior can occur, for example, in exothermic chemical reactors when the feed llowrate is varied whilc maintaining a constant jacket temperature (a soca.lled isola forms).
4
u ::;: 1
2
4
4
2
10
mu
APPENDIX
h
cusp diagram
% b.w. bcqucLtc
'I.
9 0
1~
dec 96
~;olvcs
the problem
::;: u + mu"'x x"3 0
'f;
f(x,u,mu)
" with x varying between 2 and 2 '1 mu varying from 2 to 2 and '!, whatever u' s r,<~ul t
clear x; clc,ar u; clear rnu; x 2;{)'05:2;
u x. "3 +2*x;
hold on
380
Chap. 15
16
The goal of this chapter is to introduce the reader to limil cycle behavior and the HopI" bifurcation. After studying this chapter, the reader should be able to Find that many of the same types of bifurcations that occur in singlestate systems also occur in twostate systems (pitchfork, saddlenode, transcritical) Understand the difference between limit cycles (nonlinear behavior) and centers (linear behavior) Distinguish between stable and unstable limit cycles Determine the conditions for a Hopfbifurcation (formation of a limit cycle) Discuss the differences between suhcritical and supcrcritica.1 HopI' bifurcations '1'he major sections in this chapter are: 16.1 16.2 16.3 16.4 Background SingleDimensional Bifurcations in the PhasePlane Limit Cycle Behavior The Hopf Bifurcation
16.1
BACKGROUND
In Chapter 15 we presented the bifurcation behavior of singlestate systems. 'A'e found that a number of interesting bifurcation phenomena could occur in these systems, including transcritical, pitchfork, and saddlenode bifurcations. We find in this chapter that these 381
382
Chap. 16
types of bifurcations can also occur in highcr~order systems. This is the subject of Section 16.2. In Section 16.3 we review limit cycle behavior, which was initially presented in Chapter 13 (phaseplane analysis). In Section 16.4 we present a type of bifurcation that can only occur in second and higherorder systems. In a Hopi' bifurcation, we find that a stable node can h(furcate to a stahle limit cycle if a parameter is varied; this is an example of a supercritical Hopf bifurcation. This phenomena has been shown to occur in a number of chemica! and biochemical reactors. Before turning to the interesting Hopf bifurcation phenomena, we will discuss single dimensional bifurcations in the phase plane.
16.2
XI = f,(X,fL) = fLXI  xi
x, =
f(X,fL) =
(16.1 ) (16.2)
f2(X,fL) = x,
IfLX~:,:t:,]
[~]
There are three solutions to f(x,f,t) ::::: O. The trivial solution is:
and
Xc
[~;:] = [  :~I
Notice that only the trivial solution exists for j.J.. < 0, since we will assume that equilibrium values must be real (not complex). We can detenninc the stability of each equilibrium point from the Jacobian, which is:
I
which has the following eigenvalues:
= fL A2 = I
Al
3xj"
Sec. 16.2
Single~Dimensional
Bifurcations in the
Phase~Plane
383
Since the second eigenvalue is always stable, the stability of each equilibrium point is de~ termincd by the first eigenvalue. Here we consider three cases, fJ, < 0, f.L:::::: 0, and fJ, > o.
J.L<O
The only equilibrium solution is the trivial solution (xli'::::: 0), so: Al = /L  3x1e = f.L
which is stable, since J.L < O.
II
J.L
=0
:::::
0, so:
~I =
J.L  3xt
which is stable; the system can be shown to exhibit a slow approach to equilibrium by observing the analytical solution to the differential equations.
III
J.L > 0
is unstable since p.. > O. The eigenvalues for the nontrivial solutions (\Iii) are:
and
So 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, = [:;;] = [ 
= [
~2tj
=
stable node
x ,. =
x" Ix"1
_I, [J.L]
saddle pomt .
IxX".j
2,<
., =
~2,
I' 2J.L1 I
_
stable node
We notice the following phaseplane diagrams (Figure 16.1) as f.L goes from negative to positive.
384
mu= 1
Chap. 16
0.5
~~
0.5
~~
0.5
1
0.5
1
x,
a.
IJ
x,
<
b.
u >
FIGURE 16.1 Pitchfork bifurcation behavior in the plane. There is a single stahle node for /L < 0, and two stable (0) nodes and a saddle point (+, unstable) for 11 > 0,
16.3
0.5
x,
0.5 1 1.5
1
a
x,
Sec. 16.3
385
0.5
x,
0 0.5 1 1.5 1 0
x,
Example of limit
(Figure 16.3) behavior is that limit cycles are isolated closed orbits. By isolated, we mean that a perturhation in initial conditions from the closed cycle eventually returns to tbe closed cycle (if it is stable). Contrast that with center behavior, where a perturhation in initial condition leads to a different closed cycle.
EXAMPLE 16.1
II
Notice that these equations are decoupled, that is, the value of ret) is not required to find OCt) and vlee versa. The second equation indicates that the angle is constantly decreasing. The stability of this system is then determined frotH an analysis of the first equation. The steadystate solution of the first equation yields two possible values for r. The trivial solution is r;o;; () and the nontrivial solution is r"'" 1. The Jacobian of the first equation is:
of ar
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 out close to r"'" 0 will move away, while any solution that starts out close to r;o;; I wiH move towards r;o;; I. The time domain behavior for x [ is shown in Figure 16.4, Notice that we have convelicd r cos 0, x2 "'" r sin 0). The phaseplane behavior is the states to rectangular coordinates (XI shown in Figure 16.5. Initial conditions that are either "inside" or "outside" the limit cycle converge to the limit cycle.
;0;;
386
1.5
Chap. 16
0.5
1
10
20
time
30
40
FIGVRl\ 16.4
1.5
0.5
.;;: 0
0.5
X,
The previous example was for a stable limit cycle. It is also possible for a limit cycle to be unstable, as shown in Example 16.2.
EXAMPLE 16.2
r
(j
r(lr')
I
(16.5)
(16.6)
Again, notice that these equations are decoupled. The second equation indicates that the angle is constantly decreasing. The stability of this system is then determined 0"0111 an analysis of the first equation.
Sec. 16.3
387
0.5
0.5
1
1.5
l ~!
..
~.~
...
................
....
1
x,
FIGURE 16.6
o
unstable limit cycle.
Phase~plancbchaviorfor all
The steadystate solution of the first equation yields two possible values for r. The trivial solution is r ::;: 0 and the nontrivial solution is r::;:: I. The Jacobian of the first equation is:
iif ()r
~1+3r2
We sec then that the trivial solution is stable, because the eigenvalue is negative (1). The nontrivial solution is unstable, because the eigenvalue is positive (+2), Any trajectory that stalts oul less than r = I will converge 10 the origin, while any solution that starts out greater than r ::::1 will 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.5
o o
_1...._
.. L
L..
3
time
FIGURE 16.7 Time domain behavior for an ullstable limit cycle. An initial condition of 1'(0) = 0.9 converges 10 0, while an initial condition of r(O) = 1.05 blows up.
388
Chap. 16
Examples 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 trajectories were "repelled" from the limit cycle. Although hoth of these examples yielded limit cycles that were circles in the plane, this will not normally be the casco Usually the limit cycle forms morc of an ellipse. Now that we have covered limit cycle behavior, we arc rcady to determine what types of system parameter changes will cause limit cycle behavior to occur. That is the subject of the next section.
16.4
EXAMPLE Hi.3
SupercriticallIopf Bifurcation
i] =
Xl
+ Xl (p" 
xf  xi)
( 16.7) ( 16.8)
.<,=
(fJ.  r 2 )
(16.9)
o~
;. =
I
(16.10)
Since these equations are decoup1cd, thc stability is dctcrmined from the stability of:
af
ar
/.L  3,.2
Sec. 16.4
389
\ifL
For /L < 0, only the trivial solution (r:;::: 0) exists. For Il < 0,
which is stable, since /L < O. 1<'01' /L::::O 0, all of the steadyslale solutions
,lrC r:;:::
3 r'
which is stable, but has slow convergence to r";=: O. For 11, > 0, the trivial solution (r::::o 0) is unstable, because:
2fL
and we find the following phaseplane plots shown in Figure 16.8. The bifurcationdiagram for this system is shown in Figure 16.9.
1.5
0.5
~\.
1 0
1.5~~
0.5
~)/
1.5 1
1.5
x,
x,
a.
f"~1
b'I.c~ 1
F1GlJRE 16.8 Phaseplane plots. As J.l goes from 1 to I, the behavior changes from stable node to a stahle limit cycle.
390
Chap. 16
1.5
l....
0.5
o_~~

0.5
~1 ~~~~.l~~~~
2
1
mu
FIGURE 16.9 Bifurcation diagram. Indicates that the origin (r 0) is stahle when Il < O. When Il > 0 the origin becomes unstable, but a stable limit cycle (with radius r::::: \/iL) emerges.
:;:;;0
Here we analyze this system ill rectangular (xI point or equilibrium) solution to (16.7) and (16.8)
steady~stalc
(fixed
atl _
dX j
ax,
2 Xl
{,
=12x x;
J
dX)
[ ~'
xL
2x l "X 2,
12\:I,X'1
llx~,.3
Sec. 16.4
391
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 righthalf plane is shown in Figure 16.10.
+++
~ <
~ =
~ >
FIGURE 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 the righthand side of the complex plane.
Example 16.3 was for a supercritical Hopf bifurcation, where a stable limit cycle was formed. We leave it as an exercise for the reader (student exercise 6) to show the formation of 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 complex eigenvalues became zero. In Example 16.3 the eigenvalues crossed the imaginary axis with zero slope, that is, parallel to the real axis. In the general case, the eigenvalues will cross the imaginary axis with nonzero slope. We should also make it clearer how an analysis of the characteristic polynomial of the Jacobian (A) matrix can be used to identify when a Hopf bifnrcation can occur. For a twostate system, the characteristic polynomial has the form:
a 2(fl.) ),,2
where 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.) parameters do not become 0 for the same value of fl.. It is easy to show that a Hopf bifurcation occurs when a,(fl.) = 0 (see student exercise 7).
16.4.1
Thus far we have discuss Hopf bifurcation behavior of twostate systems. Hopf bifurcations can occur in any order system (n ;:::: 2); the key is that two complex eigenvalues cross the imaginary axis. while all other eigenvalues remain negative (stable). This is shown in Figure 16.11 for the three state case.
392
Chap. 16
o o
+
~t
:=
p < 0
~fp > 0
FIGURE 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 the righthand side of the complex plane.
SUMMARY
In this chapter we have shown that the same bifurcations that oeemed in singlestate sys~ tems (saddlenode, transcritical, and pitchfork) also occur in systems with two or more states. We have also introduced the Hopf bifurcation, which occurs when cmnplcx cigcn~ values pass from the lefthalf plane to the righthalf plane, as the bifurcation parameter is varied. A HopI' bifurcation can also occur ill systems with more than two stales. F,'or a SllpcrcriticalHopf bifurcation, two complex conjugate eigenvalues cross from the lefthall' to the righthall' plane, while all of the other eigenvalues remain stable (in the lefthalf plane).
FURTHER READING
The following sources provide general introductions to bifurcation theory: Hale, 1., & H. Kocak (1991). DYl/mnics and H{flfrcatiol1s. Nc\v 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 bifurcations in a 2state exothermic chemical reactor model: Varma, A., & M, Morhidclli. (1997). Mathematical Methods in Chemical Engineering. New York: Oxford University Press.
STUDENT EXERCISES
1. Show that the twovariable system
\1 ~ J;(x,f.l) IL  xi
.r,
~t;(x,f.l)
 x,
Student Exercises
393
x, = f,(x,fL) =
x,
=
/LX,  xl
f,(x,fL) = x,
exhibits tnmscritical behavior in the phase plane. 3. Show that the twovariable system:
x, = f,(x,fL) = x, = J;(X,fL) =
x\e
Ii
+ x, 
xi
x,
exhibits hysteresis behavior in the xl state variable. This means that, as u is varied, folJows an Sshaped curve, which exhibits the ignition/extinction behavior shown in Chapter 15. 4. Show that:
can be written:
;. = ,.
(fL  r')
0=1 if Xl = r cos () and x 2 = 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 r2
Discuss how w affects the direction of rotation. Also, discuss how b relates the frequency and amplitude of the oscillations. 6. Consider the following system, which undergoes a subcritical Hopi' bifurcation:
r= Ii =
/L
w
r +
,3 
r5
b,.'
Show that, for IJ < 0 an unstable limit cycle lies in between a stable limit cycle and a 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 equation
is a l (!J) = O. This is easy to do if you realize that a HopI' bifurcation occurs when the roots have zero real portion and write the polynomial in factored t~)rll1.
394
Chap. 16
tr(A(fL) ),
+ dct(A(fL = 0
s.
Consider a Hopf bifurcation of a threestate system. Realizing that one pole is negative (and rcal) and that the other two poles arc on the imaginary axis, relate the Hopf bifurcation to the coefficients of the characteristic polynomial of the Jacobian matrix arc:
You can assume, without loss of generality, that a 3 (/L) = 1. How do the conditions on the polynomial coefficients relate to the conditions on the Jacobian matrix (trace, determinant, etc.)?
17
The objective of this chapter is to present the Lorenz equations as an example of a system that has chaotic behavior with certain parameter values. After studying this chapter, the reader 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 to model. Understand how the system behavior changes as the parameter r is varied. 'fhe major sections in thi:; chapter arc',
17.1 17.2
J 7.3
J 7.4
Introduction Background
The Lorenz Equations Stability Analysis of the Lorenz Equations Numerical Study of the Lorenz Equations Chaos in Chemical Systems Other [ssucs in Chaos
J 7.5
(7.6 17.7
395
396
Chap. 17
17.1
INTRODUCTION
In 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 that when the qualitative behavior of a system changes as a function of a certain parameter, we refer to the parameter as a b(lurcalion parameter. As the growth parameter was varied, the population model went through a series of perioddoubling behavior, finally becoming chaotic 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 model is autonomous). In this chapter we study a continuous model that has probably received the most attention in the study of chaosthe Lorenz equations. Before we write the equations, it is appropriate to give a brief historical perspective on the Lorenz model. For a more complete history, sec the book Chaos by James Cjlcick (1987).
17.2
BACKGROUND
In 1961, Edward Lorenz, a professor of Meteorology at MIT', Was simulating a reducedorder model of the atmosphere, which consisted of twelve equations. Included were functional relationships between temperature, pressure, and wind speed (and direction) among others. He performed numerical simulations and found recognizable patterns to the 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 entire simulation over, he typed in a set of initial conditions based on results from midway through thc previous run, started the simulation and walked down the hall for a cup of coffee. When he returned, he was shocked to find that his simulation results tracked the previous run for a period of time, but slowly began to diverge, so that after a long period of time there appcnred to be no conclation between the runs. His first instinct was to check for a computer error; when he found none, he realized that he had discovered a very important aspect of certain types of nonlinear systems~that of extreme sensitivity to initial conditions. When he had entered the new initial conditions, he had done so only 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 period of time, to the point where the two fUllS did not look similar. This discovery led to the realization that longterm prediction of certain systems (such as the weather) will never bc possible, no matter how many equations are used and how many variables are measured. In order to learn more about the behavior of these types of systems, he reduced his model 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, while Section 17.3 presents the equations and discusses the equilibrium solutions and stabilty of the equations.
Sec. 17.3
397
T,
FIGURE 17.1 Convection rolls due to a temperature gradient in a fluid where density decreases as a function of temperature (1'1 > 72),
Consider 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 is no 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 greater than the buoyancy forces (the tendency for the less dense Huiet at the bottom to move toward the 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 nuid begins to move and form convection rolls. As the temperature difference is increased, the fluid movement becomes more and more vigorous. Although the following point may be less clear to the reader, for some systems there 1sa value of temperature difference that will 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 the ilow pattern of Figure 17.1.
17.3
x, =
X2
<r(x, ~ Xl)
(17.1)
r Xl  X 2  X I X 3 X3 = hx] + X l X 2
=
(17.2) (17.3)
Notice that the only nonlinear terms are the bilinear terms x Jx 3 in (17.2) and xlx2 in ( 17.3). The state variables have the following physical significance: proportional to the intensity (speed) of the convective rolls x2 = proportional to the temperature difference between the ascending and descending currents = proportional to distortion of the vertical temperature profile from linearity x3
XI
398
Chap. 17
Three parameters,
(J ::::::
Prandtl number (ratio of kinematic viscosity to thermal conductivity) a geomctic factor related to the aspect ratio (height/width) of the convection roll
r b
::::: ratio of the Rayleigh number, Ra, to the critical Rayleigh number, Rae
Ra =
galP!::.T vI<
a = coefficient of expansion
11 = distance between plates
gravitational acceleration g !::.T = temperature difference between the plates (T 1 ~ T 2) v = kinematic viscosity I< = thermal conductivity For a fixed geometry and tluid, Ra is a dimensionless measure of the teo1peraturc difference between the plates. For 0 ::; r < I (Ra < RaJ the temperature difference is not large enough for the buoyancy forces to overcome the viscous forces and cause motion. ['or r> 1 (Ra> Rae) the temperature difference is large enough to cause motion.
17.3.1
The Lorenz equations have three steadystate (equilibrium) solutions under certain condi~ tions. First, we present the trivial solution, then the nontrivial solutions. In Section 17.4 we will determine the stability of each equilibrium solution.
TRIVIAL SOLUTION
By 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 SOLUTIONS
From (17.1) we find that: (175) Substituting (17.5) into (17.3), we find thatx" =
~ xi" or:
(17.6)
Sec. 17.4
TABLE 17.1
399
Nontrivial 2
(I' > 0 required)
State Variable
Trivial Solution
(r> 0 required)
o o
o
Vb (r ~ I)
Vh(r~ 1)
Vb(~~ I)
r
1
Vj)~ r  I
steady~statc, we
find',
(17.7)
and substituting (17.7) into (17.6) and using tbe results of (17.5):
I)
(17.8)
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 convective flow. The equilibrium behavior is slIlllllwrizcd in Table 17.1.
17.4
( 17.9)
17.4.1
(17.10)
400
Chap. 17
"A
del(A/ A)
I':,"
cc
 <f
A+
o o
A+h
A+ 1
o
I'
I
(17.11 )
(A + h) IA.+ <r
<rl
A2
+ 1  V(<r
2
( 17.13)
(17.14) Clearly, the first eigenvalue is always stable, since b > O. It is also easy to show that the second and third eigenvalues can never he complex. The second eigenvalue is always negative and the third eigenvalue is only negative for r < I. We then sec the following eigenvalue structure for the trivial (no flow) solution
17.4.2
Here we find the roots of det(AJ  A) = 0 for the nontrivial solutions. Starting with:
AI A
I:,' ';
 ):2s
<r A+ I
~XIs
XIs
o ]
( 17.15)
A+ h
A' + "21\.2 + hi A + IJ o
(17.16)
Sec. 17.4
where:
401
Recall that real nontrivial solutions only exist for r > I.Thc coefficients b 2 , hi' and ho arc then all positive, satisfying the necessm)' condition for stability. The Routh array must be lIsed to check the sl{1I1Cienf condition for stability. As derived in the appendix, the critical r for stability is:
r 11
=
<T
+
(IT
~
h + b  I)
(17.20)
If r > /)/, then the stability condition is not satisfied. This is an interesting result, because
it Incal1s that nOlle of the cquibrium solutions (trivial, nontriviall, nontrivial 2) is stable
for r> rl! The subscript His llsed in (17.20), because a Hopf bifurcation forms at that
value (sec student exercise 1). If a supercritical Hapf bifurcation occurred, a stable limit
cycle would form, yielding periodic behavior for the nontrivial solutions. It turns out that .<1 suhcrificalllopf birfurcation is formed, that is, the limit cycle is unstable (sec Strogatz for a nice discussion). Since there arc no stable equilibrium points for r > 1'/1, and no stahle limit cycles, the solution "wanders" in phase space, never repeating the same trajectory. This behavior is known as chaos and the solution is said to be a strange atfracfor.
17.4.3
We have seen that for r < 1 there is only one real solution, the trivial solution, and it is stable. When r =1 there is a pitchfork bifurcation, yielding three real solutions for r> 1. The trivial solution is unstable for r > 1, while the nontrivial solutions arc stable for 1 < r < rHo This behavior is shown clearly by the bifurcation diagram shown in 1,'igurc 17.2. The formation of the unstable limit cycle at I' = 1'/1 is discussed by Strogatz.
15
unstable limit cycle
10
5
c:
"
0
5
10 15
25
r
30
FIGURE 17.2 Bifurcation diagram for the Lorenz equations. Based on parameters in Section 17.5.
402
Chap. 17
17.5
3 r c. 28
from (17.22) we calculate that I'll ::;: 470/19 ; : : ; 24.74, indicating that all of the equilibrium points arc unstable, since the value of r::::: 2S is greater than rJl" Before we continue with the set of parameters that Lorenz used to illustrate chaotic behavior, we will first pcrfonn sinlulations for two other cases. ]n the first, we show a set of conditions where the trivial solution is stahle. In the second, we show a set of conditions where the nontrivial solutions are stable.
17.5.1
We have found that the trivial steadystate is stable for 0 s: r < I. llerc we use the u and b parameters used by Lorenz, but set r:::: 0.5 ror a stable trivial steady~state.
(J
10
/,
X
3
0.5
As in future simulations, we assume an initial condition oLto ;;;: 10 1 Ol"r, A time dornain plot for all threestate variables is shown in Figure 17.3, and a phaseplane plot (x3 vs. tl) is shown in r<'igure J7.4. The convergence to equilibrium occurs rapidly.
0.8
0.6
~
0.4
0.2
0 0 2 4 6
10
FIGURE 17.3
Sec. 17.5
403
0.2
0.15
'P 0.1
0.05
0.1
0.2
0.3
0.4
Xi
Q5
0.6
0.8
0.9
FIGURE 17.4
(x]  xJ plane).
17.5.2
We have found that the nontrivial steadystates arc stable for 1 < r < r l1 " IIcrc we use the and b pannnctcrs used by I"orenz, but set r::: 10 (recall that r ll ::: 24.74 for these values of (J and b) to show that the nontri vial steadystates arc stable.
IT
iT
= to
h=
8 3
r = 21
as expected, the trivial steadystate is unstal?h.:~(~saddlc_l?9Jrlt). The.nontrivial steadyslates, x = lV160/3 V160/3 201 1 and x  vu,0/3 20r', have eigenvalues of:
= [
V160/3
A,
13.4266
1.. 2 = 0.1200
+ 8.9123j
A;
O.l2008.9123j
verifying that the nontrivial steadystates are stable. Time domain plots for x J are shown in Figure 17.5, for r:::; 21 Hnd two difTerent initial conditions. Notice that convergence to a particular equilibrium point depends on the initial condition, that is, plot a converges to one equilibrium point. while plot h converges to a different equilibrium point. Also notice that plot b exhibits what is known as transient
404
Chap. 17
20 15 10 5
"
~
0
~5
10 15 20 0 5
time
8.
40
r 21, Xo = [0
0:;:.
OjT.
20 15 10
5
r"21,xo "
[~20;10;10)
5
10 15 200 5ioi5~20time 25 30 35
40
FIGURE 17.5 Lorcnz cquations under conditions for stable nontrivial solutions.
chaos. Thc initial trajcctory appears chaotic, but eventually the tr(~jectory converges to an equilibrium point. In othcr systems thc systcm can exhibit transient chaos and settle into periodic behavior. The phase plane diagram of Figure 17.6 also clearly shows the effect of two different initial conditions. In curve a thc trajectory almost immediately goes to the equilibrium point on the right (positive value of xl)' In curve b the trajectory first winds around the left equilibrium point, switches to the right equilibrium point, and (after going back and folth a fcw times) evcntually winds around the left equibriulll point, slowly converging.
Sec. 17.5
405
35
30
25 20 15 10
,
~~~~~
5
2015
10
5
Xi
10
15
35
r = 21.
~
Xo
= [20;10;1 OJ
.~~~.
30
25 20
!i'
15 10
5
20
:15:.,lnO~~5"O 5~~TDt5Xi
20
b.r=21.xo =[20
10
10l T
FIGURE 17,6 Phase plane under sl<t" ble conditions for the nOlltrivial solutions.
17.5.3
Chaotic Conditions
lO
b~
8 3
28
Recall that all of the equilibrium points are unstable, since the value
or r::::: 2X
is greater
than
FJ!>
406
Chap. 17
2.67
vn
[Vn vn
sa441c poiJlt).
271' and x
[ V72
/..,   13.8546
/..2 = IW940 = 10. I 945j /..3 (W940 + H1l945j
indicating that the nontrivial stcady~slatcs arc unstable. Notice that all of the steadystate operating points are unstable. '{'his means that the curves in the threedimensional "phasecube" plots will not asymptotically approach any single equilibriulll point. The curves may exhibit periodictype behavior, where the threedimensional equivalent of a limit cycle is reached. The curves could even have "quasiperiodic" behavior, where the oscillations appear to have two frequency componcnts. It turns out for this set or parameters that. the curves ncver repeat. The curves have a strange affractor because they stay in a certain region of threespace, but never intersect or repeat. This is known as chaotic I)chavior. Figure I?? shows the Lorenz behavior for the "Yr variable under unstable (chaotic) conditions. The initial condition is xo :::: [0 1 Orr. Plots of the other states (x2 and ''\:3) arc similiar. Figure 17.7 was 11 time domain plot for Xl under chaotic conditions. More interesting results arc also shown in the following phaseplane diagram (Figure 17.8). Notice that the trajectory will spend some time "winding around" one equilibrium point, before jump~ ing to the other side and winding around the other equilibrium point for a while. This process goes on forever, with the trajectory never crossing itself (in 3space).
Lorenz E<lualiOllS,I
20
15
= a 10 I = 50
10
5
"
a
5
10
15
20
a
time
40
50
FJGllRE 17.7
Sec. 17.6
50
407
40
30
20
10
20
15
10
5
a
x,
10
15
20
FIGlJRE 17.8
'rhe development of the curve in FigUfC17.8 is shown more clearly in the phaseplane plots in Figure 17.9, which show varies "pieces" of time. A threedimensional plot (phase cube) of this trajectory is shown in Figure 17.10. The reader is encouraged to perform simulations of the Lorenz equations, to be understand concepts such as sensitivity to initial conditions. MATI,AB has a demo titled lorenz. m (simply enter lorenz in the command window) that traces a threedimensional plot of solutions to the Lorenz equations. Each new run uses a new set of random initial conditions. If you write an mfile to simulate the [,orenz equations using ode45, remember to use a name lhat is different than lorenz .m, to avoid conniels with the MATLAB clemo.
17.6
408
Chap. 17
,
'" '"
()~,,
7.11
1.\
111
III
l~
211
(~O (0
(~5
"
(010
41)
"'1'~
'"
:10
T
'"
0_}II 15 10
'm
111
"
(~1O(015 (~15
'"
(020
IS
JII
~~
HI
\<;
20
(~20(025
(~25(o30
"
.10
In
(~
30 (035
(~
35 (040
"
FIGURE 17.9
Sec. 17.7
409
5H
'"
)11
11)
'"
40 to 45
FIGURE 17.9
'" '"
t=
"
"
t
C'ol/iit/lled
= 45 to 50
17.7
=:
28, Xo
[0;1;OJ
60
40
20
o
50
o
~
~~20 10
50
20
10
x,
FIGURE 17.10 Threedimensional phase space plot of Lorenz equations under chaotic conditions.
410
Chap. 17
[ssucs that may be of particular interest include: How docs onc detect chaos experimentally? One method is to lise experimental data to calculate Lyapwwv exponents. See Strogatz for example. Chaos can be used to encode secret messages. See Cuomo and Oppenheim (199.)). who used ideas presented by Pecora and Carroll (1990).
SUMMARY
We have presented an introduction to chaotic behavior by studying the Lorenz convective flow equations. A number of chemical processes have been shown to exhibit similar be~ havior. It is necessary to have three nonlinear autonomous differential equations before chaos can occur. Although not shown here, chaos call occur in a system of two nonlinear IlOIl(lutonO!1lOUS equations (that is, if some type of periodic input forcing is used), Also. we saw in Chapter 14 that chaos can occur in a single discrete nonlinear equation (the quadratic map, or logistic equation),
II
The first paper to develop the notion of sensitivity to initial conditions is by Lorenz. Lorenz, E.N. (1963). Deterministic nonperiodic flow. Journal ences, 20: 130141.
(~lAtnlOsphcric Sci
in~
Strogatz, S.H. (1994). NOlllinear Dynainics and Chaos. Reading, MA: AddisonWesley. A review of nonlinear dynamic behavior (including Chaos) of chemical reactors is provided by: Razon, L.l'., & R.A, Schmitz. (1987). Multiplicities and instabilities in chemically reacting systemsA Review. Chel1l. Eng. Sci., 42(5): 10051047. A large number of papers on chaos have been collect in the following book: Hao, BaiLin. (Ed,). (1990), Chaos fl. Singapore: World Scientific Press.
Student Exercises
411
Papers that develop a way of encoding secret messages using chaos arc: Pecora, L.M., & T.L. Carroll. (1990). Synchronization in chaotic systems. Physical Neview Leflers, 64: 821. Cuomo, K.M., & A,v. Oppenheim. (1993). Circuit implementation of synchronized chaos, with applications to communications. Physical Reviell Leflers, 71: 65.
J
STUDENT EXERCISES
1. Consider the following parameter values for the Lorenz equations:
" ~ 10
~ f, ~
470/19
24.74
8 b ~3
For the nontrivial solution, show that a supercritical Hopf bifurcation occurs at this value of r. That is, for r < r e, all eigenvalues arc stahle, for r::::: r c' two eigenvalues arc on the imaginary axis, and for r > rc' two eigenvalues have crossed into the right half plane. 2. Show the sensitivity to initial conditions of the Lorenz equations. Run two simulations with the parameter values shown in the numerical study
x2  x J
x l +ax2 b + x,(x\
~
x2 = x, =
c)
which have a single nonlinear terlll. Let the parameters a and h be constant with a value of 0.2. Usc simulations to show that this system has periodI (limit cycle), pcriod2, and periodA behavior for c::::: 2.5, 3.5, and 4, respectively. Show that chaotic behavior occurs for c :::: 5,
412
Chap_ 17
APPENDIX
Stability analysis of the nontrivial steadystate using the Routh array:
Row I 2
"2
3
4 Where
hi)]  b o h,l.
I)
()
hi
~(r+,,)"
b2 =<r+h+1
Since the nontrivial steadystate only exists for 1';:: I, then bo is ahvays positive. It also follows that hi and b 2 will always he positive. The only entry from the Routh array that we must check is the first column in row 3. This entry will he positive if:
h2h J
bo > 0
or
h 2b 1 > b o
(A2)
I
3)
(Al)
or,
(A 4)
r<
,,(,,+h+
('T  h I)
fl.)!"
(A5)
Notice from (A3) that if (J < b + I, then any,. satisfies the requirement will often define the critical value, rc:
stability. We
(A6)
________________
~~~
__
~_~_~
..~ _ _....... A
SECTION
IV
INTRODUCTION TO MATLAB
MODULE
The purpose of this module l is to review MATLAB for those who have used it before and to provide a brief introduction to MA'fLAB for those who have not used it hefore. This is a handson tutorial introduction. Arter using this tutorial, you should be able to:
r';nter I1latriccs
Make plots Write script files Perform Inatrix operations Usc MATLAB functions Write function files The m'ljor sections of this module arc:
Background Using This Tutorial Entering Mali"ices The MATLAB Workspace Complex Variahles Some MA'rLAB Operations
IGood references include Introductioll to 11.1;\ 7V\U for E'flf;ineers (ind Scicntisfs by D.M. EtLer (PrenticeHall, 19(6), and Mas/eriflg MArLA/; byD. Hanselman and 13. Littlefield (PrcnticcHall, 1996).
415
416
Introduction to MATLAB
Module 1
M1.7 MI.R
MJ.9
M I.J()
Plotting More Matrix Stuff FOR Loops and IFTHEN Statements mfilcs Diary
Toolboxes
Limitations to Student MATI,AB Contacting MATHWORKS
M1.1
BACKGROUND
MATL,AB is an interactive program for numerical computation and data visualization. It was originally developed in FORTRAN as a MATrix LABoratory for solving numerical linear algebra problems. The original application may seem horing (except to linear algc~
bra enthusiasts), hut MATLAB has advanced to solve nonlinear problems and provide
de~
tailed graphics. It is casy to usc, yet vcry powerful. A few short commands can accoll1~ plish the same results that required a major programming effort only a few years ago.
M1.2
Monaco font
the prompt for a user input is shown by the double arrow
MATLAB has an extensive online help facility. For example, type help pi at the prompt
)) help pi
PI PI c, 4*atan(I)
~
3.1415926535897 ....
'IT
help exp
Sec. Ml.3
Entering Matrices
417
sometimes you do not know the exact command to perform a particular operallon. In this case, one can simply type
help
and MATI,AB will provide a list of commands (and m~files, to he discussed later) that are available. If you do not know the exact command for the function that you arc after, another useful cOllltnand is lookfor. This command works somewhat like an index. If you did not know the cOlnmand for the exponential futlction was exp, yOli could type
lookfor exponential Exponential Matrix exponential. Matrix exponential via Pade' approximation. Matrix exponential via Taylor series approximation. Matrix exponential via eigenvalues and eigenvectors. Used by LINSIM to calculate matrix exponentials.
M1.3
ENTERING MATRICES
The basic entity inMATLAB is a rectangular matrix; the entries can be real or complex. Commas or spaces are used to delineate the separate values in a lnatrix. Consider the following vector, x (recall that a vector is simply a matrix with only one row or column):
x =
[1,3,5,7,9,11]
11
Notice that a row vector is the default inMATLAB (in contrast to the default column veclor lL"lcd by this and most other texts). We could have used spaces as the delimiter between columns:
x
[1
11]
x
1
11
There is a faster way to enter matrices or vectors that have a consistent pattern. ['or example, the following command creates the previous vector:
X
=
1:2:11
11
418
Introduction to MATLAB
Module 1
Transposing a row vector yields a column vector (, is the transpose command in MATLAB):
"
y
y
~
x'
1 3 5 7 9 11
If we want to make x a columnvector, we usc a semicolon as the deli meter between rows:
" x x
~
[1;3;5;7;9;11]
1
3
5
7 9
11
To make x a row vector again, we usc the transpose:
X
0=
x'
Say that we want to creale a vector z, which has clements from 5 to 30, by 5s:
Z ::::
5:5:30
z
5
10
15
20
25
30
If we wish to suppress printing, we can add a semicolon (i) aftcr any MA TLAB command:
Z ::::;
5:5:30;
The z vector is generated, but not printed in the command window. We can find the value of the third clement in the z vector, Z (3) , by typing
Sec. M1.4
419
" 2(3)
leaving 621420 bytes of memory free. More detail abollt the size of the matrices can be obtained by typing:
Size
1 1 6 1
~
Total
1 6 1 6 1 6 6 6
Complex
No No No No
Y
2
by by by by
152 bytes,
leaving 622256 bytes of memory free. We can also find the size of a matrix or vector by typing:
[m,n};;;:size(x)
1
where ill represents the number of rows and n represents the number of columns. If we do not put place arguments for the rows and columns, we find:
420
Introduction to MATLAB
Module 1
size (x)
ans
1 6
Since x is a vector, we can also usc the length command " length(x) ans
6
It should be noted that MATLAB is case sensitive with respect to variable names. An X matrix can coexist with an x matrix. You may wish to quit MATLAB but save your variables so you don't have to retype or recalculate them during your next MATLAB session, To save all of your variables, usc:
save
file~Dame
(Saving your variables does not remove them from your workspace; only clear call do thall You can also save just a few of your variables:
save file__name x y z
Sometimes it is desirable to clear all of the variables in a workspace. This is done by simply typing:
clear
clear x
This is particularly true if you arc performing a new calculation of x and the new vector is shorter than the old vector. If the new vector has length fl, then all of thc clemcnts of thc new x greater than x(n) will contain values of the previous x vector.
Sec. M1.6
421
\1=1, by default:
ans
+ 1.0000i
ans
+ 1. OOOOi
sqrt (3)
;=
ans
+ 1.'73211
Note that these variables (i and j) can he redefined (as the index in a for loop, for CX~ ample), as will be shown later. Matrices can be created where some of the clements arc complex and the others arc real:
a [sqrt(4) {
lisqrt(~4),
5]
a
2.0000
+ 2.00001
1.0000 5.0000
[1 2 3;4 5 6J
1 4
2 5
3
6
422
C ;:;,
Introduction to MATLAB
Module 1
a *b
c
6.0000 9.0000 12.0000 20.0000 + 2.0000i 25.0000 + 4.0000i 30.0000 + 6.0000i
Notice again that MATLAB automatically deals with complex numbers. Sometimes it is desirable to perform an elementbyelenwnt multiplication rather than matrix multiplication. I,'or example, d(iJ) = b(ilj)*CUlj) is performed by llsing the k command
d:::o c. *b
(Notice the scaling that is performed when the numbers arc displayed.) Similarly, clement by clement division, b(i\i)Ic(iJ), can be performed using. /:
)) e :::; b.le
e
0.1667 0.1980  0.0198i 0.2222 0.1950  0.0312i 0.2500 0.1923  0.0385i
Other matrix operations include: (i) taking matrix to a [lower and (ii) the matrix exponential. These arc operations on a square matrix:
a/,2
1\11.7
PLOTTING
For a standard solid line plot, simply type:
plot (x, z)
Sec. M1.7
Plotting
423
1:2:11; 5:5:30;
30 25 20
~
15 10 5 0 2
4
10
12
xlabel ('x')
ylabel ( , z ' )
help plot
PLOT
Plot vectors or matrices. PLOT(X,Y) plots vector X versus vector Y. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever lines up. PLOT(Xl,Yl,X2,Y2) is another way of producing multiple lines on the plot. PLOT(Xl,Yl, ':' ,X2,Y2, '+') uses a dotted line for the first curve and the point symbol + for the second curve. Other line and point types are: solid dashed dotted dashdot point plus
star

circle 0 xmark x
r
g
b
w
i cl
c15,
etc.
PLOT(Y) plots the columns of Y versus their index. PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)) if Y is complex. In all other uses of PLOT, the imaginary part is ignored. See SEMI, LOGLOG, POLAR, GRID, SHG, CLC, CLG, TITLE, XLABEL YLABEL, AXIS, HOLD, MESH, CONTOUR, SUBPLOT.
424
Introduction to MATLAB
Module 1
If we wish to plot discrete points, using + as a syrnbol, we can usc the following:
plot(x,z,'+')
30  _..
25
+
+ +
+
20
15
10 )
5'
i
+
6
x
10
12
'rext call be added directly to a figure using the gtext command. gtext ( 'string ') displays the graph window, puts up a crosshair, and waits for a mouse button or keyboard key to be pressed. The crosshair can be positioned with the rnouse. Pressing a mouse button or any key writes the text string onto the graph at the selected location. Consider now the following equation:
Y(I)
4e
01,
::::
0:1:50; 4 * exp ( ~ 0 . 1 * t)
" p1ot(t,y)
Notice that we could shorten the sequence or commands by typing:
"
p1ot(t,4*exp(~O.1*t))
10
20
30
40
50
Sec. M1.7
Plotting
t
425
e  lUI by using:
t.*exp(O.l*t);
" plot(t,Y)
islhe
o o
10
20
30
40
50
axis ( square ') will place the plot in a square box, while axis ( normal') will change back to a normal aspect ratio. You can also explicitly set the upper and lower bounds on the plot with:
I I
axis([xlow
xhigh
ylow
yhigh])
[0
50
4];
axis(v);
Multiple curves can be pJaccd on the same plot in the following fashion.
plot(t,4*exp(0.1*t) ,t,t.*exp(O.l*t), '')
, ,, 2 . , , ,, , , , ,
I
oI
_.__
~._L_.
10
~~~=:::::====~
20 30 40 50
426
Introduction to MATLAB
Module 1
4 ~~   
,
:l_~~ ____~ ~
o
10 20
",=_
__
30
40
50
:Ln.~. .::..
o
10 20 30 40
50
lIcre, subplot(iJ,k) means that there are i "rows" of figures,.i "columns" of figures. and the current plot is the kth figure (counting right to left and top to bottom). To rctum lO single plots, simply enter subplot (1,1,1).
M1.8
v
1
3 5 7
5
10 15 20
9 11
25 30
~~_
.....
Sec. M1.9
V ( :
J
427
1)
ans
1 3
5
7 9 11
lISC:
" v (:
ans
,2)
10 15 20
oj 2"
30
"
30 25
>
0
0J
20 15 10 5 0 2
4
E => <3
"
6
column 1 of v
10
12
M1.9
428
[or k tlk) ylk) end
l:~)OOl;
Introduction to MATLAB
Module 1
(k1)*0.01; sinltlk));
Another way of implementing the saille loop is increment ( from 0 to 50 in increments of 0.01:
k
0
~
for t
0:0.01:50;
k = k + 1; y(k) = sin(t);
end
The developers ofMATLAlj highly recommend that you usc the vectorizcd version of the above for loops:
t 0:0.01:50; y  sin I I) ;
since the computation time for this method is over 200 tilnes faster than the nonvcc{(lrized methods.
Ml.l0 MFILES
'I'hus far we have shown the interactive features of MATL.AB by entering one command at a time. One reason that MA'rLAB is powerful is that it is a language, and programs of MATLAB code call he saved for later lise. There arc two ways of generating your own MATLAB code: (1) script files and (2) function rOlltines.
1.10.1
Script Files
A script file is simply a sequence of commands that could have been entered interactively in the MATLAB command window, When the sequence is long, or must be performed a nurnbcr of times it is much casier to generate a script file. The following example is for the quadratic map population growth model:
where xk represents the value of the population (dimensionless) at the kth time step. We have titled the file popmod. ill and stored it in our directory.
Sec. MUO
MFiles
429
%
%
poprnod.m
% population model, script file example clear x,k n input ( 'input final time step
')
i i
alpha xinit
x(l)  xiniti time ( 1 ) ,. O' for k;::: 2:n+l; time(k)  kl; x(k) alpha*x(kl)*(lx(kl));
end
M1.10.2
Function Routines
A more powerful way of wiving problems is to write MATLAB function routines. Flllle
tion routines are similar to subroutines in FORTRAN. Consider the previous example.
function [time,x] = pmod(alpha,xinit,n) % population model example, pmod.m clear time; clear x; clpar k; x(l) xinit; time (1) = 0; for k = 2:n+l; time(k) kl; x(k) = alpha*x(kl)*(lx(kl)); end % end of function file example
We can now "run" this functioll routine (using alpha:::;: 2.8, xini t :::;: 0.1, n :::;: 30) by typing
[tstep,xpop]=pmod(2.8,O.1,30); plot(tstep,xpop)
430
Module 1
20
25
30
. This fC,'llurc leads to This function routine can also be called by other function routines and debug. "stl1lcturcd program ming"; structur ed program s are casy to follow through out this MATLA B has many builtin function routines that you will usc and ode45 , to solve a course. The most tommo nly used rOLltines arc fzero, [solve: ., equatio ns, and a set of single nonline ar algehra ic equatio n, multipl e nonline ar algebra ic nonline ar differen tial equatio ns, respectively.
M1.11 DIARY
the sequenc e or COl11When preparin g homew ork solution s, it is oftell necessa ry to save ork. The diary commallels and output results in a file to be turned in with the homew mand allows lhis. and most of the diary f i le._nam e causes a copy of all subsequ ent terminal input off sllspends it. resulting output to be written on the file namcd file__ name. diary statc. Diary riles may be diary on turns it back OIl. diary, by itself, toggles the diary n entries. edited latcr \\'ith a text editor to add comme nts or renlove mistake ants wish to See a diary file of your session to assist them in trouOften the consult bleshoo ting your MATL.AS problems.
M1.12 TOOLBOXES
to solve speciali zed MATLA B toolbox es arc a collection of function routines writtcn the Student Edition of problem s. The Signals and Sy.<;lems Toolbo x is distribu ted with s the Symbol ic Algcbra MATL.AB. The newcst edition of Student MATLA B also contain analytic al solution s to toolbox , which is a collecti on of routines that allows onc to obtain in chemica l process algebnd c and differcntial calculu s problem s. One toolbox orten used control is the Control System s Toolbo x.

Z'"'''''jK> ' Ii
]I
kk
~i
Sec. Ml.14
Contacting Mathworks
431
http://www.mathworks.com/
You can find answers to frequently asked questions (FAQ) on this homcpagc. Also, there arc a number of technical notes that give more inf<Jnnation on using MA'fL,AB function routines. Suggestions arc made for modifying these routines for specific problcrns. There is also a MATLAB ncwsgroup (bulletin board) that has uptndate questions (usually supplied by MA'fLAB users) and answers (supplied by other users as wel! as MATHWORKS personnel). The newgnmp is:
camp.
soft~sY~3. matlab
Berore posting questions on this ncwsgroup it is a good idea to read the FAQ from the MATlIWORKS.
432
Introduction to MATLAB
Module 1
keyword search on help variables plots veclors size of the alTay (rows, columns)
multiple plots in a figure window
view variables in workspace view variables in workspace, with more detail (size, etc.)
matrix multiplication
*
./
%
clement by clement 111l11tplication clement by clement division denotes a column or row in a matrix. also creates a vector placed before comment statements
Use
eigenvalues, eigenvectors solve algebraic equations solve a single algebraic equation impulse response integratc set or ordinary differential equations least squares fit of a polynomial convert state space to transfer function modcl stcp response convert transfer function to state spacc model
Chapter
5
3
impulse
ode45
9
4
polyfit
ss2tf
step tf2ss
5, 9
9
STUDENT EXERCISES
1. Plot the following thrcc curves On (i) a single plot and (ii) multiple plots (using the subplot command): 2 cos(t), sin(t) and cos(t)+sin(t). Usc a timc period such that two or three peaks occur for cach curvc. Use solid, dashed, and '+' symbols for the
Student Exercises
433
= [
I  I
2 2
4
2 2
4 4
~J
iJ
[ ~ n
[~
2
4 4
e
3. Find
eel, where:
I
o
2 3
()
()
D~:
6. Consider the expression:
Io
I
()
with
A~
[~
3 ] 1
B ==
[:1
G ~]
[  11.896 Q _. 17.192
Solve for R.
K~
434
Introduction to MATLAB
Module 1
7. Find the solutions to the equation j(x) ::::: Jx 3 + x 2 + 5J:  6 ::::: O. Usc roots alld
fzera. 8. Integrate the following equations from t::::: 0 to I ::::: 5:
dX 1
dl
~
xJ + Xz
dX 2
dl
with the initial condition .1:1(0):= x 2(O)
=:;
k(T)
a cxp b (
'I'
~ In
dT ~ e 'I' +
IT 2 )
for(/~3.33,h~ 13,148,c~5639.5,d~ 1.077,e~5.44x lO4,I~ 1.125x 107 T is in units of Kelvin. Plot k as a function of l' for temperatures from 373 to 600 K. (we suggest 50 points)
10. Find
RT
V
~
(/
'["'V (V
+ b)
for P
~ 13.76 har, b ~ 44.891 T ~ 333 K, (/ ~ 1.56414 x 10' cm(i bar/gmol 2 KO.5, R::::: ideal gas constant in appropriate units.
cm 3/gmol,
...
MODULE
The purpose of this module is to provide a concise review of matrix operations and linear algebra. After studying this module the reader should be able to:
Multiply lnatrices
Find the transpose of a matrix Find the eigenvalues and eigenvectors of a matrix Understand concepts of rank and singularity The major sections of this module arc: M2.1 M2.2 M2.3 M2.4 Motivation and Notation Common Matrix Operations Square Matrices Other Matrix Operations
In this module we review only the essentials of matrix operation necessary to understand material presented in the chapters of this textbook. For more detailed explanation:'! and more advanced concepts, please consult any textbook on matrices or linear algebra. MATLAB is very useful for performing matrix operations. Module 1 provides a review of MATLAB.
435
436
Module 2
M2.1
r'"
A
{{II
(/n
a 2l
",.
([211I
{fl/Ill
{ll/!
{[n2
where (lij represents the scalar clement in the ilh row andjth column of matrix A. It is a good habit to denote the numbers of rows and columns beneath the matrix as (n,rn) or (n x tn). For example, the following is a 2 x 3 matrix:
.~ I~ ~ ~I
(2
X
3)
A vec!oris a special case of a two~dimcnsionall1latrix. Normally, the use of the tcnn vec~ tor implies a column vector. The following is an example of a column vector of length :; (a 3 x I matrix), where Vi is an element of the vector:
[WI
'tV!
'l.03J
The convention of this textbook is to usc lowercase bold leUers to represent vectors and uppercase bold letters to represent matrices. Unless stated otherwise, it is assumed that a vector is a column vector.
M2.2
Two matrices can be added by simply adding the individual elements of the matrix. The matrices must have the same number of rows and columns. The operation:
C=A+B
Sec. M2.2
is simply
437
clcmcnt~bye1cmenl addition
(ij
aij
+ b ij
10
For example,
c=
I:
6 + 10
31 [7
X II
91 12
IX 14
16
Clearly the order of matrices docs not matter for the addition operation (A + n : :; B I A).
M2.2.2
Matrix Multiplication
n.
C
(r x 111)
:::
II
(rxn)(nxm)
Notice th:'ll the number of columns of B must be equal to the number of rows of A. The clclnenl in the ith row andjth colulllll of Cis: C ij = Hi] A Ii
n
Cij:O:;:
k
.1
+ Hi2 A 2j
kj
1
BinA llj
2: BikA
(M2.1)
Notice that we can view this as an operation on row and column vectors within the matri
ces. That is, the ith clement in the jth column of C is equal to the scalar value that is obtained from "multiplying" the ith row of B times the jth column of A.
C (",111)
H
(r.lI)
A (1I,1J1 )
Cd
Crm
ijth clemenl
ilh row
jlh column
438
Module 2
[,'or example,
c ,= [
(rows,cols)
11
~ 1~)j /:
12
(3,2)
5
(2,3)
7(1) + X(4)
==
7(2) + X(5)
69
X7
(3,l)
X2
lOS
Clearly the order of the matrices arc important in multiplication. In the example above, BA is a consistent multiplication, while An is not Even for square matrices (where the number of rows is equal to the number of columlls), AU ::F HA in general.
M22.3
Let D be
11
Transpose
transpose of the matrix A, then:
~Af
(M22)
where (1) represents the transpose operation. The ij clement of Dis theji clement of A
til}
= {iji
3. 6 .1
~ [~ ~j
3 6
(ABC)f
CTBTA T
As noted earlier, we normally think of vectors as being column vectors. The transpose of a column vector is a row vector. Consider an ndimensional vector x. The transpose of x is xT .
and
X tl
Sec. M2.2
439
The vector transpose is often used to calculate a scalar function of two vectors. [)or CXHrllpic, if wand z are column vectors, of length 11, the operation wTz results in a scalar value:
2: ;,,1
'/l};Zj
Notice that multiplication in the opposite order, zw1~ results in ann x n matrix:
21
22
Z['lD J
Zj'lV 2
Zz'!D2.
Z l'l()\
23
['w,
'W 2
'W 3
IlJ tl
Z2~Vl
2 2103
2,,'10 1
ZII'W Z
Zn?D j
""'1
Z 1DI/
Zll1IJ il
Zn
(II.! )
( 1.11)
(11,11)
M2.2.4
Diagonal Matrices
Diagonal matrices arc commonly used in weighted least squares (regression) problems. Matrix Q is diagonal if
Qij
~
'Ii
for i ~ j 0 for; i j
o
3
o
IDENTITY MATRIX
o OJ
12
An identity matrix, I, is a diagonal matrix with ones on the diagonal and zeros
[ii ~
off'~diagonal.
I if ; o it' ;
j j
1
[0=
diag(l,I,I,J,I)
o o o o
0 1
000 000
I 0 0
0 0
010
001
440
Module 2
M2.3
SQUARE MATRICES
A number of the important matrix operations lIsed in this textbook involve square (number of rows equal number of columns) matrices.
M2.3.1
Trace
X
The trace of an n
" 2:
; 1.
{lii
(M13)
M2.3.2
Determinant
<l
One of the most important properties of a square matrix is the determinant. Consider 2 X 2 matrix:
A
The determinant of A is
::::0
la" an.1 {/ a
'.2..
21
det A
_0
allan 
{f21{f12
Sometimes the det A is written as IAI. An algorthim for finding the determinant of a larger matrix involves matrix cofactors and is shown below.
M2.3.3
The matrix formed by deleting the ith row and the jth column of the matrix A is the m;,/or of the clement aU' c1cnolcdM ,j" Consider the 3 x 3 matrix:
[:::' .1
au an
(f12
{I'll
an
aD
o:u__
(l31
The minor of (lj2 of the matrix is obtained by deleting the first row and the second column. In this case:
ani
(1:Ha
del MI2
cy
0::0
(l21a:n 
(M2.4)
The cqj'actor is thc "signcd" valuc of the minor. That is, the cofactor is dcfined as:
co (  
1)" J del Mq
(M2.S)
Sec. M2.3
Square Matrices
441
cc_., (~lY+jdctM12
==
(~1)112(a21a:Bm_{{:l1an)
112[ll:n
(l:lIa}}
The determinant of a matrix call be found hy expanding ahout any row or column (this approach is sometimes called the Laplace expansion).
(i) Expanding around any columu j:
det A
(ii) Expanding around any row i:
" 2:
i"\
{lijcij
(M2.6)
det A :::::
j... 1
" 2.
{lljCij
(M2.7)
det A = ([nCII + {f12et2 t ajJe n del A {[" ( .. I) I , I del M" + II 12(  I)' ' 2 del M 12 + ([ lJ(  I) I ,; del Mil det A = all (az/l:1,J ~
(f12alT) 
{{lJ
(a 21 11:JJ.  ((31022)
M2.3.4
Matrix Inversion
!
The matrix inverse is conceptually useful when finding x to solve the following problem:
Ax~y
A'
(II X 11)(11 X I)
wbich yields:
Tx~A '
or,
~
11
A ly
x n matrix is known as Cramer's rule:
(M2.9)
A
where the
a(~i()int
, adjA
del A
442
Module 2
In practice, this procedure is not used because the computational time is quite large t()r large matrices. Generally, a method such as Gaussian Elimination or LU decomposition is used.
EXAMPLE !VI2.1
Inversion of a 2 A A
I
= [all a
21
all]
an
adj A detA
Cll
e 12
 (l)l+ldetM lI
~ (~"1 f l
(1n
= (I)) t2 dctMj2 =
1
a:?1
~ (l12
all
en cn
det M 21

= (ti
l2
det Mn
adj A = {c;Jr
= [~~:
an . ~a21
~~:r' = [~:~
[~ b] d
d
 b]
where de! A
00:;
a . det A ~ E [ det A
dct A. ...
b det A ]
....... 0 ...
detA
ad  be
That is, ~wap the diagonal terms, take the negative of the offdiagonal terms, and divide by the determinant.
Sec. M2.3
Square Matrices
443
M2.3.5
A singular matrix cannot be inverted. A matrix A is singular if det A :::: O. Also, a singular matrix has a rank that is lower than the dimension of the matrix. The rank of a matrix is the number of independent rows or columns. For example, the matrix:
= I~
~]
has rank = I, because the second row is linearly dependent on the first row. The matrix is singular, because
det A = 4  4 = 0
We note that the matrix inverse of a singular matrix does not exist. For this example, note the division by 0 in the following calculation
AI =
I2 4
.. undchne d
The rank of a square matrix is equal to the number of nonzero eigenvalues. Eigenvalues of a square matrix arc disclissed next
M2.3.6
Eigenvalue/eigenvector analysis will bc important when studying dynamic systcms. Eigenvalucs dctcrminc how "fast" a dynamic system responds, and thc associated eigenvector indicates the "direction" of that response. This material is used in Chapter 5. Eigenvalue/eigenvector analysis can only be perrormed on square matrices. The eigenvector/eigenvalue problem is:
(M211)
where:
A = matrix (square, number of rows::::: number of columns) A = cigenvalue (scalar)
~ = eigenvector (vector)
Normally, we will usc the notation ~i to rcpresent the eigenvector that is associated v"ith eigenvaluc Ai' There are n eigenvalues and n eigenvectors associated with an II X 11 matrix. The interesting thing about equation (M2.11) is that a matrix times 11 vector is equal to a scalar times a vector. A scalar multiplying a vcctor docs not change its "direction" in ndimensional space, only its magnitude. In this case, a matrix A times the cigenvector ~ yields the eigenvector ~ hack, scaled by A. Equation (M2.11) can be written as
(AI 
A)~ = ()
(M2.12)
444
Module 2
where A must be a scalar value for which Al  A IS singular, otherwise ~ :;;;; 0 (the trivial vector). A requirement for AJ  A to be singular is dctCAJ ~ A) :;;;; 0, where the notation
det(l\!  A) .. 0
(M2.13)
Equation (M2.13) is also known as the characteristic polynomial for the matrix A~ the eigenvalues arc the 1'001,0;; of the c1Ulractcristic polynomial. For an 11 X 11 matrix A, the characteristic polynomial will he nth order, so there will be II roots (n eigenvalues).
EIGENVECTORS
The corresponding 11 eigenvectors (~) can be found from
A ~i
~i
l\j ~i
(M2.14)
is the eigenvector associated with the eigenvalue AiFor example, consider the general 2 x 2 matrix:
A
l\IA
.. 1
1I'.l
(Jizi
(/22_
(In 1
l\II 11
~(/Zl
"21 =. 0
(M2.15)
+ det(A)
~ 0
(M2.16)
It can easily he shown that, if tr(A) < 0 and det(A) > 0, the roots (eigenvalues) of (M2.16) will be negative. Also, if det(A) '= 0, then one root (eigenvalue) will be zero. The reader should derive the following characteristic polynomial for a 3 x 3 matrix. (see student exercise 7).
Sec. M2.3
Square Matrices
445
(M2.17)
tr(A) = M
c~
:0:::
(/Il
+ (/" +
{/11
+ {llla J3 ~
{fJl((jJ
+

a lJ a 22 
{{12(f21
det A =0
((?,j(ln)
+ {/u(a2111:12 ~ (l:\1(fn)
The ROllth stability criterion (Chapters 5 and 9) can be Llsed to find the conditions on the polynomial coefficients that will yield negative roots (eigenvalues). The necessary condition is that all of the polynomial coefficcnts arc positive. The necessary condition is then tr(A) < 0, M > 0, and dct(A) < O. The reader can usc the Routh stahility criterion to determine the sufficient conditions for negative roots.
EXAMPI.. EM2.2
Eigenvalue/Eigellvector Calculation
~ I~
A!
\ I
,.~4cO
dCl(,.I~A) ~
I I
 4(
2
4)
I 2
VI7 2
so,
and A,
~
2.5616
(M2.1X)
where we have lIsed the notation:
446
Applying equation (M2.1S),
Module 2
I~
So the following
fWD
1.5616 v 11
'V 21
II
2V 11 +V 21
2V 11  021
1.56J6v 11
=  1.5616 'On
3.561 5 ~/)]l
which yield:
1J 21
If we wish, we
call
arbitrarily select
~,
VII
1.0 and
II" I [ } 1 }n
'/)21
= 3.56J5
1M2. J9)
cc
1.0 I c 3..l 6 !5
1M2. J 9) by
Most complltcl:pal:kag~:"\~il] report cigyllycctors that have a unit norm (length:o:: J). If we divide 1)" (1',,)2 12.6841 3.6992, we rind that:
V(
V+
VI:,
o.W)})
0.9628
An
(~qllivalent solution
is:
 O.2703j. 1 0.9628
The reader should show that:
leads to:
~2 
I. '~I !]
tv
0.8719]
1 0.4896
Eigenvector problems arc easily solved used the eig [unction in MA'T'LAB (sec ModuleJ), as shO\vn below. a
=
1
0.8719 0.4896 d
0.2703 0.9628
2.:')616
o
1. 5616
Sec. M2.3
Square Matrices
447
Column i in the v matrix is the eigenvector associated with the ilh eigenvalue (which is the ith diagonal clement ill the d matrix). The trace and determinant can also be f(lUnd using MATLAB commands:
an~;
trace(a)
1
det (a)
ans
4
M2.3.7
The similarity tran.~I()nn is uscful for understanding the dynamic behavior linear sys[ellls (sec Chapter 5). Recall the eigenvector/eigenvalue problem for a 2 x 2 matrix:
or
(M2.20) (1112.21 ) Notice that equations (M2.20) and (M2.2l) can be written in the following form:
AV
where V is the matrix of eigenvectors:
VA
(1112.22)
(M2.23)
where:
A is the matrix of eigenvalues:
/)".1 1
1)21.
and
~2
1/)"1 v)~
(1112.24)
;\
A} .
1
I
A' V A V
(111225)
r~quation (M2.25) will he useful when developing analytical solutions for sets of Iincar differential equations, and can be used for any n x II (square) matrix.
448
Module 2
M2.4
It is quite natural to think of vectors as having a "length" property. This property is called a vector norm. The most common norl11 is the Euclidean norm. In twodimensional space, the Euclidean norm is:
I xII = V~;
+~l
JJ
lb.
notice that the sum of the squares can be written as xTx , lhalis:
IlxI12=~
M2.4.2 Orthogonality
A column vector w is orthogonal to a column vector z if wTz = 0.0. For example, consider the 2D vector
w=
l O.S
"I
Then
xTz = [l
~O.Sl [O;S]
= I(O.S)
(O.S)1
.~
OJ)
Notice that orthogonal vectors arc "perpendicular" to each other, as depicted below.
z (0.5,1)
w (1,0.5)
M2.4.3
Many times, we will scale vectors, so that they are !1onna/ized. A vector is normalized if it has a norm (length) of 1.0. Normalization is pcrformed by multiplying each c1ement_ or thc vector by I/vector norm. For a givcn vector, x, the scaled vector, U is u:::: X l/~
EXAIVIPLE M2.3
Vector Normalization
=
[l
21:
XIX
[I
2JI~I~1+4c5
And,
I~I ~ ~ [;]
R satisfying:
Where
CI..
A vector norm
011
RII is a function
4
I1II : RII 4
1.
2.
x:;t:
3.
II (XX I I X YiI
j
.,;
is a scalar
'rriallglc inequality
2. 3.
4.
pnonn oonorm
EXAMPLE M2.4
Comparison of Norms
31 I x Ii, III I 121 + 131 ~ 6 2 !I X II, ~ (iJI' I 12/' + Im '/ ~ 3742 Ilxt ~ max 1111.121, 1311 ~ 3 Ilxll,,, ~ (IJI'" + 1_21 '0 + 131 10)1/10 3.005
Xl
[I 2
450
Module 2
SUMMARY
In this module we have provided a concise review of matrix operations. This material should be sufficient for most of the matrix operations used in the textbook. It is partiCLIlarly important that the reader understand:
Matrix notation
That a matrix A is singular if the dct(A):::: O. A singular matrix docs not have an inverse. A singular matrix is not full mnk.
That the rank of a square matrix is equal to the number of nonzero eigenvalues
STUDENT EXERCISES
[~]
I. Find x'.
2. l<ind xTx.
3. Find I x Ib 4. Perform the indicated matrix operations for the following matrices:
A ~
a. FindC
~
All
f1
.
B~ [7 9
v ~ [I 2
6 5
b. Find [) c. Find E
IliA
A 'll
1
1]
7. Derive the characteristic polynomial (del (1\.1 A)) for a general 3 x 3 matrix:
1112 11 11
((21
...
[""
{/21
([\I
an
{lJ2
{lJl
Student Exercises
451
a.A=[~J
h. B
= [11
:31 :21
LINEAR REGRESSION
MODULE
The objective of this module is to review linear regression analysis, with a focus on a ma~ tfix algebra formulation and MATLAB routines for linear regression, After reviewing this module, the reader should be able to: Formulate a matrix algebra solution for a least squares problem
Usc the MATLAB routine polyf i t to find a polynomial to fit data Usc the MATLAB routine polyval to evaluate a polynomial
The major sections of this module are: M3.1 M3.2 M3.3 M3.4 M3.5 Motivation Least Squares Solution for a Line Solution for the Equation of a Line Using Matrix~ Vector Notation Generalization of the Linear Regression Technique MATLAB Routines polyf i t and polyval
M3.1
MOTIVATION
The models developed in this text require the values of many parameters such as reaction rate coefficients, etc. It is common to use linear regression (also known as I1near least squares analysis) to estimate thc values of these parameters. To illustrate the basic principles of linear regression analysis, we first consider the equation of a linc. Consider the
452
Sec. M3.1
Motivation
0
0 0
453
A
a x
+ b
y
0
x
FIGlJREM3.1
L~xpcrimcntal data
data shown as open circles in Figure M3.1. We would like to find a line that provides a best fit to the data. Let xi and Yi represent the independellt variable and measured dependent variable for the itil experimental data point. Also, let "Vi represent a lnodel prediction or the dependent variable, given the experimental value of the independent variahle, xi' 'rile sets of dependent and independent variables can be represented as vectors:
Xl
X2
Y2
Y
XN
x'
y'!
where
[x, x2 [Y, y,
xNI YN!
f represents the transpose operation. Given experimental data, x and y, we wish to find paramelers that allow a model to best fit the data. For a good fit of the data, we would like to minimize the dilTcrence between the data points Hnd the model prediction = ax + b). Our first instinct might be to find the model parameters, ({ and b, so that the sum of the absolute values of the errors is minimized. Herc we have defined the error as the difference between the experimental value and the model prediction. That is, our objective is to find the values of a and b slich that equation (M3.1) is minimized:
(y
(M3.1)
The major disadvantage to this approach is that there is not a simple, closedfonn, analytical solution to this problem. An alternative approach is to minimize the SUlll the squares of the errors. That is, find a and b such that (M3.2) is JniniruizecL
qr
454
Linear Regression
Module 3 (M.'2)
l<'or N data points, we can represent (M3,2) using the more compact notation in (M3.3):
N
2.: (y, i= J
yJ'
(MDl
Besides the analytical solution thal will follow, another advantage to the Slllll squares formulation is that large errors arc penalized 1110re heavily than small errors.
or
the
M3.2
f(a,b) ~
(M.'AI
f(a,b)
2.: (y, i 1
ax,  b)2
(M.'.5)
We know from calculus tbe necessary condition for a mininmm of a function I.\lith respect to a variable. The minimum ofj(a,b) is satisfied by (M3,6) and (M3.7),
af(ll,b)
da
a/(a,h) ah
From (M.'.6)
o o
(M.'6)
(M.'.7)
a/(a,h) ria
and from (M.'.7):
(MU)
dEa,.')) iJb
(M.'.I 0) and (M3.11):
(M.'9)
Rcmoving the conslanl value 2, wc find that (M3.8) and (M3.9) call he written as
N
2: (yeti i"l
ax/  bxi ) = 0
(M.'.IOl
 0
(M.'.ll)
Sec. M3.3
455
b L.J
i
'\.'
N
Xi
= L.J Yr\~i
1
'\.~
(M3.12)
II "'" X
L..J
+ bN
c .
N '\.~ y LJ./
i,1
(M3.13)
i.l
Notice that we have two equations M3.12) and (M3.13)) and two unknowns (a and b).
1 INN N.2: Yi  a
./1
1""1
2:
Xi
(M3.14)
Of course, we sec that the terms in (M3.14) arc merely the mean values of y and x.
x
so that:
N;"J
2: Xi
ax
N N
(M3.1S)
(Yll~)Nx
or,
+ a LX;
i=1
2:Y,t:;
i'l
(M3.16)
(M3.17)
a=
(M3.18)
M3.3
Yi =
aX i
+b
(M3.19)
456
Linear Regression
Module 3
xj
.x::!
y}
I;; I
Yv_
(Nx I)
\'
(M320)
(Nx 2; (2 x 1)
and
ViC
compact
can sec that the dimensioning of the rnalrices and vectors is consistent. lIsing t1latrix~vector notation, \ve write (M3.20) as:
Yoe'I_O
The objective function is:
v
(M321)
/(0) =
which can he \vrittcn as:
L
i
t
(Y,
Y,)'
(M322)
(I
](0) = x I)
IY  VI'IY  VI
(I
(M3B)
x IV)
(N
I)
((O)
IY YI'IYYl
(M3Ll) (M321)
cqllal~
subject to
Y= (I) 0
whcrcj(O) is the objective function, 0 arc the decision variables. and (1\13.21) is the
ity constraint equation. Since the constraint equations arc linear and arc equality constraints, and the objective fUllction is quadratic, there IS an analytical solution to this problem. 'rhe solution is (l::dgar and Ifilllmciblau, 19RR):
(M324)
M3.4
Y
where the
.y' s
{/ .\1 + b .I:"~:+ c In x,
+ d eX'
arc the independent variables. Represent the kth data point as:
.
_ _ _ _ _ _ _ _ _ _ _ _ _ _
~.
......
b.;.
Sec. M3.4
457
y(k) = 'I'(k)le
where:
'I'(k)' = [xl(k)
OT
x 2 (k)'
c
= [a
d]
The solution to this problem is (M3.24) and the generalization to any system that is linear in the parameters is clear. A common formulation is the least squares fit of a polynomial. Consider a general nthorder polynomial equation, where Pi is a parameter (coefficient) to be found as a best fit to data:
0=
Pn
PIl+l
x(1)" x(2)"
x(l ) x(2)
<1>=
x(N)"
The measured variable vector is:
x(N)"'
x(N)
y(l)
y(2)
y=
yeN)
458
Linear Regression
Module 3
where x(i) and ~v(i) represent the independent and dependent variables at the ith data point. The solution to this problem is equation (M3,24).
M3.5
p = polyfit(x,Y,n)
where the clements of the p vector are ordered from the highest power 011 down. Given a polynomial p and an independent vector xl, the resulting dependent vector yl caB be
found from:
yl
We show the usc of poly fit and polyval by way of Examplc M3.1.
EXAlVIPLE M3.1
Consider a batch reactor with a single firstorder reaction, A ) H. The model is:
dCA til
where CA = concentration of A, k:;:; rate constant, and
1l1g:
l:;:;
dC;1 C /l
In
(.'11 =
k dt
In CAO

k t
where C;\o is the initial concentration of A. Notice that this is the equation for a line. If we let
y
1'(1)
~
=
In C A
k
In CAn
p(2)
and we have the form:
y C~ 1'(1)1
+ 1'(2)
Now we lise polyf:i t [0 find the best linear fit of the data. The hatch reactor data are shown in Table M3.1 and Figure M3.2.
Sec. M3.5
TARLE M3.J
time, min (~, kgn101/m J
and polyval
459
o
8.47
I 5.00
2 2.95
3
I.X2
5
11.7 1
LOS
10
'c"
u u
0
6
I
o
4
o
2
o
o
~
2
time, min
FIGURE M3.2
L::: 0:1:5;
t
c:;
t';
0.5017
2.1098
'The same values for the parameters call be obtained from equation (M3.24), by performing the
following:
phi [t ones ( 6 , 1) ] ; p ::: inv (phi' *phi) *phi' *'y
P "
~0.5017
2.1098
The parameters from the linear regression arc converted back to the physical parameters:
k
CAll
pCI)
Now, we wish to compare the experimental data with the best fit line (model). The line is generated using the polyval function. The model and expcrirnent are compared in Figure M3.3.
>.>
2.5
2
..
0
1.5
0.5 0 0.5 0
___ L_
2
time, min
FIGURE M3.3
We also wish to compare the experimental data with the model on a timeconcentration plot.
tl ::0: 0:0.25:5; % notice that more point::, are used for CA_illOd 8.24*exp(~O.502*tl); plot (tI, CA__ffiOd, t, CA, '0' )
mnoot~hness
The data and model are compared in Figure M3.4. The rate constant has been evaluated at a single temperature. It can be evaluated at a number of temperature and linear regression can he lIsed to evaluate the Arrhenius cons/ants (frequency factor and activation energy) as shown in student exercises 3 and 4.
o c
time, min
F[(;{JRE M3.4
Student Exercises
461
Chemical Processes.
STUDENT EXERCISES
1. Note that a different solution for the best fit of a line is obtained if it is assumed that h is known; this becomes a single parameter estimation problem. Derive the following result for the estimate of a if it is assumed that b is known.
a=
2. Use the matrix algebra approach to solve for the slope of a line, if the intercept b is known. You should obtain the same result as problem ( above.
3. The
Arrheniu~
temperature:
A exp( EIR1)
Taking the natural log (In) of each side of the Arrhenius rate expression, we find:
In k
In A  (EIR) (liT)
where Ris the ideal gas constant (1.987 cal/gmol K). }jnear regression analysis can be used to find A and E. Rate constants as a function of temperature for a firstorder decomposition of benzene diazonium chloride are shown below: I
k, min
T,K
0.026 313
0.062 319
00108 323
0.213 328
0.43 333
Find A and E using least squares analysis (show units). Show that polyfit and the matrix algebra approach (M3.24) yield the same results. Compare model and experiment by (i) plotting In k versus lIT and (ii) k versus T
IThis data is from Example 3.1 in Fogler, ILS. (1992). Elements (?l ChemicaL Reaction Engineering, 2nd ed. Englewood Cliffs, NJ: Prentice Hall.
462
Linear Regression
Module 3
Ie
A exp( ... E/ R 7)
I.incar regression analysis call be used to find A and E. Rate constants as a function of temperature for a firstorder reaction arc shown below.
k, min T,K
0.0014 300
0.0026 310
0.0047 320
0.0083 330
0.014 340
0.023 350
0JJ38 360
0.059 370
0.090 380
Find A and E' lIsing least squares analysis (show units). Show that polyfit and the matrix algebra approach (M3.24) yield the same results. Compare model and cxpcriIncllt by (i) plotting In k versus lIT and (if) k versus 1'. 5. The growth rate expression for a biochemical reaction, lIsing a Monod model, is:
/Lm<lX x kill + x
where f.L is the specific growth rate, /Llllax and kill arc parameters, and x is the substrate concentration. The growth rate relationship can be rearranged to:
I)ata for a particular reactor are shown below. Use linear regression to solve for the pararneters (/Llllax and kllJ
IJ., hr 1
x, g/Iiter
0.25 0.1
0.31 0.15
0.36 0.25
0.43 0.50
0.45 0.75
0.47 1.00
0.50 1.50
0.52 3.00
Show that polyfit and the matrix algebra approach (M3.24) yield the saIne re~ suits. 6. The growth rate expression for a biochemical reaction, using a substrate inhibition model, is
fL
~

_ P'!lJ'IX X
km
+ x + k1
where /L is the specific growth rate, I1 milx and kl/l are parameters, and x is the substrate concentration. The growth rate relationship can he rearranged to
Data for a particular reactor arc shown below. Use linear regression (M3.24) to solve for the parameters (/LnHlX' kin' and k,).
fL, hI'
I
x, g/litcr
0.24 0.1
0.27 0.15
0.34 0.25
0.35 0.50
0.35 0.75
0.34 1.00
0.33 1.50
0.22 3.00
Student Exercises
463
Note that:
x(l)
x(2)
l/x(l)
l/x(2)
y
x(8) l/x(8)
and the solution is H 1>'1'(1) I(J)Ty Compare the model and experimellt by plotting IL
verSUS.L
INTRODUCTION TO SIMUUNK
MODULE
'rhe purpose of this module is to introduce SIMULINK, a block diagranl environment for simulation. After studying this module, the reader should be able to; Construct a hlock diagram for simulation
Introduction
'fransfcr
Function~Bascd SilTiulation
M4.1
INTRODUCTION
'[here arc limitations to using the standard MATLAB environment 1'01' simulation. Engineers (and particularly control engineers) tend to think in terms of block diagrams. Although MA'fLAB functions slIch as parallel, s(.:;ries, and feedback allow the simulation of block diagrams, these functions arc not visually pleasing. SIMULINK proviclcs a much more natural environment (a graphical user interface, (lUI) for simulating systems that arc described by block diagrams. SIMULINK also provides integration
464
Sec. M4.1
Introduction
465
Sources
~~~~~~~
Sinks Discrete Linear Nonlinear Connections Extras SIMUUNK Block library (Version 1.3c)
FIGURE M4.1
methods that call handle systems with timc~dclays (rather than making a Pad6 approximation for dcadtimc). We will illustrate the use of SIMlJLlNK by way of example. [n the MATLAB command window, enter "simulink" (small letters):
simulink
The SIMlJLINK block library window appears, as shown in Figure M4.1. Th~re arc many possible SIMULINK functions (icons) available. You will find it very llseful to use the most commonly used blocks, which can be found by doublcclicking on the Frtras icon. 'fhc resulting window is shown in Figure M4.2.
B
Conversion
Block Library
SIMULINK Demos
~ ~ ~ ~
FlipFlops PIO Controllers Blocks and demos that require toolboxes: Filters System 10 Robust Control Demos
Analyzers
Controllers
~~~~~~
MuTools Demos
Neural Networks
FIGURE M4.2
466
Most commonly used blocks:
Introduction to SIMULINK
Module 4
~
00
Signal generator
Scope
B E B
Mux
)
[i}
Inport
>/2
Gain
Demux
Transfer Fen
ill
Fcn
yout To Workspace
AutoScale Graph
>~
{2]
Cutpar!
~ Sum
~Sin(U[IJ+
OJ ~
~
XY grapl
~ Derivative
(s1 ) s(s+ 1)
Zeropole
PID controller
@
Integrator Saturation
From Workspace
[]}
Step input
(9)
Clock
[j}
Sine wave
Product
Look Up Table
ffi
[i}
Constant
~
Transport Delay
MATLAS Fen
system
Sfullction
fj
Switch
Rate limiter
Dis. ZeroPole
1;22 1
Filter
l/z
p
Full Block Library
Unit Delay
Slmullnk
FIGlJRE M4.3
Doubleclicking on the Block Lihmlyicon then reveals a window for the most commonly lIsed blocks, shown in l~'igurc M4.3. AltcrJl<ltivcly, you can simply enter h!ocklib in the MA'l'LAI3 command window.
M4.2
Sec. M4.2
467
C91~~1
Clock
yout To Workspace
Step input
rnf..ITlI~1 ~~
Transfer Fen
yout To Workspace1
FIGlJH.E lVJ4.4
function simulation.
Clock
C91l~~1 ~t~
Time
Step input
rnf.~ITlf~~1::::::!Y=:= ~
Output Transfer Function
FIGlJRE !\i14.5
Notice that the default transfer function has a pole at zero, that is, a simple integrator. This is changed by double~clicking on the icon and entering numerator and denominator coefficients. An example or a SystClll with a gain of 2 and a lillie constant of 5 is shown in Figure M4.6. The default step input is to step the input: from 0 to 1 at I :;:;: L This can easily be changed by doubleclicking on the 5'tep input icon and changing the specifications. The simulation parameters (start time, stop timc, integration method, etc.) arc changed by using the simulation pulldown menu and selecting Parameters. It is particularly important to change the stop tilllc l which is 999999 by default (this is because SIMlJLINK was initially developed for usc by electrical engineers who often usc a COIl~ tinuous oscilloscope function). Also, you will usually want to change the maximum integration step size; if the step size is too large, the simulation may still be accurate (particularly Lor linear systelns), but the resutting plots may be jagged. 'rhe default integration method is RK45 (RungeKutta), which you may wish to change to Linsim 10 irnprovc the computational speed. You may wish to try severalclifferent integration methods, depending 011 the type or system you arc attempting to simulate. 'fo begin the simulation, simply select Start from the simulation pulldown menu. The t and }' variables are stored in the MATLAB workspace. 'fhe resulting responsc is
C91~1
Clock
Time
Step input
rn.~[ifuJf.~1
5s+1
Transfer Function
y Output
468
Introduction to SIMULINK
 r    ~._.~r
Module 4
~
1.5
'5 Q. '5
o
0.5
0
___.l.__ _
l
10
time
15
20
shown in Figure M4.7. Notice that the input was stepped from 0 to 1 at t = I, that is, thedefault values were used. A major advantage of SIM1JLINK over the standard MATLAB integration routines is the ability to handle systems with liIlle delays. This is dono using the Transport Delay block shown in Figure M4.8. Here we use a timodelay of 5, obtained by modifying the default value of 1. It should also be noled that the user must supply an initial input value for the transport delay block. In this case the initial value is 0, because we arc dealing with a system in deviation variable form (that is, all or the initial conditions arc 0). The resulting simulation is shown in Figure M4.9. Notlcc that no output change occurs before [ = o. This is duc to the step input changing at t::::: 1, combined with the 5 unit time delay (I + 5 = 6). Although the block diagram feature of SIMULINK is very handy, it would be timeconsuming (and tiring) if every time you wanted to change a set of parameters you had to doubleclick on the related icons. You can place variahle names, such as k, tau, theta, for a firstorder + time delay system directly in the blocks, then simply change the values (of k,
(9..1
Clock
t Time
Step input
rnr~f2]'1~ I~I:::ry~ ~
Transfer Function Transport Delay Output
Sec. M4.3 2
469
1.5
'3 Q. '3
0
0.5
a a
FIGURE iV14.9 with delay of 5.
10
time
15
20
25
tau, theta) in the MATLAB cOllunand window before pcrforrning a new simulation. This block diagram is shmvil in 17igurc M4. J O.
M4.3
MAll"AB/SIMULJNK, or you wish to create a postscript file for a window, you need to enter a command directly in the MATLAB connnand window. Let's say that you titled the example simulation window "tLcxamp" and you want to print the window from a Unixbased workstation. The command that you \vmlld use is:
print: stf_ examp
C9...~1
Clock
Time
Step input
rnr~~I ~
~I ~ I~~I
Transport Delay
y
Output
FIGURE [\'14.10 Transfer function simulation. "fhe values of k, fan, and theta can be entered in the MATLAB command window before beginning the SilllU~ Jation.
470
Introduction to SIMULINK
Module 4
SUMMARY
The purpose of this module was to provide a brief introduction to the usc SIMULINK for block diagram programming. Other inputs (sources) such as sine waves or ramps can be lIsed. Also, other "sinks" such as an "XY graph" can be Llsed; we generally recommend that variables he written to the MATLAB workspace, allowing the user to usc standard MATLAB plotting functions. There are many options for "systems" to simulate, including ;'statc space" models and sfunctions which describe nonlinear systems. The lIscr is encouraged to experiment with state space models, and to read the SlMULINK User's Guide for more advanced usage.
or
EXERCISES
Usc SIMULINK to perform the following. Show the SIMULINK diagram used for your 5i Illul ations.
I:(s )ee
+ 5s +
when a step input of magnitude 2 is made at t;::; ), 2. Plot the step response of the following two transfer functions by performing a single simulat.ion
3(~3s I
25.\' t 5s I
Usc a step input change of 2 at I::::: I. 3. Compare the following firsHH"der + timcdclay system
3e~s
I:,(s)
co
lOs
I
I I)
MODULE
After .':"tudying this module, the reader should be able to: Develop the Ilonlinear dynamic model of a perfectly mixed stirred lank heater Find the statespace and transfer function form of a linearized stirred lank heater Compare the dynamic responses of the nonlinear and linear models Usc MATLAB for linear and nonlinear simulations
SteadyState Conditions
StateSpace Model
LaplaceDomain J\1.odcl
Step Responses: Linear versus Nonlinear ivlodels Unforced Systcnl Responses: Perturbations in Initi:::ll Conditions
M5.1
INTRODUCTION
Mixing vessels arc used in Illany chemical processes. Often these mixing vessels are healed, either by a coil or a jacket surrounding the vessel. For example, a mixing vessel rnay serve as a chemical reactor, where two or more components arc reacted to produce
471
472
Module 5
~
V
Tank
~'i
Tji
Ta nk outlet
Jacket Fj outlet Tj
Jacket
F T
FH;(JU.E MS.l
Olle or more products. Often this reaction lllust occur at a certain temperature to achieve a desired yield. The temperature in the vessel is maintained by varying the fJowralc of a fluid through the jacket or coil. Consider a stirred lank heater as shown in Figure MS.l, where the tank inlet slream is received from another process unit. The objcCLive is 10 raise the temperature of the inlet stream to a desired value. A heat transfer fluid is circulated through a jacket to heat the fluid in the tank. In some processes steam is used as the heat transfer fluid and most of the energy transported is due to the phase change of steam to water. In other processes a heat transfer fluid is used where there is no phase change. In this module we assume thaI no change of phase occurs in either the tank fluid or the jacket fluid.
M5.2
Sec. M5.2
473
TABLE MS. 1
Variables
;\
Notation
Subscripts area for heat transfer heat capacity (cncrgy/mass"'tcmp) yolumetric flowrate (volume/time) density (mass/volullle) temperature time rate of heat tnlllsfcr (energy/lime) heat transfer coefficient (cncrgyltimc" arca$tcmp) volume
Q
II V j
ji ref s
inlet
jacket jacket inlet reference stale steadyslale
M5.2.1
dt
, = Fp  [op
I
M5.2.2
The next step is to write an energy balance around the tank. accmllulation = in by now
~
+ W"/'
The next step is to neglect the kinetic and potential energy and write the total work donc on the systcm as a combination of the shaft work and the energy added to the system to get the fluid into the tank and the energy that the system performs on the surroundings to force the fluid out. This allows liS to write the energy balance as (sec Chapter 2 for the details):
474
Module 5
Pi
and since H:::: U + [lV, we can rewrite the energy balance as:
dff !It
.._, =h,[Jh,J!+Q+W, dt
I
!lpV,
Note that dpV/dt:::: V dp/dt + P dVldt, and the volume is constant. Also, the mean pressure change can be neglected since the density is constant:
~~.I"
f)
Neglecting the work done by the mixing impeller, and assuming single phase and a stant heat capacity, we find:
COI1
Fpc"Cli 
1) + Q
!IT
til
P =V (1; 1) +
Q
VPC p
(MS. f)
We must also perform a material and energy balance around the jacket and use the connecting relationship for heat transfer between the jacket and the tank
M5.2.3
M5,2.4
Next, we write an energy balance around the jacket. Making the same assumptions as around the tank:
dTi = Fj (1" _ T) +
Q
V;PjcpJ
cit
VJ)I
(MS.2)
We also have the relationship for heat transfer from the jacket to the tank:
Sec. M5.4
StateSpace Model
475
UA Uj T)
(M5})
Substituting (MS.3) into (MS.I) and (M5.2) yields the two modeling equations for this system:
dT dt
(M5.4)
,17; _
dt
(M5.5)
M5.3
STEADYSTATE CONDITIONS
Before linearizing the nonlinear model to find the statespace form, we must find the state variable values at steadyslale. The steadystate is obtained by solving the dynamic equations for dxldl ;::: n. The stcady~stalc values of the system variables and some parameters for this process arc given below.
M5.3.1
F,
1~s
~
It'
111m
p Cp
Btu
p/~pj
61.3
Btll T ftl
= 50"1"
~
V V
10ft3
7~'is
20t)" I"
TJS
I It'
Notice that the values or UA and Fis have not been specified. These values can be obtained by solving the two dynamic equations M5.4) and (MS.S at steadystate. From dTldl:= 0 at steadystate, solve (M5.4) to ol.1tain UA:= 183.9 I3tutF min I<rom dT/til:= 0 at steadystate, solve (MS.5) 1.0 obtain 1",',,;:= 1.5 rtJ/min
J
M5.4
STATESPACE MODEL
IIcre we linearize the nonlinear modeling equations to find the statespace form:
xooAx+Hu y ~ ex
where the state, input, and output vectors arc in deviation from:
476
Module 5
XC"
= state variables
y,III'I
. IjIjI
dl
output variables
dt
dl;
dt 'l,(T:Ij,F;,F:I;:Ii,,,)
Vj
FJ (T _ T) _ VA (T . I) J
Jil
V' jf~'Cpj
(MS.5)
::.,;.",1
ar ax
a(1  I,)
aT
=
al;
F,
VA
Vpc p
~0.4
A
21
=~f2
aX j
acr  T,)
)( j ( '1' 
af;
at;
VA
vpc p
= 0.3
VA
V;P/;pi
= 3,0
.= ill; =
22" . oX
2
at;
'r') 'js
?Js V;
aj; = aF J
lJA
~'f~Cpj
4,5
Nil =
ai,
JU I
ill,
iVi  0,)
ai, a(F  F,) acr;  1)
1,1"
0
I 1,1'
=0 =
8 12
al;
dU 2
at;
aF
v
F
V

'f~\'
7,5

Nn
lJ 14
..
il/;
JI~
OJ
=0
Sec. M5.5
477
'[jis 
'Ii.)
50
~
VI
ill;
ilF ilt, ill;

0 0
FI.Y
Vi
0 0 1.5
lJcilh~
" ' eli, 'j.,
'('/'i  '/'.) U H
Ii", "
ill; il",
ill;
ilUi,  Ij,J
J7ji
Since both states arc measured, the (' lnatrix is I. The numerical values for the matrices arc:
A~
\ .... OA 3 0
B 50  1
C
I(~ ~I
M5,5
G(s)
C(sIA)
'n
OA5 (1.5s + 0.6)
(M5.6)
The poles of the characteristic polynomial (8 2 + 4.9s + 0.9) arc 0.191 and 4.709. The transfer function relating output I (tank temperature) to input I (jacket f1owratc) is:
~
,II'
(,)
15 s2+4.9s+0.9
(MS.7)
1.111
16.6667 + SA444s
(MS.X)
478
Module 5
(\)
16.6667 (0.21236.1'
II .
+ 1)(5.23207.1' + 1)
(M5.9)
which is the gaintime constant form. Any of these forms can be used, however \vc will generally LIse the gainlime constant form. The transfer function relating output 2 (jacket temperature) to input I (jackel l1owralc) is:
50s + 20
+ 4.9.1' +
Similarly, lVe find (dividing (M5.10) hy 0.9):
0.9
(M5.10)
1:" (.1')
Also, (M5.] I) can be
l~lCtored
22.2 (2,.5.1'
cO
+ I
(M5.11)
into:
1:,,(.1')
22.2 (2.5.1
(0.212361' 1 1)(5.2307.1'
I)
(M5.12)
M5.6
x,(t) ~ T(I)  T,
X,(I)
So, for the linear model:
c
fj(t) 
Ii,
'1'(1)
T,
+ .\,(1)
J;(t) ~
fj, + x,(t)
Also,
",(I)
F(t)  .F J I"
We will consider step changes of different magnitudes and differellt directions for this system.
Sec. M5.6
479
M5.6.1
Consider a step change of 0.1 (from the steadystale value of 1.5 to 1.6 t'('I!min) in the jacket flowratc. 'fhe responses of the nonlinear and linear models arc shown in Figure M5.2. For hoth the tank temperature and the jacket temperature, the linear model closely approximates the nonlinear process.
M5.6.2
Consider a step change of I J) (from 1.5 to 2.5 n3/min) in jacket f1owratc. '['he responses of the linear and nonlinear Illodels arc shown in Figure MS.3. The linear response is quali~
127
linear
LL
126.5
nonlinear
af D
x
cL E
126
c ~ 125.5
10
15
time, min
20
25
30
a. Tank Temperature
152.5 152
151.5
linear nonlinear
151
150.5 150
10
15
time, min
20
25
30
b. Jacket Temperature
FJ(;{nu: M5.2
480 145
Module 5
linear
lL
140
nonlinear
g>
D
E J!l
c '"
ci
135
J'l
125
10
15
time, min
20
25
30
a. Tank Temperature
nonlinear
150
10
15
time, min
20
25
30
b. Jacket Temperature
F1GlJRE MS.3
tativcly the same as the nonlinear response, hut the magnitude of change is different. 'fhe gain (change in olltpul/change in input) of the lincar model is greater than the gain of the nonlinear model.
M5.6.3
Consider a step decrease of  t J) (from 1.5 to 0.5 ft 3/min) in jacket flowrate. The responses of the Iincar and Ilonlincarmodcls arc shown in Figure M5.4. Notice that gain of the linear model is now less than the gain of the nonlinear modeL This is the opposite effect from what we observed for a large increase in the jacket f1owralc.
Sec. MS.6
481
125 120
LL 0>
j!)
<i E
'"
x c J'l
10
15
time, min
20
25
30
a. Tank Temperature
150
140
130
linear
120
nonlinear
110
10
15
time, min
20
25
30
b. Jacket Temperature
FIGlJRE M5.4
(~1.0 f(3/ m in)
M5.6.4
Consider a step change of ~O.l (from 1.5 to 1.4 ft3 /min) in jacket floWratc. The responses of the linear and nonlinear models arc shown in FigUfCM5.5. Since the the change in input was small, the linear model provides a good approximation to the nonlinear model.
M5.6.5
For the nonlinear model, the gain (change in oulputlchangc in input) varied as a function of both the input magnitude and direction. If small input changes were made, the gain did
482
125
LL
0)
Module 5
124.5
15
2
x
c
0:
J'l
123.5
linear
nonlinear
123
10
15
time, min
20
25
30
a. Tank Temperature
150
LL
'" '"
0:
2
x
0
."'
"
15
time, min
20
25
30
b. Jacket Temperature
FIGUn.E M5.5
ftJ/min).
not change much from the linear model case. For large input changes, the gain of the nonlinear system was less than the linear system for incrc;:lscs in jacket flowratc, but more than the linear system for decreases in jacket rlowralc. The response of the jackel temperature is faster than tbat of the tank temperature. This makes sense fro III a physical point of view, because the jacket volume is onelenth of the heater vollllnc. Also, the jacket flowratc has a direct effect of jacket temperature and an indirect effcct on tank tcmperature. Noticc that the numerator timc constant partially "canccls" the slow denominator time constant for the transfer function relating jacket flowrate to jacket temperature.
Sec. M5.7
483
M5.7
AI
1,2 ~
 0.191 1 4.7089
slow fast
I 
''',
slow
fast
I'
The second eigenvalue and eigenvector tell us that a perturbation in the initial condition of the second state variable will have a fast response. The first eigenvalue and cigcllvector tell us that a perturbation in thc direction of VI will have a slow response.
M5.7.1
Slow Response
Consider an initial perturbation in the slow direction. Let the perturbation be of Inagnitude 5:
.'. x () = 5"'v) 0
1(0)1 = Ilj(O)
M5.7.2 Fast Response
'The responses for a perturhation in the slow direction arc shown in Figure M5.o.
Consider an initial perturbation in the fast direction. Let the pertubation be:
. x (0) =
.'. 5"12
2
484
130
LL
Module 5
129
u 128 <i
'"
en
c '" J'!
20
25
30
Tank Temperature
153 152.5
10
time, min
20
25
30
b. Jacket Temperature
FIGURE M5.6
T.(O)j [.7;(0)
[J24.6525.] 154.988
The responses for a perturbation in the fast dlrection are shown in Figure MS.? (note time scale change from Figure M5.6). In Figures M5.6 and M5.? we have shown the effect of initial condition "difC(otir>ll This can be illustrated more completely by viewing the phaseplane behavior.
Sec. M5.7
485
~ 124.9
D
ci E 124.8
:" 'l
124.7
124.6 0
0.5
1.5
time, min
2.5
a. Tank Temperature
155
LL
D
w '"
.<;!.
'"
2 ill
ci E
"
0.5
1.5
time, min
2.5
b. Jacket Temperature
FIGUUE wI5.7
M5.7.3
PhasePlane Behavior
The phaseplane behavior is shown in Figure M5.S, where the Tank Temperature is plotted on the x~axis and the Jacket Temperature is plotted on the .vaxis. Notice that initial conditions in the direction respond much more slowly than initial conditions in the
!i.1iii"ij
1.
0.3475]
4.lJ88
direction
.
486
Module 5
SUMMARY
In tbis 11lOdu1c we have developed the dynamic modeling equations for a perfectly mixed stirred tank healer. We solved for the steadystate conditions, linearized to obtain the statespace model, and found the transfer function model. We compared the step responses of the lincar and nonlinear models. We also showed the importance of the '"direction" of initial conditions. PC11urbations in certain directions cause a fast response, while perturbations in other directions yield a slow response.
FURTHER READING
The following text is a good reference for chemical process modeling, with a particularly nice presentation of energy balances: Denn, M.M. (1986). Process Modeling, New York: [,ongman.
STUDENT EXERCISES
"I. In the heater example we performed stcp tests on the jacket ftowmte. Perform step tests on the other inputs: (i) Tank flownlte, (ii) tank inlettelnperature, (iii) jackel inlet temperature. l"ind the transfer functions relating the inputs and OlltputS. Discuss the linear versus nonlinear efTects.
2. Show that a decrease in jacket volmne will cause the difference in magnitude between the fast and slow poles to increase.
Appendix
487
3. [;iud the nonlinear stcady~stalc relationships between jacket flowrate and the two temperatures (tank and jacket). Plot the input (jacket flowratc) versus the outputs for the physical parameters given. Discuss how the gain changes with coolant fJowratc.
4. Develop 11 simple model with imperfect mixing on the jacket side. Assume that the jacket can be modeled as two compartments, where the flow is from one cOlllpart~ Illen! to another, as shown in the diagram below.
Tank ~. inlet T;
;
~
V
Tj2
Tank
Jacket inlet
f
1j1
Tank outlet
Jacket outlet
Fj
7]2
APPENDIX
1. Using MATLAB to convert from statespace to transfer function modelsss2tf
.4000 3.0000
0.3000 4.5000
~7.5000
0 50.0000
c
0 0 1 0
(]
0.1000 0
0 1.5000
1 0
c1
0 0
0 0
0 0
(numl,den] numl
=
o o
1.0000
den
o o
1.0000
0 0
dE;Il
1.0000
0 0 den 1.0000
0.8207 0.5714
laml)(ia
0.1911
o
4.7089
Appendix
489
2.
% %
heater(t,x);
% %
% %
% %
Dynamics of a stirred tank heater (e) 1994  B.W. Bequette 8 July 94 x(l) x(2) de1F:j
F
Tj
% %
:5
Tin
'l'j i
V
%
%
Vj
% % % %
% F
rhoep rhocpj
temperature in tank temperature in jacket change in jacket flowrate Tank flowrate Tank inlet temperature Jacket inlet temperature Tank volume Jacket volume density*heat capacity density*heat capacity,jacket fluid
Fjs Ti Tji
1.5;
50i
Tj~
x(2);
% odes
%
dTdt = (FjV)*(Ti  T) + UA*(Tj  T)j(V*rhoep); dTjdt = (FjjVj)*(Tji  Tj)  UA*(Tj  Tij(Vj*rhocpj); xdot(l) dTdt; xdot(2) = dTjdt;
ABSORPTION
An Example of a Linear Equilibrium Stage System
MODULE
After studying this module, the reader should be able to: Understand step response behavior of absorption columns Use the MATLAB functions initial and step for state space simulations Use eigenvalue/eigenvector analysis to understand unforced system behavior Understand how zeros affect the step response hehavior oftranslcr functions The major sections of this module arc: M6.1
M6.2
Background
M6.1
BACKGROUND
Separations processes play an important role in most chemical manuracturing processes. Streams from chemical reactors often contain a number or components; sonlC of these components must be separated from the other components for sale as a final product, or for usc in another manufacturing process. A common example of a separation process js gas absorption, which is normally used to remove a dilute cOlnponent from a gas stream.
490
Sec. M6.2
Liquid Feed
491
.
I
1
Gas Product
Liquid Product
v
YIJ+l
Gas Feed
x"
Consider the gas ahsorption column shown in I"igurc M6.1. COinponcnts that enter the boltom of the column in the gas feed stream arc absorbed by the liquid stream, so that the gas product stream (leaving the top of the column) is more "pure." An example is the usc of a heavy oil stream (liquid) to remove benzene from abellzene/air gas feed stream. Absorption columns often contain "trays" with a liquid layer flowing across the tray; these trays arc often lnodc'lcd as equilibriulll stages.
M6.2
We assume that the major comIJonent of the liquid stream is "inert" and docs not ahsorb into the gas stream. We also assurne that the Inajor component or the gas stream is "inert" and does not absorb into the liquid stream. It is assumed that each stage of the process is an equilibrium stage, that is, the vapor leaving a stage is in thermodynamic equilihriulll with the liquid on that stage.
M6.2.2
Definition of Variables
492
Absorption
Module 6
time
v
M
stage
moles\,(~v()_r
w
stage
moles solute
moles solute
i)
i)
y,
M6.2.3
Equilibrium Stage
The concept of an equilibrium stage is important for the development of a dynamic model oCthe absorption column. An equilibrium stage is represented schematically in Figure M6.2,
M6.2.4
The lotal amount of solute on stage i is the sum of the solute in the liquid phase and the gas phase (that is, MX i + WyJ The rate of change of the amount of solute is then d(Mx i + Wy)/dt. The component material balance around stage i can now he written (accumulation = in  out):
il(M"
+ W y) _
ilt
 LX i _ l
+ VYil1 
LXi~ VYi
(M6.1)
Since liquid is much more dense than vapor, we can assume that the major contribution to the accumulation term is the MX i tcrm. Equation (M6.1) can now be written:
il(Mx,) ilt
X i_ i
+ V Yi+ I
f,
Xi
VYi
(M62)
LXi__ j
VYi
FIGURE M6.2
A lypical gas
absorption stage.
Sec. M6.2
493
Our next assumption is that the liquid InolaI' holdup (M) is constant, then we can write (Mo.2) as:
L
lW XiJ
+ M Yill Mx;M Yi
(Mo.3)
The solution to this problem will be easier if we can develop an explicit relationship between vapor phase composition and liquid phase composition. We will assume that the vapor on each stage is in equilibrium with the liquid on that stage.
M6.2.5
Equilibrium Relationships
where y is the gas phase composition (mole solute/mole inert liquid), x is the liquid phase composition (mole solute/mole inert vapor), ; represents the ith stage, and a is an equilib~
riuID parameter.
dX i ill
(Mo.5)
dX i L Jt,c=M ri + 1 
+ Va)
M
xi
!
Va M
Xi + 1
(Mo.o)
It should be noted that (M6.6) will yield a matrix with a tridiagonal structure.
dX i ill
 (I. + Va) x, Nt
j
Va M
x, +
(M6.?)
ilx". L df = M
(L
Xn  1 
+ Va)
M
XI/
V
M
YIl11
(Mo.8)
494

Absorption
Module 6
EXAl\;IPLE j\iJ().J
Fivc~stagc
Absorption Column
The modeling equations (M6.6) (M6.X) can he written in the following form:
dX I til L
+
M
M
Xj

Xl
Va
;Yf X 2  /1,1/
x/
(stage I)
+
M
tit
tL"r J
x2
Va M
Va M
);3
(Slage 2)
L
M
X1 
(L (L
X :; 
Va) Va)
r!t
dX,j
M
I
.rl
X4
(stagcJ)
L
M
tit
dX 5
X4
Va M
);5
(stage 4)
tit
X5
V M Y()
(slage 5)
'I'he state variables arc _\ (i;=o I to 5), and the input variables are xrC1iquid feed composition) and V6 (vapor feed composition). If is assl/llwd thaI the liquid and voporjlolFmtes are COIlSIOl/f. These equations can be written in matrix form as (notice the tridiagonal structure): (LI Va) M
Va M (L I Va) M L M
0
Va lvl (L I Va) M L
M
()
()
0 0
X2
L
M
()
,Xs
I: ~ "I
0 0 0
Va M
(L I Va) M
L M
0
Va M
0 0
>1
X4
_ X,;_
x,
(L
Va)
0 0
()
0 0
() ()
()
I_Y6_I
XI
which is the
so~called
statcspace form
Ax+Hu
(M6.IO)
Sec. M6.3
SteadyState Analysis
495
M6.3
STEADYSTATE ANALYSIS
We have shown that the form of the dynamic equations for the absorption column arc:
x=Ax+Bu
At
stcady~statc
(M6.IO)
o
The
stcady~statc values
Ax+ HII
(M6.11)
ccc
A 'BII
(M6.12)
EXAMPLE M6.2
Lel the liquid feed flowrateL:::::; 80 kgmol inert oi1lhr, vapor feed flowratc V:::::; 100 kgmol air/hI', equilibrium parameter a:;;: 0.5, liquid feed composition xI';:::. 0.0 kgmol benzcne/kgmol inert oil, and vapor feed composition Y6 0::: O.l kgmol bcnzcnc/kgmol air. Let's operate with units of minutes, so L 0::: 4/3 kgmol inert oil/min and V:;;: 5/3 kgmoJ air/min. Assume that the liquid tnolar holdup for each stage is M :;;: 20/3 kgmol. The numerical values yield the follOWing matrices:
0.325 0.2
A
o
0.125 0.325 0.2
o o
0.125 0.325 0.2
o
o
o o o
0.125 0.325
(M6.13)
o
0,2
II
o o
o o
[
o
o
o o
025
~;
(M6.14)
US
X"I=
00
1 . ] JU.
(M6.ls)
X s "'"
Aln u,\"
1J.()076. 0.0198 O.1J392 [ Il.0704 (l.! 202
x,
(M6.16)
496
Absorption
Module 6
which is simply a vector or the liquid phase compositiolls. The liquid product composition (leaving stage 5) is x'):;;:; 0.1202. The vapor product composition (leaving stage I) is obtained from the lincar equilibrium
M6,4
STEP RESPONSES
Here we will usc the MATLAB fUllction s Lcp to find the responses to a step change in feed compostioll. 'T'hc step function requires a linear state space model in deviation variable fonn.
Ax~AAx +
H Au
M6.4.1
At time t ::: 5 minutes, the composition of the vapor stream entering the column changes ('rmn Y6 ::: n.] kgn101 bCl1zcl1c/kgmol air to )'6 ::: 0.15 kgmol bCIlZcllc/kgrnol air. Usc the MATLAB step function to find how the compositions of the liquid and vapor streams (x() and )'1) leaving the COIUllll1 change with time. How do the transient responses for all of the stage liquid compositions (XI through x:,,) diller? step is used to solve the following equations
A x = A Ax + H Au
and
Ay
C Ax + D Au
where Lly is the output vector (deviation form). }'Ol' this problem, we consider x'j (COl1lPO~ sition of liquid leaving the bottom of the eolulTm) and)'1 (composition of the vapor stream leaving the top of the column) as the outputs.
J)
matrices arc:
C~I 0
0
0
O.S
o o o o
D~IO o
[y,x, tl
01
step(A,B,C,D,u.2)
where the 2 in the final column indicates that the second input is being step changed. A comparison of 1<iguresM6.3 and M6A shows that the boHom composition responds more quickly to the vapor feed change than the top vapor composition (VI)'
Sec. M6.4
0.07 0.06 0.05 0.04
Step Responses
;~_..
T...............
497
"' ,I
0.03 0.02 0.01
o o
20
40
t(min)
60
80
100
10
makes physical sense, because the disturbance must propagate through six stages (from the bottom to the lOp of the colmlln) to affect the top composition. figure M6.5 shows that the magnitude of the change in stage composition is greatest on the bottom stage. Deviation variables (xi(l) ~ xi(O)) have been llsed for case of comparison. 'fhe relative "speed of response" is faster the closer a stage is to the bottom of
1.5
>
ro
0
,.:
0.5
0 0
___J,
j
20
40
t(min)
60
80
100
FIGURE M6.4 Response of top vapor composition to a step increase in vapor feed composition of 0.05, al t;;;:; O.
498
0.07 0.06 0.05
Absorption
Module 6
,,'
~::;;;;~
20 40
'(min)
 _..
60
80
100
x/O))I
M6.4.2
.\/~
At time t ;:;;;: 0, the composition of the liquid stream entering the column changes from 0.0 kgmol hCllzcne/kgmol inert oil to "j;:;;;: OJ)25 kgmol henzcnc/kgmoJ inert oil. Find how the compositions of the liquid and vapor streams (.\:5 and .1'1) leaving the column
0.8
0.6
<ii
~
'" u
0.4
,,'
0.2
40
'(min)
60
80
100
FIGlHU': M6.6 Response of stage compositions to a step incrc<lse in vapor reed composition of (l05, at t:::: O. Normalized deviation variables are plotted.
~~ .... .
.........
Sec. M6.4
Step Responses
0.01
,~
~~
499
._.__ _.
.....
0.008
0.006
~ '"I
0.004
0.002
o o
40
t(min)
60
80
100
FIGURE M6.7 Response of hottom composition to a step increase in liquid feed composition of 0.025 at t "" O.
change with time. How do the transient responses for all of the stage liquid compositions (xl through .r() differ? A comparison of Figures M6.7 and M6.8 shows that the bottom composition (x:J responds more slowly to the liquid feed change than the top vapor composition (VI)' This makes physical sense, because the disturbance Illust propagate through six stages (from the lop to the bottom of the column) to affect the bottom composition.
L. _
20
40
t(min)
60
80
100
FIGURE M(j.S Response of lOp vapor composition to a step increase in liquid feed composition of 0.025 at t :::0 O.
500
0.025
Absorption
Module 6
0.02
w g'
175
>(I
0.015
0.01
0005
'
20
40
t(min)
60
80
100
FIGURE M6.9 Response of stage compositions to a step increase in liquid feed composition of 0.025 at t :;;: O.
Fi'igure M6.9 shows that the magnitude of the change in stage composition is greatest 011 the top stage. Deviation variables (A)t) ~ xi(O have been used for case of comparison. The relative "speed of response" is faster the closer a stage is to the top of the column, as shown in Figure M6.1O. Scaled deviation variahles (x,(I)  x,(O))/(x,(I = 150)  x/O have been used for case of comparison.
0.8
w <ii
u
'0
0.6
~I
0.4
0.2
100
t(min)
FIGURE M6.1O Response of stage compositions to a step increase in liquid feed composition of OJ)25 at t "" 0 min. Normalized deviation variables arc plotted.
Unforced Behavior
501
The reader should lise the MATLAB function ss2tf to find the transfer functions relating each input to each stale (student exercise I). Show that the order of the numerator polynomial gets smaller the farther that the state is from the input variable. Also, find the zeros and poles for each transfer function and explain why the speed of response is faster the closer a state is to the input, in terms of the trans!Cr functions.
M6.5
UNFORCED BEHAVIOR
Eigenvalue/eigenvector analysis can he Llsed to understand the effect of perturbations in the initial conditions on the relative speeds of response. The eigenvalues span an order of magnitude, from ~O.05 min 1 to 0.6 minI, as shown by the MATLAB command:
[V , d]
~eig
(arnat)
cl
Columns 1 throuqh 4
0.16931748198570 O. )"109'':';601705416 0.54181594235423 0.59352962728666 0.433452"15388338 0.16931748198570 0.37095601705416 0.54181594235423 0.59352962728666 0.43345275388338
Column ')
0.27472527472528 0.34750303957894 0.00000000000000 0.55600486332631 0.70329670329670
The reader should show (see student exercise 2) that the following perturbation in initial condition:
502
Absorption
Module 6
XII
0.025
O.s935  OA335
yields it response tll,1! is u\'cr ten times faster than the follmving penurhation in inilial condition:
o I m,
XII ~
'0.025
SUMMARY
In this module we developed a linear model for an absorption column and Llsed lhe i\ilATLAB step fUllction to study the erfect or input composition changes. T'hc magnillilk of composition change was greatest on the stages closest to the step input change, and the "speed" of composition change, \v{\s faster on the stages closest to the step disturbance. For example, for a step change in the vapor feed composition {\vhich enlers the bottom ()f the column) the crfect was greatest (magnitude largest and speed fastest) Oil the compositions of the stages close to the bottom of the colunlll,
FURTHER READING
The gas absorption example is a modification of an example presented by: LuJ'belL \V.L, & L.A. V'/eIlzcl. (I 9X8). Chemical Process Analysis: J\.4oss and ergy Ba/aJ/ces. Englewood Cliffs, NJ: Prentice {Iall.
Ei1~
EXERCISES
I. Usc the t'vlATLAB function ss2 t: f to find the transfer functions rehlting each input to each state. Show that the order of the numerator polynornial gels smaller the farthe I' that the state is from the input variable. Find thc zcros and P(lIeS for cach transfer functioll. Explain why the speed of response is faster the closer a state is to the input in terms of the transfer functions and the polezero values.
Appendix
503
2. Use the MATLAB initial function to show the effect of the "direction" of a perturbation in initial condition. Use plots to compare the "fast" and "slow" <.lircctions.
APPENDIX: MATLAB
9 6
absorp~ex.m
absorp C'x. m absorption example  Process Dynamics % orginal version  29 June 93 % (c) B. Wayne Bequette % revised  7 June 1997
5[,
% aeq gas/liquid equil coeff % ns :; : number of stages % liq :; : liquid molar flowrate % vap :; : vapor molar flowrate % mholc1 liquid molar holdup per stage % xfeed liquid feed composition % yfeed vapor feed composition
%
% set parameters
n~3
liq
vap
5; 80/60; 100/60;
.,
mho1d  2013; xfeed 0; yfeed 0.1; aeq :; : 0.5; amat bmat zeros(nS,ns)i zeros(ns,2);
"
%
%
calculate ratios (liq+vap*aeq)/mhold; Ivratio lratio  liq/mhold; vratio  vap*aeq/mholdi amat(l,l) amat(1,2) for i lvratioi vratio;
504
Absorption
Module 6
bmi'J.t(l,l)
:::: lratio;
bmat(ns,2) %
vap/mhold;
%
'(;
cmat(2,l)
dmat
'(,
:::: aeq;
zo1'08(2,2);
[Y,x,L]=step(amat,bmat,cmaL,dmaL,2);
% actual step magnitude was 0.05 "(I
x
pause
~)
pause
%
nt 
lC'nqth(t);
Appendix
for i : :, l:ns; xscale(:, i) end
505
%
plot (t,xscale, 'w') xlabel ( ' t (min) , ) ylabel ( 'x_scaled' ) pause now, do a step change in liquid feed comp [yl, xl, tl] =step (amat, bmat, cmat,
dmat~,
1) i
%
%
%
xl %
%
xl*O.025;
plot: the liquid composition leaving the absorber (deviation variables) plot (tl,yl (:,1), 'w') xlabel ( , t (min) , ) ylabel ( 'x. 5 ' )
pause
%
pause
%
%
%
for i = l:ns; xscalel (:, i) end
%
plot(tl,xscalel, 'w') xlabel ( 't (min) , ) ylabel ( 'x_scaled' )
MODULE
After studying this module, the student should be able to: Determine the steadystate behavior of an isothermal CSTR (number of stcadystates) Determine the stability of a particular steady~statc
Find the statcspace and transfer function form of a linearized CSTR model at a particular steadystate Show that steadystate gains calculated from the steadystate equations arc consistent with the transfer function gains
The major sections of the module arc:
M7.1 Introduction
M7.2 M7.3
M7.1
INTRODUCTION
Chemical reactors arc generally the most important unit operations in a chemical Chemical reactors come in many forms, but two of the most common idealizations arc continuous stirred tank reactor (CSTR) and the plug flow reactor (PFR). These two serve as limiting hounds for the behavior of many operaling reactors. The CSTR is
506
Sec. M7.2
F
First~Order
Irreversible Reaction
507
CB
used in dynamic modeling studies, because it call be modeled as a lumped parameter system. A dynamic model of a plug flow reactor consists of partial differential equations (also known as a distributed parameter system). Consider the continuous stirred lank reactor shown in Figure M7.1. In this module we will assume that the reactor is operating at a constant temperature (it is isothermal), so we do not need an energy balance (and can also assume that the reaction rate parameters are constant). In addition, we will assume that the volume is constant. The standard single irreversible reaction system is presented in Section M7.2. The Van de Vusse reactor, a re~ action scheme with a number of interesting characteristics is presented in Section 1\17.3.
M7.2
kCA
Each mole of A reacted creates a mole of B, sO we have the following relationship for the rate of formation of B: molar rate of formation of B per unit volume:::::
I"n:::::
kC;\
M7.2.1
Our first step is to write the dynamic modeling equations for the reacting component, A:
rate of (rate) (rate) (rate) accumulation = in by flow  out by flow  out by reaction dVC A dt = F CA/ F C,l  V k C A
508
Module 7
VeA(
which we can write as:
F .
dC A dt
M7.2.2 Component Material Balance on B
(M7.1)
It is natural to assume that there is no B in the fccdstrcam, which yields the following modeling equation:
dVCJ3
tit
where again, k is the reaction rate constant. Since V is constant:
dC'/)
til
V Cli
+ Ie C,\
(M7.2)
The two dynamic modeling equations arc (M7.l) and (M7.2). Notice that the concentration of B docs not playa role in equation (M7.1), so equation (M?I) can be solved independently of (M7.2). Before analyzing the dynamics of this system, it is important to understand the
steadystate behavior.
M7.2.3
SteadyState Behavior
Assume that FIV is the input variable of interest. In the reaction engineering literature F/V is known as the "space velocity." Similarly, VIF is known as the "residence time" or "space time," that is, the amount of time that it takes for the reactor volume to be "swept out" by the flow. Equation (!'vI7.1) in steadystate form can be arranged to solve for the steadystate concentration (here we lise the subscript s to indicate steadystate value):
Fs(' V ~Afl'
F
S
(M7.J)
_I k
V
Notice in (M7.3) that CAs is a monotonic function of F/V. As F/V gets large (t 00), then CAs approaches C Als ' That is, the fluid is flowing so fast through the reactor thaI there is no time for allY cOllversion of A to B. As FJV gels very small (t 0), then C A .I. approaches 0, indicating complete conversion to B. This makes sense hecauscf:./V:= 0 corresponds to a batch reactor, and at steady~state we would expect complete conversion since we have an irreversible reaction.
Sec. M7.2
509
The sleady~s[atc gain between the input P/V and the output (e A ) is simply the derivative of the output with respect to the input. l1'fom (M7.3) we find:
(M7.4)
We call also find the steadystate gain between the input ('.v) and the output ('A) from (M7.3) by:
kV
dC/Is
DC(I/I'
kV +k F,
(M75)
Notice that we can rnakc a general plot of the solution of (M?3) by dividing by C"VI' to find
F kV
1
CA.JC~v:\,
(M7.6)
kV
0.8
0.6 0.4
0.2
0 0
6
kVIF
10
F(;ORE M7.2
510
Module 7
0.8
cJ
0.6
0.4
0.2 0
0
6
FlVk
10
FIGURE \\'17.3
or NkV.
This result is consistent with (M7.4).Wc will find the same results when using the Laplace transfer function analysis. Notice from Figure M7.3 that to react most of A we need a large volume/feed ratio (residence time), which would require large vessels for a given nowratc. I'his indicates that economics must he used to guide the reactor design, and a tradeoff must be made between the capital cost of the reactor versus the operating cost (which includes the difference in values of the reactants and products). The residence time is also related to the process time constant, which ultimately effects the quality of control that is possible. Solving (M7.2) for Ihe sicadysiare value of Ii we find:
k CA~'
17\. V
(M7.7)
elf,
(J)
which can be written:
V t k
k CeVi' I" +k
V
(M7S)
C.lt>'
I" y kV
CArs
Notice in (M7.8) that the dimensionless concentration of B is also a monotonic function of the space velocity. As F./V gels large () 00) then C'ns approaches O. That is, the fluid is
Sec. M7.2
511
0.8
<J
."
0.6
0.4
0.2
0
0
4
F/kV
10
FIGURE M7.4
f1owratc.
or reactor
rtowing so fast through the reaclor that there is no time for any conversion of A to B. As F/V gets very small (~) 0) then CBs approaches C~W' indicating complete conversion of A to B (sec Figure M7.4). Notice that this figure is lIie mirror image ofFigurcM7.3.
M7.2.4
Dynamic Behavior
(:A ~ CAs
=
er; 
C'IJ.\'
(M7.9a) (M7.9b)
P PI'
C'AI  C;1j~
z ::;:::
(M7.9c) (M7.9d)
The state space model (by linearizing (M7.1) and (M7.2) is then:
dX J
ell
d''(2
(M7.IOa) (M7.IOb)
ell
or,
dx]
(M7. lOa)
=
ell
dX 1
ell
an
Xl
+ an
X2
+ b 2 !
llJ
(M7.IOb)
512
Module 7
!J"II"II o '"
we can see that the eigenvalues of A arc simply (J I J and ([22 (the reader should show this). Since the eigenvalues arc negative, the system is stahle. Since dx1/dt is not a function of _:1: 2 , we find (from the Laplace transfonn of (M7.IOa)): (M7.lla) which can be written in gaintime constant fortn as:
x,(s) .~
where
TI'"
+1
"I(S) +
TjS
1 ",(s)
(M7.llb)
k"
k
F ( V'+ k
o .
(M7.12)
'
"
Notice that k ll is consistent with (M7.4).
a"
JI J
Ie
(~)( 2"'11,:)
(M713)
(M714)
Notice that k l2 is consistent with (M7.5). From (M7.1l) we sec that the process gain for output I decreases as the llowratc increases. We sec that T[ is always less than the reactor residence time from (M? J 2). Also notice that decreases as the reactor flowrate incrcases. From (M7.14) wc sec that k J2 is always less than L Taking the Laplace transform of (M7.lOa) and (M7.IOb), we find:
1/ (.1')
(.I'  "JI)(s  an)
2
"n)
Sec. M7.2
513
(M7.16)
(M7.17)
kl)
h I2 {{:n
(lll(ll1
(M7.18)
Notice that Tn 0:::: 72' so there is polezero cancellation in gZI(s) and the transfer function becomes firstorder. Also, since the eigenvalues are always negative (the time constants arc always positive), the system is always stable.
M7.2.5
Numerical Example
/;
V
~.
0.2 min
0.2 min
I
gmol
CAj, = 1.0 liter
clXll
II I I
The following figures compare responses of the nonlinear and linear systems
514
Module 7
B
5
10
time, min
15
20
.FIGURE M7.5
= linear.
,,
B
15 20
=:
nonlinear, dotted
Sec. M7.2
First~Order Irreversible
Reaction
515
0.8 0.6
c
u
0
0

_.~
0.4 0.2
A
0 0 5
10
time, min
15
20
FlGUREM7.7
dotted:;:;: Ii near.
M7.2.6
To determine the important directions for this system, we find the eigenvalues and eigenvectors of the A matrix: The slow eigenvalue is 0.2, which has the associated cigcnvcc~ tor ~l := I~J The fast eigenvalue is ~O.4 with an eigenvector ~2 = I_;::~;:::;:!. These results indicate that an initial perturbation in the second state variable (concentration of B) will respond slowly, while an equal magnitude pertubation in both state variables will respond twice as fast.
M7.2.7
We can make some interesting observations about the behavior of this simple system. We notice that both reactor concentrations have firstorder transfer functions with respect to the dilution rate, FIV. 'l'he concentration of A is also firstorder with respect to (~\fi but a secondorder transfer function relates eN to the concentration of B. The response of B to a change in the feed composition of A is slower than the response of A for the same change.
516
Module 7
M7.3
A
21\
7
7
7
"
k2
This scheme was presented by Van de Vussc (1964). Engell and Klatt (1993) note that the production of cyciopcntinol from cycJopcntadiene is based on such a reaction scheme, where:
"
A ~ cyclopcnladdicnc B : : : cyclopcntcnol
C:::::: cyclopcntancdio}
f) ::::::
dicyetopcl1tadicnc
In the following development, we assume that the feedstream contalI1s only componeIlt A.
M7.3.1
Modeling Equations
dV dt
()
and
F =
F;
COMPONENT A BALANCE
The balance on Ais:
accumulation
d(VCA ) dt
Since V is constant:
d(CA ) dt
(M7.19)
Sec. M7.3
517
COMPONENT B BALANCE
Similarly, we can write:
d( ell)
dl
COMPONENT C BALANCE
Also, for component C:
(M7.20)
d(C e )
dl
COMPONENT 0 BALANCE
And component D:
(M7.2! )
d(Cu) dl
(M7.22)
Look at equations (M7.!'!) through (M7.22). Notice that (M7.!'!) ami (M7.20) do not dc pend on Cc or Cf). If we arc only concerned ahout CA and Cu' we only need to solve equations (M7.!9) and (M7.20).
d(CA)
dl
d( ('ilL
(M7.!'!) (M7.20)
C~h:
dl
Solving for the steadyslate for (M7.19), we find a quadratic equation in
+
and solving for Cns:
v + k2
These results lead to the input/output curves presented in Figure M7.8.
518
Module 7
.m s o
o o
1.4 1.2
.&
~
E
<Ii 0
.0
0.4 0.2 0 0
2
FsIV, 1/min
b. Concentration of B as a function of the space velocity.
FIGURE M7.8
Notice that there is a maximum value of the concentration of B. If the objective of the process is to maximize the production of B, then there exists an optimum residence time (FsI\!) of 1.292 min 1 (a function routine to find this is shown in the appendix).
STATESPACE MODEL
Here we linearize the nonlinear modeling equations to find the
statc~spacc form:
x=Ax+Bu y = ex
Sec. M7.3
519
where the state, input, and output vectors arc, jn deviation form:
X
:0;,,'
I.C B ~ C/J.I'
CA 
C"'J
II
[G ~I
A
~ inplIt variable
,')
7~1 C:
",en 
C:
AS
= output variables
C B.1,
The clements of the statespace A matrix arc found by: AU::::: ~t;/aXj
A lI
_ elI;
elI
P;
yk l 2k'(A'
A
A
I2
eli;
21
aj;
_ aj; _ k
ae"
ai;
,.,
A
22
a;;
aX 2
~
il( C II  Cfi")
=
dC"
all ii Dy
ili;
= C Afl' 
CAs
Dy
and the statespace model is:
520
Module 7
llcre we will consider several different steadystate <ipcrating points. Case 1 illustrates in verse response behavior, while Case 2 does not. Case 3 will illustrate operation at the maximum production point for compound B.
CASE 1
Consider a dilution rate of F/V = 4/7 min I, which is on the left side of the peak shown in 'igure M7.8b. The steadystate concentrations are:
mol 3 . liter
lOS
CHI'
94
1.117 .
alOl
liter
AB
C"
2.4048 r 0.8333
7.00001 1.1170
"2.2381
g2l(S)
which has a zero in the righthalf plane:
zero
3.1472 1.1170
~"
2.8175
+1 .I' +
Consider now the following dilution rate F.JV:::: 2.8744 min I , which is on the right side of the peak in [<igure M7.8b. This yields the following operating conditions:
hter
1.117
11101
liter
Sec. M7.3
521
[5.7367
0.K333 9130 I1.11701 3.
~4.5411
zero
= 
Notice that cases 1 and 2 arc based on the same concentration of component B. Also note that case 1 has a righthalf plane zero, while case 2 has a lefthalf plane zero of the same magnitude. This means that case I exhihits inverse response, while case 2 does not. The different types of behavior arc shown in the following figures. Figures M7.9 and M7.JO arc characteristic of a system with a positive gain and inverse response (righthalf plane zero). I'igure M7.9 shows that, for a small step change, the linear model is a good approximation to the nonlincar model. FigureM7.IO shows that the gain of the nonlinear model is significantly lower than the linear model, when a largc step input is made. Figures M7, 11 andM7 .12 are characteristic of a system with a negative gain. Figure M7.11 shows that, for a small stcp change, the linear model is a good approximation
1.123 1.122 1.121
linear nonlinear
E .0
0
2 ~
2
time, min
FIGURE M7.9
522
Module 7
linear
" o
o
.~
, ,
I I
,
)
E .ci
I
nonlinear
time, min FIGIJRE M7.10 Response to a large step change (doubling. from 4/7 to 8/7 min I ) in space velocity. Case 1 conditions.
to the nonlinear model. Figure M7.12 shows that the gain of the nonlinear model is lower than the linear model, when a large step input is made. It is interesting to note that all operating points to the left of the peak in the input/output curvc<Figurc M7.Rb) have righthalfplane zeros (inverse response) while all operating points to the right of the peak do not.
~
0
;~
E .ci
FIGURE M7.lt Response to a small step change in space velocity (0.1), case 2 conditions.
Sec. M7.3
523
1.1
E .ci
0
2
0.9
nonlinear
0.8
,,
2
linear
0.7
3
time, min
FIGURE M7.12 Response to a large step change (doubling of space velocity), case 2 conditions.
F , V
which yields the composition:
= 1.2921 min
mol
C,,,
and the statespace model:
= 4.4949 .
lIter
C", = 1.2660
mol liter
3.6237 O.R333
2.95RR
I ~:~~~{I) I
The transfer function relating input I and output 2 is:
 1.2660 S
524
1.266
Module 7
i
,
linear
nonlinear
I 21.265 j
E
i
I
j
tf
1.265
1.264
2
time, min
Notice that there is no steadystate change in the concentration of B Cor a small step change in space velocity, as shown in Figure M7.13; this behavior is consistent with the zero gain in the ,l;2J transfer function.
SUMMARY
Two example isothermal reactor systems were presented in this chapter. We noted that V/F (residence lime; or equivalently, FlY, space velocity) is a common design parameter chemical reactors. We noted that a firstorder reaction system has a monotonic rela""""", (no input or Olltput multiplicity) between output concentration and reactor nowrate. lower reactor nowrate leads to a higher gain with respect to the concentration of A. The Van de Vusse reactor had the interesting characteristics of input and righthalf plane zeros (inverse response). At the maximum in the concentration nowrate curve the gain was zero.
Appendixes
525
There arc a Ilumber or good reaction engineering texts. Most of the emphasis of these texts is on the stcadystale behavior.
Fogler, H.S. (1992). Elements q{ Chemical Reacthm !':ngineering, 2nd cd. Englewood Cliffs, NJ: PrenticeHall. l"roment, G.P., & K.B. Bischoff. (1990). Chetl/feal Reactor Analysis and Design, 2nd cd. New York: Wiley. [,evcnspicl, O. (1972). Chemical Reaction/:;nghzeering, 2nd cd., New York: Wiley. Smith, 1M. (1981). Chemical Engineering Kinetics, 3rd cd. New York: McGrawHill.
STUDENT EXERCISES
t. Consider the A
7 B example. Extend this to a reversible reaction A H B in a CSTR, where both the forward and reverse reactions are firstorder, and where there is no B in the feed stream. a. Derive the state~space model. b. For the case where the reverse reaction rate constant is 1/2 the forward reaction rate constant (which is 0.1 Illite l ), find the value of F/V where thc conversion of A is SO%. c. [,'or a stcp increase in the feed concentration of A of IO/X), find the change in the A and B concentrations in the reactor.
2. Consider the yan de Vusse reactor. Include C and J) as stale variables and write the slalespace model. Find the transfer functions relating F/V and C c and CJ).
APPENDIXES
A1 Generate SteadyState Input/Output Curves for the Van de Vusse Reaction
[fsov, cbs, cas]
funct~ion
vandss(kl,k2,k3,cafs) ;
% %
%
25 july 94 (c) b.w. bequette finds the steady~state input/ouLpuLcurves for the vand de vusse reactor fsov
cas
%
~6
% % %
% %
st:eady"state space velocity, fs/v st:eac1ystate concentration of a steady~staLe concentration of b feed concentratioon of a
O;O.LIO;
526
%
Module 7
(k1 I fsov)/(2'k3); casl cas2  sqrt ((k1+fsov) ,A2 + 4*k3*fsov "leafs) / (2*k3) ; cas casl + cas2 i
% cas  O.Ol*cas:cafs/100:O.80*cas;
% %
%
[sov:::
A2
Van de Vusse Function File {vanmax.m} for Finding the "Peak" in the Input/Output Curve
l'inding the maximum in the input/output curve for the Van de Vussc reaction:
Use [min
fmin( 'vanmax'
% %
I
0,2)
%
()6
to [soy for
9"
9"
% %
%
% )8
~)
cas
% %
;';
cbs cafs
steadystate space velocity, fs/v st~oady'state concentration of a steady~state concentration of b feed concentratioon of a
cafs
%
10;
fsov
%
x

casl + cas2;
k1*cas/(fsov + k2);
cbsrnin
 cbs;
Appendixes
527
AJ
% %
%
%
6
<[)
%
% % % %
[tc,x]
%
% % %
where to is the initial time (usually 0) tf is the final time xO is the ini t~ial condition for t::.he states
x(l)
states  concentration of A concentration of B x(2) time t dilution rate concentration of a concentration of b feed concentrat::.ion of a
% %
7>
%
%
fov ca cb caf
0,
% % %
(kl)
~~>
(k2)
% 2A
%
D
% rate constant for A > B (minAl) % rate constant for B > C (minAl)
(k3) kl k2 k3 cat
~
%
~
% % % %
%
% %
modelin~J
equations
528
Module 7
A4
al
a
2.2381
[vl,dl]
vI
eig(al)
0.1962 0.9806
()
1.0000 d1 2.2381
a2
o
2.4048
0;.8333 4.54111
,,~j.'l367
cl2
~).'j367
o
~4.5411
0.8333
[v2,d2]= eig(a2) v2
0.8204 0.5718
o
::i.7367
a3 3.6237 0.8333
[v3.d3]
v3 
a
2.9588
 eig(a3)
a
1.0000
9~:i88
0.6237 0.7817
c13 
2.
a
3.6237
BIOCHEMICAL REACTORS
MODULE
Develop the dynamic modeling equations for a Understand the concept of "washout"
two~statc
biochemical reactor
Understand the different types of steadystate and dynamic behavior exhibited by the MOl1od and Substrate Inhibition models
Find the numher of steadystate solutions and to determine the stability of each steadystale The Inajor sections of this module arc:
MS.I MS.2 MS.3 MS.4 MS.) MS.6 MS.7 MS.S Background
Modeling
l~quatiolls
Steadystate Solution
Dynamic Behavior Linearization Phaseplane Analysis
M8.1
BACKGROUND
Biochemical reactors arc used to produce a large number of intermediate and final procl~ ucts, including pharmaceuticals, food, and beverages. Biochemical reactor models arc similar to chemical reactor models, since the same type of material balances are per
529
530
F
X1l
Biochemical Reactors
Module 8
x"
.X,
x2
V
F
X,
X2
FIGUH.E MS.l
Biochemical reactor.
formed. In the simplest reaclor we consider two components: biomass and substrate. The biomass consists of cells that consume the substrate. Onc exmnplc would be a wastewater treatment system, where the biomass is lIsed to "cat" waste chemicals (substrate). Another example is fermentation, where cells consuille sugar and produce alcohol. Consider the schematic of a biochemical reactor shown in Figure Mg.l. In this module we aSSlllllC that the reactor is perfectly mixed and that the volume is constant. We usc the following notation:
Xl
= biomass concentration
substrate concentration
mass of cells
volume
X2 =
mass of substrate
volume
1'1
"2
_'::0
F = volumetric f10wrate
= volume/timc
Now we can write the material btdances to describe the behavior of this systell1.
M8.2
MODELING EQUATIONS
The dynamic model is developed by writing material balances on the biomass (cells) and the substrate (feed source for the cells). Biomass grows by reeding on the substrate.
M8.2.1
We write the biomass material balance as: rate of accumulation:;:: in by flow  out by flow + generation
dVx,
dl
,= ['\1/  fit,
VI',
(MS.I)
Sec. M8.2
Modeling Equations
531
where ,x lf is the concentration of biomass in the feed stream and F is the volumetric flowratc.
M8.2.2
consumption
dVx, dt ,
=~
(M8.2)
M8.2.3
The reaction ratc (mass of cells generatedlvolume time) is nonnally written in the following form:
r1
:::::
fL<t 1.
(M83)
where /.L is the specific growth rate coefficient. We can think of /l as being sitnilar (0 a firstorder reaction rate constant; however, jJ. is not constanlit is a fUllction of the substrate concentration as shown in Section M8.2.6. The units of /L arc time I ,
M8.2.4
Yield
There is a relationship between the rate of generation of biomass and the rate of COnS1l1l1p~ tion of substrate. Define Yas the yield, that is, the mass of cells produced per mass of substrate consumed:
y~
1',
(M8A)
(M8.5)
and substituting (M8.3) into (M8.5). we find:
r
= P'~~J
(M8.6)
M8.2.5
Dilution Rate
Assuming a constant volume reactor, we can write (M8. J) and (M8.2) as:
532
dX I
Biochemical Reactors
Module 8
dl
F V
Xjf 
(MS.7)
F
VX2f
F
V
XZ  r2
(MS.S)
Defining F/Vas D, the dilution rate, and using the rate expressions in (MS.J) and (M8.6), we find:
dX I
dl
(MS.9)
..~tJ D x_21  D .\, y .
dx]
dl
(MS.IO)
Generally, it is assumed that there is no biomass in the fecd stream, so xlJ':::;: O. The bioreactor modeling equations arc then norrnally written in the following form:
dX 1
dl
(MS.II)
(MS.12)
The dilution rate (D) is the same as the space velocity in the chemical reaction engineering literature. It is also the inver,",c of the reactor re.,;idence time and has units of time l . The expressions for jJ (specific growth rate) are developed in the following section.
M8.2.6
The growth rate coefficient is usually not constant. A numbcr of functional relationships hetween the growth rate coefficient: and substrate concentration have been developed. The lllost common are (i) MOJ/od and (ii) Substrate inhibition.
MONaD
The growth rate coefficient oftcn varies in a hyperholic fashion. The following forin was proposed by MOl1od in 1942. Notice that jJ is firstorder at low x2 and zcro order at high x2' (MS.I3) Notice lhat
jJ
is firslorder at low x 2 and zero order at: high x 2 . That is, when x2 is low:
Sec. M8.2
Modeling Equations
533
this lncans that the Monod description is similar to a secondorder (bimolecular) reaction when x 2 is low, since
r
~_.
!Lilla;; Xl
[~quation (MB.l3) is the same form as the Langmuir (u.Jsorption isotherm and the sl2uHJ;Jrd rate equation for enzymecatalyzed reactions with a single substrate (Michaclisl'viclllC'1l kinetics).
SUBSTRATE INHIBITION
Sometimes the growth ra.le coefficient increases at low substrate concentration. but decreases at high substrate concentratioll. The physical reason may be that the suhstrate has a toxic effect on the biomass cells at a higher concentration. This effect is called suhstrate inhibition and is represented by the t()llowing cquation:
03 0.2 0.1 0 0
2
x2
534
Biochemical Reactors
Module 8
Substrate Inhibition
fL max
0.53 hI
kill
k,
fL~
kill + x 2
+ 1<1
(MBI4)
M8.3
STEADYSTATE SOLUTION
In this section, the MATLAB function fsolve will be used to solve for the steadyslate values or the biomass and substrale concentrations. The nUlllerical values used in our silll~ ulations are shown in Table MR.I. We \vill study the following cases: Case 1. Medium Dilution Rate, 1\::::: 0.3 hr" Case 2. Low Dilution Rale, D s ::::: 0.15 he l Case 3. High Dilution Rate, D, ~ 0.45 he'
EXAM PI ,E MS. I
0.3)
The function file bio ss. m (Appendix 1) is set for Case! (D =: 0.3) and Ihe sub.'ilrale inhibition model (kl co 0.4545). The l'vfATLAB function fsolve is used to solve for the steadyslatc values by entering tbe following in the comfnand window (with an initial guess of x (1) =: 1 andx(2) 1):
0;:
X =
f~301ve(
'bio
)3~:;'
,[1;1])
Sec. M8.4
Dynamic Behavior
535
=
O.99 tj1 1.5122
Different initial guesses resuil in two other solutions for the substrate inhibition model. Also. the MOJlod model has two steadyslate solutions. "fhe reader should find the following results using [sol vc and bio_s~;, m, by entering different initial guesses.
0 'b = 1.5374
X2s::::;
4.0
x 2s :;:;:;
0./565
Equilibrium 2 EquilibriullI J
Is
:=
X21::::;
4.0
Xis;;;::
.1 2.1'::::;1.5123
'2, = 0.1745
Notice that EC]uilibriUl,11 3 on the Sf model is ahnosl identical to Equilibrium 2 for the Monad model. In this section we have discussed case 1 results (D :;:: 0.3) only. Cases 2 and 3 will be discussed in Section M8.? In the next section we will analyze the dynamic behavior of this systeln, and in Section MS.7 we will show how multiple steadystate solutions arise.
M8.4
DYNAMIC BEHAVIOR
In the previous section we found that the Monod and substrate inhibition models had t\V() and three steadystate solutions, respcctively, for the Case 1 paramcler values. In this section we perform simulations or the dynamic behavior of this system. A function file named bio. m is shown in Appendix 2.
M8.4.1
(D:;::
'rhe initial simulation is with the substrate inhibition parameters under Case I conditions 0.3). The simulations for two different initial conditions arc shown ill f,'igurc M8.3.
,,[tl,xlJ " odc,45( 'bio' ,0,30, [1;lJ);
536
2
Biochemical Reactors
Module 8
a a
10
15
time
20
25
30
"I
~ ,
.... 
10
15
time
20
25
30
FIGlJIU~ iVI8.J
0:;;:
[0.75,2]
(dashed),
Although both initial conditions arc reasonably close to the Equilibriufll 2 solution found in section 3, one simulation converges to Equilibriulll I (dashed line) while the other converges to Equilibriulll :3 (solid line). We find in the next section that F~quiJih rillm 2is unstable: Furtber simulations will be performed and analyzed in the phasc
M8.5
LINEARIZATION
In this section we find the linear statespace and transfer function models. So that there is no confusion in notation, we will usc the following fonn:
i
y
~
Az+BII
Cz
where:
21 =
XIXIs
2 2 = Xl II,
il Z
ccc
x 2s D,
Xl/i
f) 
x 2I 
Sec. M8.5
Linearization
537
where it is assumed that both states are output.s. The notation tL,; is used in the A matrix to represent the derivative of growth rate with respect to substrate concentration, evaluated at steadystate:
aILs
rb: 2s
For the MOl/od model:
dr<,
(}X;:'I
IJomaJ(m
(kill
+ x::"J 2
V'11HI_~~~h (1
(MS. IS)
dX 2s
P_I~l,!X (km +
(kllJ + x 2.\"
+ {(IttY
~1~J__' (2s)
(MS.16)
~ klxI,)
1
M8.5.1
Here we analyze the substrate inhibition model under Case I conditions. A MATLAB mfile, bio..._jac.m (Appendix 1), is used to generate the A matrix and the eigenvectors and eigenvalues.
EQUILIBRIUM POINT 1
The sleadyslale value (seclion 3) is (x".x,) = (0,4). The following command is entered:
(jac, evec, lambda] :::; bio jac ([
a i 4]
538
Biochemical Reactors
Module 8
where j ac is the Jacobian (A matrix), evec is the eigenvector matrix and lambda arc the eigenvalues.
o
0.3000 0.3714 0.9285
o
0.1139
so,
~ r.~O.1l39
~0.4652
"j
"2
 OU.300]
~ ~O.3 ~ ~ 0.1139
~j ~ [~]
~2 ~O.9285 I
"
0.3714 "I
Since both eigenvalues are negative, the system is stahle at equilibrium point 1, verifying the simulation results shown in Section M8A.
EQUILIBRIUM POINT 2
The steadystate value is (xb,x,) [jac,evec, lambda]
jac :; :; 0.0000 0.7500
~ ~
bio~jac([0.9951;1.5122])
o
0.3000
Sec. M8.6
Phase~Plane Analysis
539
EQUILIBRIUM POINT 3
The steadystate is (x b ,x2,) = (1.5302,0.1746).
[jac,evec,lambda] =
jac
:::0
bio~jac([1.5302;0.1746])
0.0000 0.7500
evec
=:::
o
2.2619
M8.6
PHASEPLANE ANALYSIS
The mfilc bio~phas_gen.m (Appendix 2) was llsed to generate the following phaseplane plot for the substrate inhibition model under Case I conditions (sec Figure M8.4). Notice that all initial conditions converge to either the washout steadystate (trivial solu
2
o 1 
o o
0.2
0.4
0.6
0.8
x1
1.2
1.4
1.6
FiGURE M8.4 Phaseplane plot for suhstrate inhihitioll model, Case I conditions (x:;;:: stable steadystate, 0 = unstable steadystate).
540
Biochemical Reactors
Module 8
These results arc consistent with the stability analysis of Section M8.). A phaseplane plot for the Monad model was shown in Chapter 13.
MS.7
o= o=
(fL,
OJ x"
, x 2.1)
(MH.I7I
f).I' (.t2j.i' 
.y.fLx"
(MHIHI
where the subscript s indicates steadystate. 'fhcrc arc two different types of solutions to (MS.I?) and (MS. IX). One is kno\vll as the trivial or ;'washout" solution. The other type is the nontrivial solution.
M8.7.1
Washout Condition
l:;'rorn (M8.I?) and (M8.IS) we can immediately sec one solution, llslli111y called llw trivial
solution.
x"
x2_~
0
=
X2{I'
(MHIl)1
This is also known as the washout condition, since the reactor concentrations arc equal to the feed concentrations; that is, there is no "reaction." Since there is no biomass in the feed stream, then there is no biomass in the reactor under these conditions; all of the cells have been "washed out" of the reactor.
M8.7,2
Nontrivial Solutions
fL., = D,
From (MH.IH) we find thai:
(ivlH.20)
which indicates that the specific growth rate is equal to the dilution rate, at steadystate.
y
and from (MH.20) and (MH.21):
X 1.\
(ivlH.211
(M8.22J
"'This section contains a detailed analysis which the reader may wish to skip on a first reading.
Sec. MS.7
541
We can solve for x 2s ' by llsing the relationship for IJ. s as a function of x 2s (either Monod or substrate inhibition), since we kllow that IJ. s = D s (from (M8.20. Let !J..Jx2.\') represent this general functionality. Then, we tHust solve:
"(c)D S rs  2.\
(M8.2.1)
for x 2s ' then substitute this value into (M8.22) to solve for .1: 1.1" The specific cases of Monoc! and substrate inhibition arc shown in the subsections below.
MONOD
From (MS.13), the dilution rate at steadystate is
ILJ!laxXh'
kllJ + x 2s
Solving (M8.24) for x2s' we find:
(M8.24)
(M8.25)
k ll!_ D.
iJmax 
I,
D,,_
(M8.26)
For (M8.26) to be feasible, we note that D,I' < /L ma :c Actually, there is a more rigid requirement than that. 1'1'0111 (M8.22) we note that the highest value thal x2.1' can be is x 2f.i' otherwise Xis will he less than zero. Thc maximum /).1' in reality is thcn f.1,Jx 2 ,..,J, (Jr (from (M8.22), letting x2s ;;::; x 2JJ: .
ILJn'IX ..\:2D:
kill
+ x2(\'
(Mollod)
(M8.27)
We also see from (M8.26) that there is a single solution for x2.\' as a function of D,I. 'rhis means that there is a total of two steadystate solutions for the Monod model, since there is also the washout (trivial) steadystate.
SUBSTRATE INHIBITION
We found in the previous subsection that there are two possible steadystales for the Monod model, for a given dilution rate. [11 this subsection we find the number or possible steadystates for the substrate inhibition mode1. From (M8.14) at steadystate:
/Lmilx
j..L.\'
kill
+ x2. +
, 1
k JX~.I'
(M8.28)
ESCOLA Dc E~:C;'!I'li\IW\
BIBLlQI60/\
542
l'rom (M8.28), we find thai:
Biochemical Reactors
Module 8
k,xl, +
+ k",
~0
(M8.2'J)
, , +
fL"'''')
D,
X 21' 
+I (m
()
(M8.30)
Since (M8.30) is a quadratic equation, there will he two solutions for x2S" This means that there arc three stcady~state solutions for substrate inhibition, since there is also the washout (trivial) steadystate. We sec from (M8.30) that for positive values of X2s the coefficient multiplying x 2.\ must be negative. The implication is that l.1 max must be greater than D s (the same result as the Monod equation). This implication can be seen more clearly frolll the solution of the quadratic formula for (M8.30):
_ fL"'''')' _ 4k I k D,
2k,
So, for solutiolls with physical significance:
III
(M8.31)
(M8.32)
(M833)
Because of (M8.33), \vc know that the tefm inside the hrackets in (M8.32) is negative. For (M8.J2) to be satisfied, then we know:
V4k 1/11 k
(M8.34)
+ 2'v(,:k 1\ 1/11
(substrate inhibition)
(M8.3S)
We could have found the samc result from viewing Figure M8.2. Notice that there is a peak in the J..Ls curve, and again recall lhat D.I , ;::;: f.L r The steadySlate dilution rate, D s canuot be abovc the peak in the x2s versus J..Ls curve. We can find the peak by finding ilfL,Idx2' ~ n. From (M8.16):
d/1 s
dX 2s
(M8.36)
Sec. M8.7
543
We sec from (MS.36) that dfL./dX2' ~ () if: (MS.37) We can substitute this result into (M8,28) to find:
fLlll(lx
ik;" l \X 1
!em
k
(MS.3S)
km +
+ 1 + k m
'"
fL.,
~I
__ }l..l!1~1"' __
+ 2 VX,k,,,
f.111l<lX
(MS.3,)
D,
which is the same result as eMS.3)).
1+2'r.;Vk kl/(m
M8.7,3
(MS. I')
kI/lD,\.
f.Lm<lx  '[)",
(MS.26) (MS.22)
Y (x 2I,  "')
with the requirement that D s < IJ. max 'Y~f.Jklll + x~/.i' (that is D.I, < f.L.lr2j.J)
544
Biochemical Reactors
Module 8
1 \. _ D
2/(,
1(
\1 1 (/II
(M8.31)
x"
with the requirement for dilution rate:
CC"
Y (X 2  x,,) !,
(M8.2S)
(MX.32)
M8. 7.4
The stability of each steadystale solution is determined from the eigenvalues of the Jacobian matrix (matrix A in the statespace form), For a twostate system we know that the eigenvalues are found by: dCl(Al A) X'  lr(A) X + del(A) ~ ()
(M8AO)
j::"wm Chapter 13 we know that the following conditions mllst be satisfied for stability of a secondorder system:
(MXAI) (MXA2)
That is, the eigenvalues (A) will be negative if conditions (M8.41) and (M8.42) arc satisfied. The Jacobian of the biorcactor modeling equations (M8.11 andM8.12) is:
A C"
[1:'.'  D,
ij;
x "I:':
lJv'r , f)" _ .. ,I
y,),"
(M8A3)
where we have used the notation /L,; to represent the derivative of growth rate with respect to substrate concenlration, evaluated al steadystale:
i!/L,\
c)x:2y
(M8A4)
(I:'  D) _
"
.,
J) _ I:';x"
.\
(M8A5)
.\
.\
.'
/L;
x,,) + X,dL;I:', Y
(MXA6)
We will usc (M8AS). (M8A6), and the eouditions shown in (M8AI) and (M8A2) 10 dctermine the stability of each steadystate.
Sec. MS.7
545
fL,D,D,<O
and from the requirement that dct(A) > 0:
(MXA7)
(MXAX)
D > P'.I' .\ 2
while from (M8.48) the requirement for stability is:
(MXA9)
D s ::> /Ls
(MX.50)
Notice that f..L s is evaluated at the substrate feed concentration for the washollt condition. Perhaps the expression IL,lx2/) should be llsed to designate this relationship. Comparing (M8.49) and (MS.50), we sec that (MS.50) is the more rigorous requirement for stability of the washout steadystate. 'fhe growth rate expression for Monod kinetics is:
(MX.51)
Notice that IJ.lr 2j:) is simply a shorthand expression for the specific growth rate evaluated at the suhstrate feed concentration. We must use (MS.50) along with either (M8.51) or (MS.52) to determinc the stability or the washout steady~state. Notice that the washout steady~state will only bc stable if D.I , is high enough. Wc can think of D.I , as a dynamic bi~ rurcation parameter, becausc the stability of the washout steadystate will depcnd on the valuc of the dilution ratc.
546
Biochemical Reactors
Module 8
Stability of Washout SteadyState for Substrate Inhibition. and (MS.52), the washout sleady~state will he stable if:
From (MS.50)
NONTRIVIAL
STEADY~STATES
For the nontrivial steadystates, D s = fL.\.. The stability requirerncnts for the nontrivial steadystates arc then:
 D _~\~L>:
s
II f
t:
<0
(MS57)
from the trCA) specification, and (MS.5S) from the det(A) specification. Since D.I. (and therefore 1J..), xis' and Yare positive, (MS.57)
and (MS.58)
rcdu~c
fL.: > 0
for slability.
(MS. 59)
(k m + x 2 \)
We see ilnmediatcly that fL,: is always positive for the Monod model at the nontrivial steadystate; therefore, the nontrivial steadystate is always stable. Recall that D.\. < fL.1 2 for a nontrivial steadystate solution. .(X !1.)
Stability of Substrate Inhibition at the Nontrivial SteadyStates. We can tcll from the substrate inhibition eurvc in Figure M8.2 that a steadystate that is on the left side of the peak will be slable (since fL.:: > 0), while a steadystate on the right side < 0). will be unstable (since Numerically, from (MS.36):
f.<
~_!lF1X _(k'II=!~J~~3,~:2. _
(MS.61 )
Sec. MS.7
547
The x2s that is on the left side of the peak, and is therefore slable, is (from (MS.31:
X2~
III
(M8.63) nontrivial
M8.7.5
Equilibrium Iwashout Equilibrium 2nontrivial Substrate Inhibition Equilibrium iwashout Equilibrium 2l1ol1trivial Equilibrium 3nontrivial
Xis::::::
xl.>
0 = 1.5374
X2,1':::::
x,., = 0.1565
= 4.0 = 1.5123 0.1745
4.0
unstable stable
.t Is =0
X2,
xL, = 0.9951
xl.>
= 1.5302
x2, x2,
M8.7.6
Case 2
For a steadystate dilution rate of D.).::::: 0.15, the reader should find the following results: Monod Equilibrium Equilihrium
l~washout
XLI'
L~nontrivial
Xli =
=0 1.5811
X2.\'
x"
= 4.0 = 0.0474
unstable stable
Xli
XL,
=0 = 0.6104 = 1.5809
X2.\':::;:
x"
Although there is a mathematical solution for cquilihrium 2, it is not physically feasible, since it corresponds to a negative biomass concentration.
548
Biochemical Reactors
Module 8
M8.7.7
r'or a
Case3
dilution rate of D s
:::::
steady~statc
Mouod
Equilibrium l~~washout Equilibriulll 2nontrivial
StC;:HJy~state
XIs::::
X2, ~
4.0
x",~2.0114
xl.,
~ ~ I J)286
Substrate Inhihition
EquilihriuI11 l,,,washout Equilibrium 211ontl"ivial
Equilibrium 3nontrivial
x'" ~ 4.13 
XIs:::::
x2,
X2., ~
The second and third steadystates (Irc not feasible because the concentrations for both the biomass and the StJbslratc are complex. There <Irc some vcry interesting changes ill the dynamic behavior of these lnodcls as we vary the dilution rate (again, we can think of dilution rate as a bifurcation parameter). Let us discuss this in order of the lowest dilution rate to the highest dilution rate.
Sec M8.8
Bifurcation Behavior
549
M8.8
BIFURCATION BEHAVIOR
The conditions for stahility developed in Section MS.7 can be used to develop stcadystate inputoutput diagrams for the numerical example presented in the previous sections.
M8.8.1
The diagram for the Monod model is shown in Figure M8.5. As calculated, the Monod model has two steadystates for dilution rates that arc less than the specific growth rate under the Iced conditions, D.I, < lL.Jx2J). The nontrivial steadystate is stable under those conditions, while the washout steadyslate is unstable. For Ds > fL/:t2f.J there is a single ' steadystale, lhe washoul steadystate, and it is stable.
M8.8.2
The diagram for the substrate inhibition model is shown in Figure M8.6. At low dilution rates, where D s < fL,JX 2f.i.) , there are two steadyslales (like the Monod model). The nontrivial steadyslate is stable under those conditions, while the washout steady~_~t~~!C is unstable. Por tbe intermediate dilution rate range, 1J./or2j) < D s < /L rna Jl + 2Vk 1k/ll'
5
unstable
4r....j
3
0.5
0.6
FIGURE M8.5
550
5
Biochemical Reactors
Substrate Inhibition Model stablo
\
Module 8
,, ,,
'\. unstable
" "0'Lo
FIGUHE M8.6
0.1
"
stable
0.3
.>
0.4
rate
"
0.2
0.5
0.6
dilution
Inplll~outpnt diagram
there arc three stcady~statcs. Two of these arc stable, while one is unstable. The stable steadyslate that is attained will depend upon the initial conditions of the concentra~ lions, or on the way that the process is started lip. When the dilution rate meets the condition that D,I_ > f.1.Jx 2j ), there is a single steadystate, the washout steadystate, and it is stable.
M8.8.3
It is interesting to note that the way that the biorcactor is started up will determine the steadystate concentrations that the reactor achieves.L,ook at Figllre M8.6. NotiC\.,~ that if we start at a very low dilution rate we will have only one stable steadystate, so the reactor IIltl:;;! operate at that condition. If we slowly increasc tJ.l~~tilution ratc, we relnain on the lowcr curve of r'igure M8.6. When V,I' > ~ll1a/1 + XVk1kl/i (1\ : ;: 0.36126 for this example), the stable solution suddenly "leaps" to the upper stahle steady~state (washout cOIl(Ii~ tions). As we increase Ds Luther, we remain on the washout curve. Now, assume that we arc starting out at a high dilution rate along the upper curve, the washout conditions. As we slowly decrease the dilution rate, we remain on the washout curve until D,I' ::::: ~,Jx2Jj')' which is D,I' ::::: 0,186] for this example. The stahle steadystate then "jumps" down to the lower curve. As we continue to deCl'case the dilution rate further. we remain on thc lower curve. The type of behavior shown in Figure M8.6 is known as hysteresis and is exhibited by a number of processes, including exothermic chemical reactors and valves that "stick." The chemical reactor example is discussed further in Module 9, The student should be able to show how the phaseplane behavior changes as a function of dilution rate, for the example shown in Figure M8.6.
Student Exercises
551
SUMMARY
The modeling equations for a biochemical reactor were developed for Monod and sub~ strate inhibition kinetics. We found that the Monod lnodel normally has two stcady~state solutions, while the substrate inhibition model normally has three steadystate solutions. At low dilution rates the substrate inhibition model behaves similarly to the Monod mode], with a single stable steady~state. Washout will not be a problem at the low dilution rates. At medium dilution rates the substrate inhibition model behaves quite differently from the Monod model. Depending on the initial conditions, the reactor will either con~ verge to a high conversion or to washout conditions for the substrate inhibition model. II has not been discussed thus far, but if we wish to operate at an intermediate (unstable) conversion level, then feedback control must be llsed. Notice that the Monod model still has only one stable point, and there is no danger of washout. At high dilution rates, both reactor models have only one feasible solutionwashout. The flow is simply too high (residence tinle too low) for any cell growth.
FURTHER READING
An excellent source for an introduction to biochemical engineering is: Bailey, .I.E., & D.F, Ollis. (1986), Biochemical Engineering Fundarnentals, 2nd ed, New York: McGrawHill.
STUDENT EXERCISES
1. In this module we developed the modeling equations assuming that no biomass is
fed to the reactor, Analyze the system studied for the case where the biomass feed concentration is 2.5% of the substrate feed concentration (so xII::::: 0.1 for the numerical values used ill this module). Is there still the possibility of a washout steadystate? 2. Modify bio, phas_gen.rn and bio.rn to perform a phaseplane analysis for cases 2 and 3 with the substrate inhibition model. 3. Data for specific growth rate coefficient as a function substrate concentration for a biochemical reactor are shown below:
fh, hrA1
o
0.1
o
0.38 0.54
0.25
552
Biochemical Reactors
Module 8
0.5 0.75 I
1.5
3 5
a. Estimate the parameter values for a Monod model (kill' ~max) b. The production rate of cells (biomass) is DBxl. Find the steadyslale value of the dilution rate that maximi7.es the production rate of cells. 'fhe substrate fecd concentration is 5 gllitcr. c. Find the steadystate concentration of biomass and substrate at this dilution rate. d. Find the linear statespace model at this dilution rale, with dilution rate and substrate feed concentration as the input variables. Also find the transfer function relating dilution rate to biomass concentration. e. Simulate the responses (using the nonlinear dynamic model) or the conccnln.l" lions or biomass and substrate to step increases and decreases of IWit;, in the di~ lution rate (changes are from the dilution rate found in b.). Compare these re~ suits with those of the linear system (remelnher to convert deviation variables back to physical variables). 4. In this module we have analyzed how the biomass and suhstrate concentrations change depending on the dilution rate. If the purpose of a particular biochemical re~ actor is to produce cells, then we arc more concerned with the production rate of cells. The' production rate is mass of cells produced per unit time: steadyslale production rate of cells = D/'xls For both the Monod and substrate inhibition models present(~din this modale, find the dilution rate that maximizes the production rate of cells. Analyze the stability of the reactor under this condition.
eqlla~
lit
lil
where the specific growth rate is a function of both the biomass concentration and the product concentration:
Appendixes
553
Variable
Value
0.4 gig
Variable
Value
f'
Pm
k,
IJ
"1'2
" !J.
2.2 gIg
max
kill
x21 xJ
J.:;
OAg lu J 1.2 g/litcr 20 gil iter 6 gIl iter 19.14 g/liter
Compare and contrast this rnode! with that of the twostate model with substrate inhibition kinetics presented in this module. h. Verify that the steadystate values for Xl' x 2 , and x] presented in the table above are correct. For a steadystate input of f):::;: 0.202 (and all of the other parameters constant), arc there (my additional solutions for the states (for example, the trivial solution?). Analyze the stability of all steady~state solutions obtained. c. Perform dynamic simulations of the nonlinear model, with step changes of 10(#) in the dilution rate. Discuss the resuIts or your step changes (Le., docs an increase or ~lecrease in f) have a greater effect on the biomass concentralion?). Compare your results with linear simulations.
H.
APPENDIXES
1
%
function f :::,
(x)
% b.w. bequette
% (e) %
16 Nov 92
% revised 18 July 96
IThis model is from Chapter 4 of the following Illonograph:Henson, M.A., & D.E. Seborg (cd.). (1997). Nonlinear Process Conlrol. Upper Saddle River, NJ: PrenticeHall.
554
Biochemical Reactors
Module 8
substrate
% biomass
CI,
("bugs") consumes the substrate dilution rate (F/V, timeAl) yield biomass/substrate specific DrowLh rate
param(:!Ler (both Monad and Substrate Tnhibi tion) parameter (both Monad and Substral~e Inhibition)
% y
9 6 mu 'l, mumax ~f, km "6 kl 'r, sf '?6
kl : : : () for Monod)
zeros (2, 1) ;
parameter values
D ~ 0.3; mumax 0:: 0.53;
%
%
9 0
mumax k x(2)/(km+x(2)+kl*x(2)*x(2));
% %
to drive f(l)
and f(2)
to Zero
f(l) f(2)
(mu
D)*x(l);
Appendixes
555
% where to is the initial time (usually 0), tf is % the final time and xO is the initial condition vector % xO (1) biomass initial conclition % xO(2) substrate initial condition
%
96 biomass ("bugs") consumeS the substrate '6 % state variables
biomass substrate
90
% % % %
%
 dil.ution rate (P/V, timeAl) yield biomass/substrate specific growth rate mu mumax  parameter (both Monad and Substrate Inhibition) parameter (both Manod and Substrate InhiJyit.1.on) km parameter (Substrate Inhibition only, kl :::; 0 for Monad) % kl 96 sf substrate feed concentration
D
"
zeros(2,1);
param(~t~(,~r
values
D O . 3;
sf  4.0;
kl
% %
0.4545;
Substrate Inhibit_ion expression for specific growth rate mu :::; mumaxk x(2) / (km+x(2) +k1k x(2) *x(2));
1s
9 0
{mu
D)'x(l);
(sI
x(2))*0  mu*x(l)jY;
556
%
Biochemical Reactors
Module 8
hold on
%
% select different initial conditions % xl ranges from 0.1 to 1.5 (every 0.35)
:!, x2 ranges from
%
to 5
(every 1.25)
% ncol
%
[mrow,ncol]
for i
%
;:c.
1:nc01;
"ode45('bio',0,30,[xO(:,i)]);
I
[t,xJ
%
'w' )
%
end
%
hold off
______________.L
!
Appendixes
557
Here we calculate the eigenvalues of the nontrivial solution: del(A/ A) where the trace and determinant arc
= A2  (r(A)A + dc(A) = 0
(MXAO)
(MXA5) (MXA6)
For the nontrivial solution,
11.1'':;:::: f),I':
11,;'X 1,1'
(MX.AI) (MX.A2)
A
 4 de( A
(MX.A3)
(MX.A4)
+
2
(MX.A5)
A=
y
~(=;L, 2
x';:r
(MX.A7)
A=
and our roots are:
(I~'_
x'p:)
(MX.AX)
558
Biochemical Reactors
Module 8
A.[ = /1)'
and
(MX.A9)
and since /1.1' ::::: D,I" we are assured that one pole will always he negative. The second root will only be positive if /1.: is negative. Since /1.: is positive for the Monod model, the nontrivial solution is stahle as long as the solution is feasible (D.I, < /1./x2f~.)). The fL; can be either positive or negative for the substrate inhibition model, so a J1()[]trivial slcadystate may either be slable or unstable.
MODULE
The purpose of this module. is to understand the steadystate and dynamic behavior of jacketed continuous stirred tank reactors (CSI'Rs), also referred to as diabatic CSTRs. After reviewing this rnodulc the student should be able 10 Understand the assumptions made in developing the classic CSTR model Understand the possihle steadystate behavior based on an analysis or the heat gellcrated by reaction ~lI1d removed through the cooling jacket Understand what is meant by multiple steadystates. Develop the hysteresis (1~1l1 lion/extinction behavior) inputoutput diagrams based on analysis of the heat gener
ation and rClllOval curves. [(clate these to saddlcllOdc and hysteresis bifurcations
from Chapter 15 Understand the dynamic behavior by linearization of nonlinear dynamic equation:.; followed by eigenvalue analysis Use phaseplane analysis to understand which steadystate a given initial condilinll will converge to Realize the possihility or limit cycle behavior (llopfhifurcations) 'rhe l11i:\jor sections inthis module are: M9.1 M9.2 M9.3 M9.4 M9.5 M9.6 Background The Modeling
[~quatiolls
559
560
F
Module 9
r
~
LU
CA
T, T
r
TjlrJ
Fi
FIGUH.E M9.1
M9.1
BACKGROUND
The most important unit operation in a chclnical process is generally a chemical reactor. Chemical reactions arc either exothermic (release energy) or endothermic (require energ) input) and therefore require that energy either be removed or added to the reactor for d constant temperature to he maintained. Exothermic reactions arc the most interesting systems to study because or potential safety prolJ]cll1s (rapid increases in tcrllpcraturc, S(HllCtimes called "ignition" behavior) and the possibility of exotic behavior such as Illultiple steadystates (for the same value of the input variable there may be several possible val~ ues of the output variable). In this Illodule we consider a perfectly mixed, continuously stirred tank reactor (CSl'I<),l shown in Iiigure M9.1. The case of a single, firstorder exothermic irreversible reaction,;1 > 11, will be studied. We will find that very interesting behavior can arise in such a simple system. In I<'igure M9.1 we see that a fluid stream is continuously fed to the reactor and another fluid stream is continuously removed from the reactor. Since the reactor is perfectly mixed, the exit stream has the same concentration and temperature as the reactor fluid. Notice that a jacket surrounding the reactor also has feed and exit streams. The jacket is assumed to be perfectly mixed and at a lower temperature than the l'C<lCtOL [':nergy thell passes through the reactor walls into the jacket, removing the heat generated by reaction.
ISomctimes this type or reactor is called "nonadiabatic'" The term adiabatic means "no he,ll loss," so the term nOliadiabatic cOllstitu{es a double negative (This point has been disclissed h) Barduhn, Chelll. Eng. Education, 19, J 71 (19X5)). We prefer to usc diabatic to describe this reactor.
Sec. M9.2
561
There are many examples of reactors in industry similar to this olle. Examples include various types of polymerization reactors, which produce polymers that arc lIsed in plastic products such as llOlystyrcnc coolers or plastic bottles. The industrial reactors typically have more complicated kinetics than we study in this module, but the characteristic behavior is similar.
M9.2
The constant volume and parameter value assumptions can easily be relaxed by the reader for further study.
M9.2.1
The parameters and variables that will appear in the modeling equations arc listed below for convenience.
A
(~\ C~V
Area for heat exchange Concentration of A in reactor Concentration of A in feed stream Heat capacity (cnergy/mass*tcmperature) Volumetric f10wrate (vohltne/time) Preexponential factor (timc J ) Ideal gas constant (energy/mol*tcmperature) Rate of reaction per unit volume (mol/volume'; time) Time Reactor temperature Feed temperature Jacket temperature Reference temperature Overall heat transfer coefficicnt (cnergy/(timc*area*tcmpcrature)) Reactor volume Activation energy (energy/mol) Heat of reaction (energy/mol) Density (mass/volume)
cp
F
ko
R
r
Ii
T.I
I~'(l U
\I
ali
(a H)
II
562
Module 9
M9.2.2
The rate of accumulation of material in the reactor is equal to the rate of rnatcrial in by flow  the material out by flow.
Assuming a constant amount ofrnatcrial in the reactor (dVp/dt:::::: 0), we find that:
and
dV/dt
M9.2.3
Balance on Component A
dt
(11191)
M9.2.4
Energy Balance
VOIUlllC,
Vpc"
dT
dt
(1119.2)
where (liB) VI' is the rate of energy contributed by the exothermic reaction.
M9.2.5
We can write (M9.1) and (M9.2) in the following state variable form:
t(C;\' T) ~ ,1
dCII dl
F V (CAl
(1119.1 a)
i/1'
dt
IV" (1; T)
Vpc p
(1119.2,,)
2It should he noted that the dellsity of all streams docs not need to remain constant for the modeling equations to holtL F'or example, DCllJl (1986) shows that as long as the density is a lincar function of concentratioll, the final modeling equations are correct.
Sec. M9.3
SteadyState Solution
563
= k o exp!,!1F) C" ( i
(M9.3)
M9.3
STEADYSTATE SOLUTION
The steadystate solution is obtained when dC,//dl ::: 0 and dlldl :::: 0, that is:
(M9.1 s)
Vpc p
VA (T T)
I
("19.2s)
To solve these two equations, all parameters and variables except for two (~\ and T) must be specified. Given numerical values for all of the parameters and variables we can lise Newton',,; method (Chapter 3) to solve for the steady~sLatc values of C~l and T. l<'or convenience, we usc an "s" subscript to denote a steadystate value (so we solve for CAs and [,J. In this module we will study the set of parameters showll for Case 2 conditions in 'Table M9.1. Cases I and j arc left as exercises for the reader.
M9.3.1
The function nl~file for the steady~state equations is cstr_ss . m and is shown in dix I. The command to run this file is
X
:=
where xO is a vector or the initial guesses and x is the solution. lkfore issuing this com~ mand the reactor parameters must be entered in the global parameter vector CS'I'R PAR.
TABLE M9.l
Parameter
Real'tor Parameters
Case 1
I 14,825*3600 5215
11,:\43
Case 2
I
Case :3
I
FlV. hr ko, hr l
500 25 10 250
18,194*'3600
Xl95
25
10 150 25
25
25
564
Module 9
We find that different initial guesses for the concentration and temperature lead to diffcr~ cnt solutions. When choosing initial guesses for a numerical algorithm, it is important to usc physical insight about the possible range of solutions. For example, since the feed concentration of A is 10 kgmollm 3 and the only reaction consumes A, the possible range for the concentration of A is 0 < Ct\ < 10. Also, it is easy to show that a lower bound for temperature is 298 K, which would occur if there was no reaction at all, since the feed and jacket temperatures arc 298 K. Notice also that there should be a correlation betwcen concentration and temperature. If the concentration of A is high, this means that not much reaction has occurred so Iittlc energy has been released by reaction and therefore the temperature will not be rtlllch different than the feed and jacket temperaturcs.
GUESS 1
l1if.:h cOll(..entratioll (1011' conversion), Ienv temperature. lIciT we consider an initial guess of (, =') and T = 300 K.
X :::::
8.5636 311.1710
GUESS 2
Intermediale concentration and temperature.
X ::::
x
5.5179 339.0971.
GUESS 3
Lmv concentration and high temperature.
x fsolve('cstr ss', [1;450J)
x 2.3589 368.0629
Sec. M9.4
TABLE Mt).2
Dynamic Behavior
565
(ILlCSS
300
8.564 311.2
350
5.518 339.1
450
2.359 368.1
so the stcadystale solution for guess 3 is l,;;,~~~I, that is, low concentration (high conversion) and high temperature. ' The results arc summarized in TablcM9.2, Other initial guesses do not lead to any other solutions, so we sec that there arc three possible solutions for this set of parameters. In Section M9.7 we show how to use physical insight to determine the Humber of steadystate solutions for this problem.
l(r"1
M9.4
DYNAMIC BEHAVIOR
We noted in the previous section that were three different steadystate solutions lo the Case 2 parameter set. Here we wish to study the dynamic behavior under this same parameter set. Recall that nlilIlerical integration techniques were presented in Chapter 4. The mfile to" integrate the modeling equations is cstr_ dyn.m, shown in Appendix 2. The command to integrate the equations is
[L,x]
=
where to is the initial time (usually 0), tf is the final time, xO is the initial condition veClor, t is the time vector, and x is Ihe slate variable solution vector. lJcfore performing the inlegration it is necessary 10 define the global parameter veclor CSTl{ PAR. '1'0 plot only concentration or temperature as a function of time, use plot (L, x ( : ,1)) and plot (t, x ( : 2) ), respectively.
J
M9.4.1
Initial Condition 1
Here we use initial conditions that arc close to the low temperature steadystate, The initial condition vector is [conc, temp] :;:: [9,300]. The curves plotted in r,'igure M9.2 show that the state variables converge lo the low temperature steadystale.
M9.4.2
Initial Condition 2
Here we usc initial conditions that arc close to the intermediate temperature steadystate. The initial condition veclor ror the solid curve in Figure M9.3 is [conc, temp] :;;: [5,350], which converges to the high temperature steadyslale. The initial condition vector for the
566
9.5
c " "
0
Module 9
9
8.5 0
10
time, hr
" 0:
'"E
" '"
ID
6
time, hr
10
FIGURE l\iI9.2
dotted curve in Figurc M9.3 is leonc, tcmpl 0::::: fS,32Sl, which converges to the low temperature steadystate. If we perform lllallY simulations with initial conditions close to the intermediate temperature steadystate, we find that the telnpcraturc always converges to either the low temperature or high temperature steadystates, but not the intennediate temperature steadyslate. This indicates to us that the intermediate tcmperature steadystate IS lIflstable. This will be shown clearly by the stahility analysis in Section M9.5.
10
" "
c
0
5 0 0
2 4
6
time, hr
10
" '"
'" " 0:
'"E
4
time, hr
10
FIG1JRE 1\19.3 Stale variable responses with initial condition (solid) and xO:;;: [5;325] (dashed).
~\"O
:;: 15;3501
Sec. M9.5
567
c
0
2
0 0
6
time, hr
10
6 time, hr
10
FIGURE 1\'19.4
M9.4.3
Initial Condition 3
Ilere we usc initial conditions that arc close to the high temperature steadystate. The initial condition vector is [COile, templ = f 1,4001. The curves plotted in P'igureM9A show that the state variables converge to the high temperature stcady~statc. In this section we have pcrfonncd several simulations and presented several plots. In Section M9.6 we will show how these solutions can be compared on the saille "phascplane" plot.
M9.5
space form:
x=Ax+BII
and dctcrmining the eigenvalues of thc A (statespace) matrix. The nonlinear dynamic state cquations (M9.la) and (M9,2a) arc:
(M9.11)
dC., dt
dT dt
(M9.1 a)
( p;',;I) k C ~ CT.
el
UII
vpe"
T+
UII T VIIC I
+ FT
V
f
(M9.2a)
"
568
Module 9
L,ct the state and input variables be defined in dcviittiou variable form:
x '" I. c" T T
"
CA'J
II
=~
r

C:'ilf  CilI~'
J T TJS
Ii  Ii,
M9.5.1
Stability Analysis
.11 12
/\21
il/;
il/, ile.,
..
 ks
 C A /<
( 6./1)
pCI'
aCA
ks
(fA
An
ax')
.=
a/;
aT
k exp () ak,
il/;
VpC~)
(6.11)
pCp
CA,lk:
k,
6.F) ( RT .
1
aT
or,
F
A =
V k\
(M9.12)
J(\
(6.11),
' ( p,p
The stability characteristics arc determined by the eigenvalues of A, which are obtained by solving del('\' I  A) ;::; o.
Sec. M9.5
569
A1 A
I,..
AA" An

det()" 1 A)
()"  A,,)(A  A 22 )
 ),,2_
A"A 2I
 ),,'(trA)"
+ del (A)
(M9.13)
'fhe stability of a particular operating point is determined by finding the A matrix for that particular operating point, and finding the eigenvalues of the A matrix.
Here we show the eigenvalue..., for each of the three case 2 steadystate operating points. We usc the function routine cstx_"amat. ill shown in appendix 3 to find the A matrices.
OPERATING POINT 1
The concentration and temperature arc 8.564 kgmol/m 3 and 31 J.2 K, respectively.
[ama t. , 1 ambc1a ]
cstr_amatI8.564,311.21
0.0886 0.2443
lambda : : ; 0.8957
'0.5166
Both of the eigenvalues arc negative, indicating that the point is stable, whieh is consistent with the results ol'Figure M9.2.
OPERATING POINT 2
The concentration and temperature arc 5.51 Hand 339.1, respectively. [amat,lambda] amat = 1.8124 9.6837 lambda = 0.8369 0.4942
=
cstr amat(5.518,339.1)
0.2324 1. 4697
570
Module 9
One of tile eigenvalues is positive, indicating that the point is ullstable. This is consistent with the responses presented in Figure M9.3.
OPERATING POINT 3
[amat,lambda] amat :::;
~4.2445 ~O.3367 ~
cstr_amat(2.359,368.1)
38.6748
2.7132
+
~
lambda :::;
~O.7657 ~O.7657
O.9584i O.9584i
The rcal portion of each eigenvalue is negative, indicating that the point is stable; again, this is consistent with the responses in Figure M9.4.
M9.5.2
(M9.14)
 7jJ arc:
iJj; =
all,
= _
a'lj
=
aj;
=0
VA
VpCp
dU l
a/2 = aI,
aTj
The reader should find the elemenls of the B matrix that correspond to the second and third input variables (sec studcnt cxercise 8). llerc wc show only the transfer functions for the low temperature steady~state for Case 2. Thc input/output transfer function relating jacket tcmperature to reactor concentration (state I) is:
0.0266
+ l,4123s + 004627
+ 1)
and the input/output transfer function relating jacket temperature to reactor temperature (state 2) is
g2l(S)
Notice that the transfer function for concentration is a pure secondorder system (no numerator polynomial) while the transfer function for temperature has a firstorder nutllcra
Sec. M9.6
PhasePlane Analysis
571
tor and secondorder denominator. This indicates that there is a greater "Jag" bCl\vCen jacket temperature and concentration than between jacket temperature and reactor temperature. This Inakcs physical sense, because a change in jackel temperature must first affect the reactor temperature before atTccling the reactor concentration.
M9.6
PHASEPLANE ANALYSIS
In Section M9.4 we provided the results of a fc\v dynamic simulations, noting that diffcr~ cnl initial conditions caused the system to converge to different steadystate operating points. In this section we construct a phaseplane plot by performing simulations for a large nUlubcr of initial conclitions. The phaseplane plot shown in Figure M9,5 was generated using cstr_]un. m and cstr.m [rom the appendix. Three steadystate values arc clearly shown; two are stable (the high and low temperature steadystates, shown as '0'), while one is unstable (the intennediate temperature steadystate, shown as 't'). Notice that initial conditions of low concentration (0.5 kgmolhn1) and relatively lowtointermediate temperatures (300 to 365 K) all converge to the lowtelnperature steadystate, When the initial temper~ ature is increased above 365 K, convergence to the hightemperature steadystate is achieved. Now, consider initial conditions witb a high concentration (9.5 kglllollm 3) and 1m\' temperature (300 to 325 K); these converge to the lowtemperature steadystate. Once the initial temperature' is increased to above 325 K, convergence to the hightemperature steadystate is achieved. Also notice that, once the initial temperature is increased to around 340 K, a very high overshoot to above 425 K occur;.;, before the system settles down to the hightemperature steadystate. AHhough not shown on this phaseplane plot, higher initial temperatures can have overshoot to over 500 K before settling to the hightemperature steadystate, This could cause potential safety prohlenls if, for example, secondary decomposition reactions occur at high temperatures. The phaseplane analysis then, is able to point out problem initial conditions. Also notice that no initial conditions have converged to the intermediate telnpcrature steadystate, since it is unstable. The reader should perform an eigenvalue/eigenvector analysis for the A matrix at each steadystate (low, intermediate, and high temperature) (sec student exercise 3). You will find that the low, intermediate, and high temperature steadystates have stable node, saddle point (unstable), and stahle focus behavior (sec Chapter 13), respectively. It should be noted that fcedback control can be used to operate at the unstable intermediate temperature steady~state. The feedback controller would measure the reactor temperature and manipulate the cooling jacket tcmperature (or f1owrate) to m8intain the intermediat.e temperature steadystate. Also, a feedback controller could be used to make certain that the large overshoot to high temperatures docs not occLir from certain initial conditiclIls.
572
Module 9
420
400
'"
380
"0
'"
ID
*~ 360 iii ID
 340
"
320
300
o
FIGURE M9.5 arc marked with
10
concentration, kgmol/ml\3
'0'.
Phaseplane plot for Case 2. Stable points (conditions I and:1) The unstable point (condition 2) is marked with '+'.
M9.7
M9.7.1
In Section M9.3 we used numerical methods to solve for the steadystates, hy solving two equations with two unknowns. In this section we show that it is casy to reduce the