Continuous System Modeling


  1. Introduction, Scope, and Definitions
    1. What is a System?
    2. What is an Experiment?
    3. What is a Model?
    4. What is a Simulation?
    5. Why is Modeling Important?
    6. Why is Simulation Important?
    7. The Dangers of Simulation
    8. Good Reasons to Use Simulation
    9. The Types of Mathematical Models
    10. Direct Versus Inverse Problems

  2. Basic Principles of Continuous System Modeling
    1. Introduction
    2. The Algebraic Loop Problem
    3. Memory Functions
    4. Explicit Versus Implicit Integration
    5. Implicit Loop Solvers
    6. Procedural Sections
    7. The Basic Syntax of Current CSSLs
    8. Discontinuity Handling
    9. Model Validation

  3. Basic Principles of Electrical Network Modeling
    1. Introduction
    2. Mesh Equations
    3. Node Equations
    4. Disadvantages of Mesh and Node Equations
    5. State-Space Models
    6. Algebraic Loops
    7. Structural Singularities
    8. Disadvantages of State-Space Models

  4. Basic Principles of Mechanical System Modeling
    1. Introduction
    2. Newton's Law for Translational Motions
    3. Newton's Law for Rotational Motions
    4. The Crane Crab Example
    5. Modeling Pulleys
    6. The Inverse Pendulum Problem
    7. Modeling Electro-Mechanical Systems

  5. Hierarchical Modular Modeling of Continuous Systems
    1. Modeling Transfer Functions
    2. Modeling Static Characteristics
    3. Dynamic Table Load
    4. Modular and Hierarchical Modeling
    5. The Macro Facility
    6. Modular State-Space Models
    7. The Equation Solver
    8. Code Optimization
    9. Linear Algebraic Loops
    10. Nonlinear Algebraic Loops
    11. Structural Singularities
    12. Large-Scale System Modeling
    13. Graphical Modeling

  6. Principles of Active Electrical Circuit Modeling
    1. Topological Modeling
    2. Models of Active Devices in SPICE
    3. Hierarchical Modeling
    4. Transient Analysis in SPICE
    5. Graphical Modeling
    6. Circuit Design Using DYMOLA
    7. How DYMOLA Works

  7. Bond Graph Modeling
    1. Block Diagrams
    2. Signal Flow Graphs
    3. Power Bonds
    4. Bond Graphs for Electrical Systems
    5. Bond Graphs for Mechanical Systems
    6. Generalization to Other Types of Systems
    7. Energy Transducers
    8. Bond Graph Modeling in DYMOLA
    9. The Dual Bond Graph

  8. Modeling Nonequilibrium Thermodynamics
    1. Power Flow
    2. Thermal Conduction
    3. Thermal Convection
    4. Thermal Radiation
    5. Thermal Inertance: The Missing Link
    6. Irreversible Thermodynamics

  9. Modeling Chemical Reaction Kinetics
    1. Introduction
    2. Chemical Reaction Kinetics
    3. Chemical Thermodynamics
    4. The Equation of State
    5. Chemical Reaction Bond Graphs
    6. Energies of Formation
    7. Continuous Reactors
    8. Photochemistry, Electrochemistry

  10. Population Dynamics Modeling
    1. Growth and Decay
    2. Predator-Prey Models
    3. Competition and Cooperation
    4. Chaos
    5. The Forces of Creation

  11. System Dynamics
    1. Introduction
    2. The Laundry List
    3. The Influence Diagram
    4. The Structure Diagram
    5. Structure Characterization
    6. Causality
    7. Differential Versus Difference Equations
    8. The Larch Bud Moth Model
    9. The Influenza Model
    10. Forrester's World Model
    11. Model Validation

  12. Naive Physics
    1. Introduction
    2. Definitions
    3. State Discretization and Landmarks
    4. Operations on Qualitative Variables
    5. Functions of Qualitative Variables
    6. Qualitative Simulation
    7. Qualitative Discrete-Time Simulation
    8. Pros and Cons

  13. Inductive Reasoning
    1. Introduction
    2. The Process of Recoding
    3. Input/Output Behavior and Masking
    4. Inductive Modeling and Optimal Masks
    5. Forecasting Behavior
    6. A Linear System - An Example
    7. Gambling the Stock Market
    8. Structure Characterization
    9. Causality

  14. Neural Networks and Genetic Algorithms
    1. Introduction
    2. Artificial Neurons
    3. Artificial Neural Engineering Networks
    4. The Pattern Memorizing Power of Highly Rank-Deficient Matrices
    5. Supervised and Unsupervised Learning
    6. Neural Network Software
    7. Neural Networks for Dynamical Systems
    8. Global Feedback Through Inverse Networks
    9. Chaos and Dreams
    10. Internalization Processes and Control Mechanisms
    11. Genetic Learning
    12. Neurobiological Learning

  15. Automated Model Synthesis
    1. Introduction
    2. Level One: Classical Simulation Models
    3. Level Two: Object-Oriented Modeling
    4. Level Three: The System Entity Structure
    5. Level Four: The Generalized SES
    6. Level Five: Goal-Driven Pruning
    7. The Cable Reel Problem


Modeling and simulation have become endeavors central to all disciplines of engineering and science. They are used in the analysis of physical systems where they help us gain a better understanding of the functioning of our physical world. They are also important to the design of new engineering systems where they enable us to predict the behavior of a system before it is actually built. Modeling and simulation are the only techniques available that allow us to analyze arbitrarily nonlinear systems accurately and under varying experimental conditions.

The two books, Continuous System Modeling and Continuous System Simulation, introduce the student to an important subclass of these techniques. They deal with the analysis of systems described through a set of ordinary or partial differential equations or through a set of difference equations. These books do not describe the techniques of discrete-event modeling and simulation since those are quite distinct from the techniques that are at the heart of our discussion, and since excellent texts can be found on the book market that deal with discrete-event modeling and simulation explicitly and exclusively. However, this does not mean that the systems which can be tackled by either of the two classes of modeling and simulation techniques are necessarily different. One and the same system can often be modeled either through differential equations or through discrete events, depending on the granularity level of the desired model. Yet, as the reader may have already noticed, my two books are quite bulky as they are, and adding the concepts of discrete-event modeling and simulation to the text would have meant adding several hundred pages more. I felt that this was not justified.

This book introduces the concepts of modeling, i.e., it describes the transition from the physical system itself down to an abstract description of that system in the form of a set of differential and/or difference equations. This text has a flavor of the mathematical discipline of dynamical systems, and is strongly oriented towards the Newtonian physical sciences. The concepts of mass and energy conservation, and the laws of thermodynamics are at the heart of the discussion. Various modeling techniques such as bond graphs and System Dynamics are introduced, and various specialized software tools such as Dymola and Stella are presented, techniques and tools which support the process of modeling. While some chapters introduce new modeling techniques, others exercise previously introduced concepts by means of virtually hundreds of practical examples. I believe strongly in the idea of "learning through practice." While the basic modeling concepts are introduced in methodology chapters, many of the tricks -the blows and whistles of modeling- are presented in the flow of discussing examples.

The companion book, Continuous System Simulation, introduces the concepts of simulation, i.e., it describes the transition from the mathematical model to the trajectory behavior. This text has a flavor of the mathematical discipline of applied numerical analysis. It introduces some of the techniques currently available for the numerical integration of differential equations, it talks about the generation of random numbers and the design of statistical experiments, and it introduces parameter estimation techniques. Finally, the basic principles behind the design of simulation software and simulation hardware are presented from a computer engineering point of view.

Here at the University of Arizona, the material is taught in two consecutive courses which are open to both graduating seniors and graduate students, and this is the ideal setting for use of these books in a classroom environment. The texts are organized in such a manner that they contain only a few cross references between them. Consequently, it is feasible to study the material described in the companion book prior to the material contained in this book, although I recommend starting with this book. The material is perfectly understandable to juniors as well (no junior level prerequisites for these courses exist), but the teacher will have to keep a fairly rapid pace in order to make it through an entire volume in one semester, and he or she must rely on home reading. This pace may be too stiff for most juniors. That is, when teaching these topics at junior level, the teacher will probably have to restrict himself or herself to covering the first few chapters of each text only, and for that purpose, better textbooks are on the market, books which cover these introductory topics in broader depth.

The two texts have been written by an engineer for engineers. They teach the essence of engineering design. Engineering intuition is often preferred over mathematical rigor in the derivation of formulae and algorithms. My home department is the Department of Electrical and Computer Engineering. However, the two courses are cross-listed in the Computer Science Department, and they are regularly attended by graduate students from the Aeronautical and Mechanical Engineering Department, the Systems and Industrial Engineering Department, and the Applied Mathematics Program. These students perform equally well in the classes as our own students, which reflects the fact that the applications covered in these courses stem from a wide variety of different topic areas.

Due to the interdisciplinary nature of the subject matter, each chapter has been organized as a separate entity with a "front matter" and a "back matter" of its own. Thus, each chapter is in fact a minibook. The front matter consists of a Preview section which tells the student what she or he can expect from the chapter. The bulk of the chapter contains a number of subsections. It often starts with an Introduction, and it always ends with a Summary. The back matter starts with the Reference section, often followed by a Bibliography section which is not meant to be exhaustive, but which can provide the student with a selected set of pointers for further reading. Following the bibliography, all chapters offer a Homework Problems section. More difficult homeworks are marked with an asterisk. Most homeworks can be solved within a few hours. Most chapters also have a Projects section which is meant to provide the student with ideas for senior projects and/or masters' theses. This section shows to the student that the topics mastered can be directly applied to larger and more serious problems. Finally, many chapters end with a Research section in which open research problems are presented which might be tackled by M.S. or Ph.D. students in their theses and/or dissertations. The projects and research sections are meant to enhance the student's motivation since they show that the topics learned can be used in serious research. These sections are not meant to be discussed in class, but are recommended for home reading.

Studying science is fun, and understanding science by means of mathematical models is even more fun. I experience the development of these textbooks as an extremely creative and rewarding endeavor which provides me with much satisfaction. I hope that my own fascination with the subject matter is reflected in my books and will prove to be highly contagious.

About This Book

This text introduces concepts of modeling physical systems through a set of differential and/or difference equations. The purpose of this endeavor is twofold: it enhances the scientific understanding of our physical world by codifying (organizing) knowledge about this world, and it supports engineering design by allowing us to assess the consequences of a particular design alternative before it is physically built.

Chapter 1 introduces the basic terminology and provides the student with a motivation for the class.

Chapter 2 introduces the primary concepts behind the user interface of state-of-the-art simulation software. At the end of Chapter 2, the student should be able to use continuous-system simulation languages such as DARE-P, Desire, and ACSL, and she or he should be able to formulate simple differential equation models in terms of these software systems.

Chapters 3 and 4 introduce basic modeling concepts used in electrical engineering (Kirchhoff's laws applied to RLC circuits) and in mechanical engineering (Newton's law applied to spring-damper-mass systems). These concepts are very basic, and every engineer can be expected to master these concepts irrespective of his or her home department. I usually defer the last few pages of Chapter 4 (the Euler equation, the Lagrangian, and the Hamiltonian) to home reading and do not request this material in any tests.

Chapter 5 deals with the concepts of modular and hierarchical modeling. It is shown how hierarchical models can be implemented in current simulation languages using macros, and the shortcomings of this approach are demonstrated. The modeling language Dymola is introduced as an alternative, which provides for true modular modeling.

Chapter 6 is the first of a series of more specialized chapters. It deals with advanced concepts of electronic circuit modeling. It introduces SPICE, the most common among today's circuit simulators, and it shows how Dymola might be used as an alternative. Dymola provides much more insight into the internal structure of submodels than SPICE does. When I teach this course, I skip over the details of the bipolar transistor model and refer this to home reading not requested on any test. This chapter can be easily skipped except for the section "How Dymola Works," which should be read in preparation for the next chapter.

Chapter 7 is an important methodological chapter. It introduces the concept of bond graph modeling which provides the student with a tool essential to the understanding of the functioning of physical systems in general. The chapter contains a short survey of bond graph modeling software and discusses in greater detail how Dymola can be used for bond graph modeling.

Chapter 8 applies the freshly mastered methodological tool of the bond graph to phenomena of thermodynamics, namely, conduction, convection, and radiation. This chapter sheds light on the mechanisms of power flow and energy conservation in general. Mastering the knowledge provided in this chapter can be expected of all engineers, physicists, and applied mathematicians irrespective of their home department. This chapter presents a project (modeling of a solar-heated house) which may be worthwhile discussing in class since it introduces a new concept: hierarchical modeling with bond graphs.

Chapter 9 is also a more specialized chapter. It is aimed at chemical engineers. Here, bond graphs are applied to the thermodynamic modeling of chemical reaction systems. When I teach this course, I treat this chapter in a somewhat skimpy fashion, and I leave the sections dealing with chemical reactors, photochemistry, and electrochemistry away. However, this chapter contains a number of very important lessons. For the first time, mixed energy systems are treated in a unified and uniform manner, and the laws of thermodynamics as taught in this chapter are fundamental to the understanding of physics in general. From this perspective, Chapter 9 may easily be the most important chapter of the entire text.

Chapter 10 deals with population dynamics. This chapter addresses a number of important methodological issues such as the differences between deductive modeling and inductive modeling. It also introduces the concept of chaotic motion, and it finally deals with the exotic issue of modeling the evolution.

Chapter 11 introduces another methodological tool, System Dynamics, and presents another modeling software, Stella, which is based on this modeling methodology. This chapter also discusses basic problems in structure characterization and causality determination. The applications include Forrester's world model.

Chapters 12 to 15 present the student with an introduction to various interfaces between modeling, simulation, and artificial intelligence. The techniques presented include the naive physics approach to modeling, inductive reasoning, a tool for optimal forecasting of poorly understood systems, and artificial neural networks and genetic algorithms, two techniques that attempt to mimic the behavior of adaptive biological systems. Chapter 15 introduces a methodology for management of models of complex systems. These four chapters are fairly independent of each other and can be dealt with in an arbitrary sequence. They can be skipped or included depending on the teacher's emphasis and interests. All of these chapters are strongly research-oriented and open up more questions than they provide answers for.

According to my judgment, this text presents the most comprehensive account of modeling methodologies for continuous systems currently available. While many individual texts can be found that deal with particular aspects of any one of these techniques, they are often difficult to read because they all use a different terminology, a natural consequence of the interdisciplinary nature of modeling and simulation methodology. In this text, major emphasis has been placed on unifying the terminologies and the presentation style of the various techniques discussed.

I hope that this text, besides providing students with an easily digestable overview of continuous systems modeling techniques, may stimulate further work in this fascinating research area and will also prove of use to the accomplished practitioner.

After working on this text intensively for over two years, I feel like I am giving birth to a long-expected baby. The book is a source of pride and joy ... and finishing it leaves an empty spot in my stomach.

Introduction, Scope, and Definitions

This chapter attempts to motivate the student for the course. Why should he or she study modeling and simulation? What can these techniques do for him or her that other techniques might not? We shall start out with some basic definitions of terms that will be used in this text over and over again, such as the terms "system," "experiment," "model," and "simulation." We shall then discuss good and bad reasons for using modeling and simulation as problem-solving tools. Finally, we shall list areas of science and engineering to which modeling and simulation have been successfully applied, and we shall explain what makes these various application areas different from each other and why the modeling and simulation approaches taken in these application areas vary so drastically from each other.

Basic Principles of Continuous System Modeling

In this chapter, we shall introduce some basic concepts of continuous system modeling. By the end of this chapter, the student should be able to code simple modeling problems in some of the currently used simulation languages. The languages ACSL, DARE-P, and DESIRE are introduced in order to demonstrate the similarities that exist between the various continuous system simulation languages.

Principles of Passive Electrical Circuit Modeling

In this chapter, we shall discuss issues relating to the modeling of simple passive electrical circuits consisting of sources, resistors, capacitors, and inductors only. The traditional approach to this type of system is through either mesh equations or node equations. However, the resulting models are not in a state-space form and they cannot easily be converted into a state-space form thereafter. We shall also discuss another technique that allows us to derive a state-space model directly and we shall see why this approach is not commonly used. Very often, the resulting equations contain either algebraic loops or structural singularities.

Principles of Planar Mechanical System Modeling

In this chapter, we shall deal with the dynamic behavior of translational and rotational planar motions. The basic physical law governing this type of systems can be expressed in terms of either Newton's law for translational and rotational motions or the d'Alembert principle. The concepts will be by means of a number of practical examples, such as a crane crab system and an inverted pendulum. Toward the end of the chapter, we shall discuss electromechanical transducers.

Hierarchical Modular Modeling of Continuous Systems

To this point, we have dealt with very simple and small problems. In this chapter, we shall cover some of the techniques necessary for modeling larger systems. Very often, systems consist of subsystems that may be described in quite different ways. Besides state-space representations and topological descriptions (which we have met previously), subsystems may also be described in the frequency domain in terms of transfer functions or may simply be given as a static characteristic relating one output variable to one or several input variables. It is therefore important that models can be structured. Modular modeling enables us to encapsulate subsystem descriptions and treat them as unseparable entities that can be incorporated in a hierarchical fashion within ever-more-complex system descriptions.

Principles of Active Electrical Circuit Modeling

In this chapter, we shall discuss the tools and techniques of today's professional circuit designers. We shall discuss how SPICE works and what additional tools exist that support SPICE, such as the PROBE feature for viewing simulation trajectories graphically or WorkView for schematic capture. We shall then explore the pros and cons of using Dymola for electronic circuit modeling.

Bond Graph Modeling

When I read a technical paper written by an author from whom I have not read anything before, I usually find that I have the biggest problems not with mastering the intellectual challenges that the paper presents, but with understanding the author's terminology and relating it back to concepts with which I am familiar. In this context, modeling is a notoriously difficult subject since it is so utterly interdisciplinary. It is therefore one of the major goals of this text to introduce a variety of different modeling concepts (terminologies) and relate them to each other. In this chapter, we shall discuss several graphical modeling techniques among which, in more detail, the bond graph modeling technique has found widespread acceptance and use among a number of modelers from several application areas, particularly mechanical engineers. We shall see that bond graphs are very easy to relate back to previously introduced concepts, and yet they are somewhat difficult to read on first glance.

Modeling in Nonequilibrium Thermodynamics

Until now, we have dealt with applications from either classical mechanics or electrical circuits exclusively. In this chapter, we shall discuss nonequilibrium state thermodynamics. Most engineering students consider thermodynamics a rather difficult topic. The reason for this seeming difficulty lies in the fact that basically all available treatises of thermodynamics have been written by physicists rather than by engineers. Physicists are, by education, phenomenologically rather than systemically oriented. They do not wish to change the world, only to understand it. Therefore, their approach to dealing with problems is quite different from ours. Rather than looking at a system as a whole and trying to analyze the couplings of its subsystems (as we engineers do), they always try to single out individual phenomena and discuss those in isolation. As a consequence, most physics texts present the topic through a collection of various formulae, which are all individually correct and meaningful but hard to relate to each other. It is the aim of this chapter to bridge the gap between those individually well-known equations that govern the behavior of nonequilibrium state thermodynamic systems. According to Jean Thoma, another reason why most thermodynamics textbooks are obscure is the fact that they avoid to work with entropy flow as a physical variable. He remarks rightly that textbooks for electrical circuit theory would be equally obscure if they were to describe all electrical phenomena in terms of the electrical potential and the stored energy alone while avoiding the concept of current flow. In this text, thermodynamic phenomena will be described through a set of adjugate variables comparable to those used in electrical circuits and in mechanical motion.

Modeling Chemical Reaction Kinetics

In previous chapters of this text, we have considered various forms of energy, however, we treated them mostly in isolation. Transitions between different forms of energy were accomplished by so-called energy transducers, but, until now, no more than two forms of energy were involved in any such transition. Chapter 8 shed some light on distributed processes and showed how one form of energy, namely, heat, is transported by and transmitted through matter. In this chapter, we shall discuss what happens to the total energy balance when one type of matter interacts with another, i.e., we shall look at the thermodynamics of chemical reaction systems. Notice that, in this analysis, we are not so much interested in the chemical properties of matter (such as color, taste, smell, or toxicity), as we are interested in the physical properties of matter (such as temperature, pressure, volume, flow rate, or concentration). In this discussion, it will be unavoidable to consider a multitude of simultaneously occurring energy transitions.

Population Dynamics Modeling

Until now, we have dealt with deductive modeling exclusively, i.e., all our models were created on the basis of a physical understanding of the processes that we wished to capture. Therefore, this type of modeling is also frequently referred to as physical modeling. As we proceed to more and more complex systems, less and less meta-knowledge is available that would support physical modeling. Furthermore, the larger uncertainties inherent in most physical parameters of such systems make physical models less and less accurate. Consequently, researchers in fields such as biology or economics often prefer an entirely different approach to modeling. They make observations about the system under study and then try to fit a model to the observed data. This modeling approach is called inductive modeling. The structural and parametric assumptions behind inductive models are not based on physical intuition, but on factual observation. This chapter illustrates some of the virtues and vices associated with inductive modeling and lists the conditions under which either of the two approaches to modeling is more adequate than the other. This chapter documents how population dynamics models are created, discusses the difference between structural and behavior complexity of models in general, introduces the concept of chaotic motion, and addresses a rather difficult issue, namely, the question of self-organization within systems.

System Dynamics

In this chapter, we shall introduce a general strategy for inductive modeling, a strategy that will allow us to model systems with totally unknown meta-laws. Of course, models so constructed will not offer the same degree of validity as deductively constructed physical models and it will be important to discuss how the validity of these models can be assessed. While the methodology can be used to construct models in a completely inductive manner, it will allow us to incorporate in our model any physical insight that we may possess about the functioning of the process under investigation. The methodology has been coined System Dynamics. This is unfortunately somewhat of a misnomer. Haven't we been discussing the "dynamics of systems" in this book all along? Didn't I reference in Chapter 4 a book entitled System Dynamics that talks about simple electrical and mechanical systems? In this new context, "System Dynamics" denotes a specific semiphysical and semiinductive modeling methodology. To minimize the confusion, from now on, I shall always capitalize the term "System Dynamics" when I refer to this particular modeling methodology and not capitalize it when I refer to the dynamics of systems in general.

Naive Physics

Until this point, we have focused on a single question throughout this entire text: How can we get computer programs to mimic the behavior of physical systems. In this chapter, as well as in the following chapters, we shall deal with quite a different issue: We shall try to understand how humans model the behavior of physical systems in the absence of a computer, i.e., how they reason about the functioning of a device or process. In other words, we shall try to model the process of understanding itself. Naive physics is one methodology that can address this question. Other methodologies will be discussed in due course.

Inductive Reasoning

In the last chapter, we discussed a crude approach to analyzing the behavior of a system by means of a coarse, qualitative, structural description of the real physical system. The claim was that this models the way humans reason about processes, and since humans are very adept at making correct decisions on the basis of incomplete knowledge, this approach may enable algorithms to duplicate such aptitude. It turned out that the results were not as promising as some researchers would like us to believe. Strong indicators can also be found that humans mostly assess the behavior of a system not on the basis of qualitative physical considerations, but on the basis of analogies with similar processes, the operation of which they have previously observed, i.e., that they use pattern recognition to analyze system behavior. In this chapter, we shall discuss one of several pattern recognition techniques that may be able to mimic how humans apply pattern recognition to reason about system behavior.

Artificial Neural Networks and Genetic Algorithms

In Chapters 12 and 13, we have looked at mechanisms that might lead to an emulation of human reasoning capabilities. We approached this problem from a macroscopic point of view. In this chapter, we shall approach the same problem from a microscopic point of view, i.e., we shall try to emulate learning mechanisms as they are believed to take place at the level of neurons of the human brain and evolutionary adaptation mechanisms as they are hypothesized to have shaped our genetic code.

Automated Model Synthesis

In Chapters 12 to 14 of this text, we tried to imitate (model) the human ability to reason about system structure and system behavior. Now we shall let go of this constraint and discuss whether we can duplicate this capability in an analogical rather than a homomorphic fashion, i.e., we shall try to simulate human reasoning capabilities without restricting ourselves to methods that humans would or could use in their reasoning processes. This final chapter describes the goal-driven automated generation of models from a set of design specifications. A five-level hierarchy is proposed that supports the automated generation of both models and simulation experiments from an abstract description of an overall design and from an abstract description of the goals of the simulation study. The aim is to be able to automatically synthesize models and experiments in a top-down fashion from a description of their components and the couplings between these components. Detailed submodel descriptions are extracted from template files that reside in model libraries. The chapter starts with an assessment of the need for the proposed automated model synthesis methodology. Thereafter, the advocated five-level hierarchy is presented in a bottom-up fashion starting with classical approaches to continuous-system simulation (the first and bottom layer of our hierarchy), and advancing to higher and higher levels of abstraction. The chapter ends with the presentation of a complete example of the proposed methodology, now presented in a top-down fashion.