CHAPTER 2 Fundamentals of Mathematical Modeling CHAPTER PREVIEW In this chapter, formal definitions and terminology relating to mathe- matical modeling are presented. The key steps involved in developing mathematical models are identified, and the tasks to be completed under each step are detailed. While the suggested procedure is not a standard one, it includes the crucial components to be addressed in the process. The application of these steps in developing a mathematical model for a typical environmental system is illustrated. 2.1 DEFINITIONS AND TERMINOLOGY IN MATHEMATICAL MODELING G ENERAL background information on models was presented in Chapter 1, where certain terms were introduced in a general manner. Before con- tinuing on to the topic of developing mathematical models, it is necessary to formalize certain terminology, definitions, and conventions relating to the modeling process. Recognition of these formalities can greatly help in the selection of the modeling approach, data needs, theoretical constructs, math- ematical tools, solution procedures, and, hence, the appropriate computer software package(s) to complete the modeling task. In the following sections, the language in mathematical modeling is clarified in the context of model- ing of environmental systems. 2.1.1 SYSTEM/BOUNDARY A “system” can be thought of as a collection of one or more related objects, where an “object” can be a physical entity with specific attributes or Chapter 02 11/9/01 9:31 AM Page 19 © 2002 by CRC Press LLC characteristics. The system is isolated from its surroundings by the “bound- ary,” which can be physical or imaginary. (In many books on modeling, the term “environment” is used instead of “surroundings” to indicate everything outside the boundary; the reason for picking the latter is to avoid the confu- sion in the context of this book that focuses on modeling the environment. In other words, environment is the system we are interested in modeling, which is enclosed by the boundary.) The objects within a system may or may not interact with each other and may or may not interact with objects in the sur- roundings, outside the boundary. A system is characterized by the fact that the modeler can define its boundaries, its attributes, and its interactions with the surroundings to the extent that the resulting model can satisfy the mod- eler’s goals. The largest possible system of all, of course, is the universe. One can, depending on the modeling goals, isolate a part of the universe such as a con- tinent, or a country, or a city, or the city’s wastewater treatment plant, or the aeration tank of the city’s wastewater treatment plant, or the microbial popu- lation in the aeration tank, and define that as a system for modeling purposes. Often, the larger the system, the more complex the model. However, the effort can be made more manageable by dissecting the system into smaller subsys- tems and including the interactions between them. 2.1.2 OPEN/CLOSED, FLOW/NONFLOW SYSTEMS A system is called a closed system when it does not interact with the sur- roundings. If it interacts with the surroundings, it is called an open system. In closed systems, therefore, neither mass nor energy will cross the boundary; whereas in open systems, mass and energy can. When mass does not cross the boundary (but energy does), an open system may be categorized as a nonflow system. If mass crosses the boundary, it is called a flow system. While certain batch processes may be approximated as closed systems, most environmental systems interact with the surroundings in one way or another, with mass flow across the boundary. Thus, most environmental sys- tems have to be treated as open, flow systems. 2.1.3 VARIABLES/PARAMETERS/INPUTS/OUTPUTS The attributes of the system and of the surroundings that have significant impact on the system are termed “variables.” The term variable includes those attributes that change in value during the modeling time span and those that remain constant during that period. Variables of the latter type are often referred to as parameters. Some parameters may relate to the system, and some may relate to the surroundings. Chapter 02 11/9/01 9:31 AM Page 20 © 2002 by CRC Press LLC A system may have numerous attributes or variables. However, as men- tioned before, the modeler needs to select only those that are significant and relevant to the modeler’s goal in the modeling process. For example, in the case of the aeration tank, its attributes can include biomass characteristics, vol- ume of mixed liquor, its color, temperature, viscosity, specific weight, con- ductivity, reflectivity, etc., and the attributes of the surroundings may be flow rate, mass input, wind velocity, solar radiation, etc. Even though many of the attributes may be interacting, only a few (e.g., biomass characteristics, vol- ume, flow rate, mass input) are identified as variables of significance and rel- evance based on the modeler’s goals (e.g., the efficiency of the aeration tank). Variables that change in value fall into two categories: those that are gen- erated by the surroundings and influence the behavior of the system, and those that are generated by the system and impact the surroundings. The for- mer are called “inputs,” and the latter are called “outputs.” In the case of the aeration tank, the mass inflow can be an input, the concentration leaving the tank, an output, and the volume of the tank, a parameter. In mathematical language, inputs are considered independent variables, and outputs are con- sidered dependent variables. The inputs and model parameters are often known or defined in advance; they drive the model to produce some output. In the context of modeling, relationships are sought between inputs and out- puts, with the parameters acting as model coefficients. At this point, a very important factor has to be recognized; in the real sys- tem, not all significant and relevant variables and/or parameters may be accessible for control or manipulation; likewise, not all outputs may be acces- sible for observation or measurement. However, in mathematical models, all inputs and parameters are readily available for control or manipulation, and all outputs are accessible. It also follows that, in mathematical modeling, modelers can suppress “disturbances” that are unavoidable in the real sys- tems. These traits are of significant value in mathematical modeling. However, numerical values for the variables will be needed to execute the model. Some values are set by the modeler as inputs. Other system parame- ter data can be obtained from many sources, such as the scientific literature, experimentation on the real system or physical models, or by adapting esti- mation methods. Accounts of experimentation techniques and parameter estimation methods for determining such data can be found elsewhere and are beyond the scope of this book. 2.2 STEPS IN DEVELOPING MATHEMATICAL MODELS The craft of mathematical model development is part science and part art. It is a multistep, iterative, trial-and-error process cycling through hypotheses Chapter 02 11/9/01 9:31 AM Page 21 © 2002 by CRC Press LLC formation, inferencing, testing, validating, and refining. It is common prac- tice to start from a simple model and develop it in steps of increasing com- plexity, until it is capable of replicating the observed or anticipated behavior of the real system to the extent that the modeler expects. It has to be kept in mind that all models need not be perfect replicates of the real system. If all the details of the real system are included, the model can become unmanage- able and be of very limited use. On the other hand, if significant and relevant details are omitted, the model will be incomplete and again be of limited use. While the scientific side of modeling involves the integration of knowledge to build and solve the model, the artistic side involves the making of a sensi- ble compromise and creating balance between two conflicting features of the model: degree of detail, complexity, and realism on one hand, and the valid- ity and utility value of the final model on the other. The overall approach in mathematical modeling is illustrated in Figure 2.1. Needless to say, each of these steps involves more detailed work and, as men- tioned earlier, will include feedback, iteration, and refinement. In the follow- ing sections, a logical approach to the model development process is presented, identifying the various tasks involved in each of the steps. It is not the intention here to propose this as the standard procedure for every modeler to follow in every situation; however, most of the important and crucial tasks are identified and included in the proposed procedure. Figure 2.1 Overall approach to mathematical modeling. Problem formulation Mathematical representation Mathematical analysis Interpretation and evaluation of results Chapter 02 11/9/01 9:31 AM Page 22 © 2002 by CRC Press LLC 2.2.1 PROBLEM FORMULATION As in any other field of scientific study, formulation of the problem is the first step in the mathematical model development process. This step involves the following tasks: Task 1: establishing the goal of the modeling effort. Modeling projects may be launched for various reasons, such as those pointed out in Chapter 1. The scope of the modeling effort will be dictated by the objective(s) and the expectation(s). Because the premise of the effort is for the model to be sim- pler than the real system and at the same time be similar to it, one of the objectives should be to establish the extent of correlation expected between model predictions and performance of the real system, which is often referred to as performance criteria. This is highly system specific and will also depend on the available resources such as the current knowledge about the system and the tools available for completing the modeling process. It should also be noted that the same system might require different types of models depending on the goal(s). For example, consider a lake into which a pollutant is being discharged, where it undergoes a decay process at a rate estimated from empirical methods. If it is desired to determine the long-term concentration of the pollutant in the lake or to do a sensitivity study on the estimated decay rate, a simple static model will suffice. On the other hand, if it is desired to trace the temporal concentration profile due to a partial shut- down of the discharge into the lake, a dynamic model would be required. If toxicity of the pollutant is a key issue and, hence, if peak concentrations due to inflow fluctuations are to be predicted, then a probabilistic approach may have to be adapted. Another consideration at this point would be to evaluate other preexisting “canned” models relating to the project at hand. They are advantageous because many would have been validated and/or accepted by regulators. Often, such models may not be applicable to the current problem with or without minor modifications due to the underlying assumptions about the sys- tem, the contaminants, the processes, the interactions, and other concerns. However, they can be valuable in guiding the modeler in developing a new model from the basics. Task 2: characterizing the system. In terms of the definitions presented earlier, characterizing the system implies identifying and defining the system, its boundaries, and the significant and relevant variables and parameters. The modeler should be able to establish how, when, where, and at what rate the system interacts with its surroundings; namely, provide data about the inflow rates and the outflow rates. Processes and reactions occurring inside the sys- tem boundary should also be identified and quantified. Often, creating a schematic, graphic, or pictographic model of the system (a two-dimensional model) to visualize and identify the boundary and the Chapter 02 11/9/01 9:31 AM Page 23 © 2002 by CRC Press LLC system-surroundings interactions can be a valuable aid in developing the mathematical model. These aids may be called conceptual models and can include the model variables, such as the directions and the rates of flows crossing the boundary, and parameters such as reaction and process rates inside the system. Jorgensen (1994) presented a comprehensive summary of 10 different types of such tools, giving examples and summarizing their char- acteristics, advantages, and disadvantages. Some of the recent software packages (to be illustrated later) have taken this idea to new heights by devising the diagrams to be “live.” For example, in a simple block diagram, the boxes with interconnecting arrows can be encoded to act as reservoirs, with built-in mass balance equations. With the passage of time, these blocks can “execute” the mass balance equation and can even animate the amount of material inside the box as a function of time. Examples of such diagrams can be found throughout this book. Another very useful and important part of this task is to prepare a list of all of the variables along with their fundamental dimensions (i.e., M, L, T ) and the corresponding system of units to be used in the project. This can help in checking the consistency among variables and among equations, in trou- bleshooting, and in determining the appropriateness of the results. Task 3: simplifying and idealizing the system. Based on the goals of the modeling effort, the system characteristics, and available resources, appropri- ate assumptions and approximations have to be made to simplify the system, making it amenable to modeling within the available resources. Again, the primary goal is to be able to replicate or reproduce significant behaviors of the real system. This involves much experience and professional judgement and an overall appreciation of the efforts involved in modeling from start to finish. For example, if the processes taking place in the system can be approxi- mated as first-order processes, the resulting equations and the solution proce- dures can be considerably simpler. Similar benefits can be gained by making assumptions: using average values instead of time-dependent values, using estimated values rather than measured ones, using analytical approaches rather than numerical or probability-based analysis, considering equilibrium vs. non- equilibrium conditions, and using linear vs. nonlinear processes. 2.2.2 MATHEMATICAL REPRESENTATION This is the most crucial step in the process, requiring in-depth subject mat- ter expertise. This step involves the following tasks: Task 1: identifying fundamental theories. Fundamental theories and princi- ples that are known to be applicable to the system and that can help achieve the goal have to be identified. If they are lacking, ad hoc or empirical relationships Chapter 02 11/9/01 9:31 AM Page 24 © 2002 by CRC Press LLC may have to be included. Examples of fundamental theories and principles include stoichiometry, conservation of mass, reaction theory, reactor theory, and transport mechanisms. A review of theories of environmental processes is included in Chapter 4. A review of engineered environmental systems is presented in Chapter 5. And, a review of natural environmental systems is presented in Chapter 6. Task 2: deriving relationships. The next step is to apply and integrate the theories and principles to derive relationships between the variables of sig- nificance and relevance. This essentially transforms the real system into a mathematical representation. Several examples of derivations are included in the following chapters. Task 3: standardizing relationships. Once the relationships are derived, the next step is to reduce them to standard mathematical forms to take advantage of existing mathematical analyses for the standard mathematical formulations. This is normally done through standard mathematical manipulations, such as simplifying, transforming, normalizing, or forming dimensionless groups. The advantage of standardizing has been referred to earlier in Chapter 1 with Equations (1.1) and (1.2) as examples. Once the calculus that applies to the system has been identified, the analysis then follows rather routine pro- cedures. (The term calculus is used here in the most classical sense, denoting formal structure of axioms, theorems, and procedures.) Such a calculus allows deductions about any situation that satisfies the axioms. Or, alterna- tively, if a model fulfills the axioms of a calculus, then the calculus can be used to predict or optimize the performance of the model. Mathematicians have formalized several calculi, the most commonly used being differential and integral. A review of the calculi commonly used in environmental sys- tems is included in Chapter 3, with examples throughout this book. 2.2.3 MATHEMATICAL ANALYSIS The next step of analysis involves application of standard mathematical techniques and procedures to “solve” the model to obtain the desired results. The convenience of the mathematical representation is that the resulting model can be analyzed on its own, completely disregarding the real system, temporarily. The analysis is done according to the rules of mathematics, and the system has nothing to do with that process. (In fact, any analyst can per- form this task—subject matter expertise is not required.) The type of analysis to be used will be dictated by the relationships derived in the previous step. Generalized analytical techniques can fall into algebraic, differential, or numerical categories. A review of selected analytical tech- niques commonly used in modeling of environmental systems is included in Chapter 3. Chapter 02 11/9/01 9:31 AM Page 25 © 2002 by CRC Press LLC 2.2.4 INTERPRETATION AND EVALUATION OF RESULTS It is during this step that the iteration and model refinement process is car- ried out. During the iterative process, performance of the model is compared against the real system to ensure that the objectives are satisfactorily met. This process consists of two main tasks—calibration and validation. Task 1: calibrating the model. Even if the fundamental theorems and prin- ciples used to build the model described the system truthfully, its perform- ance might deviate from the real system because of the inherent assumptions and simplifications made in Task 3, Section 2.2.1 and the assumptions made in the mathematical analysis. These deviations can be minimized by calibrat- ing the model to more closely match the real system. In the calibration process, previously observed data from the real system are used as a “training” set. The model is run repeatedly, adjusting the model parameters by trial and error (within reasonable ranges) until its predictions under similar conditions match the training data set as per the goals and per- formance criteria established in Section 2.2.1. If not for computer-based mod- eling, this process could be laborious and frustrating, especially if the model includes several parameters. An efficient way to calibrate a model is to perform preliminary sensitivity analysis on model outputs to each parameter, one by one. This can identify the parameters that are most sensitive, so that time and other resources can be allocated to those parameters in the calibration process. Some modern com- puter modeling software packages have sensitivity analysis as a built-in fea- ture, which can further accelerate this step. If the model cannot be calibrated to be within acceptable limits, the mod- eler should backtrack and reevaluate the system characterization and/or the model formulation steps. Fundamental theorems and principles as well as the model formulation and their applicability to the system may have to be reex- amined, assumptions may have to be checked, and variables may have to be evaluated and modified, if necessary. This iterative exercise is critical in establishing the utility value of the model and the validity of its applications, such as in making predictions for the future. Task 2: validating the model. Unless a model is well calibrated and vali- dated, its acceptability will remain limited and questionable. There are no standard benchmarks for demonstrating the validity of models, because mod- els have to be linked to the systems that they are designed to represent. Preliminary, informal validation of model performance can be conducted relatively easily and cost-effectively. One way of checking overall perform- ance is to ensure that mass balance is maintained through each of the model runs. Another approach is to set some of the parameters so that a closed alge- braic solution could be obtained by hand calculation; then, the model outputs can be compared against the hand calculations for consistency. For example, Chapter 02 11/9/01 9:31 AM Page 26 © 2002 by CRC Press LLC by setting the reaction rate constant of a contaminant to zero, the model may be easier to solve algebraically and the output may be more easily compared with the case of a conservative substance, which may be readily obtained. Other informal validation tests can include running the model under a wide range of parameters, input variables, boundary conditions, and initial values and then plotting the model outputs as a function of space or time for visual interpre- tation and comparison with intuition, expectations, or similar case studies. For formal validation, a “testing” data set from the real system, either his- toric or generated expressly for validating the model, can be used as a bench- mark. The calibrated model is run under conditions similar to those of the testing set, and the results are compared against the testing set. A model can be considered valid if the agreement between the two under various condi- tions meets the goal and performance criteria set forth in Section 2.2.1. An important point to note is that the testing set should be completely independ- ent of, and different from, the training set. A common practice used to demonstrate validity is to generate a parity plot of predicted vs. observed data with associated statistics such as goodness of fit. Another method is to compare the plots of predicted values and observed data as a function of distance (in spatially varying systems) or of time (in tem- porally varying systems) and analyze the deviations. For example, the num- ber of turning points in the plots and maxima and/or minima of the plots and the locations or times at which they occur in the two plots can be used as com- parison criteria. Or, overall estimates of absolute error or relative error over a range of distance or time may be quantified and used as validation criterion. Murthy et al. (1990) have suggested an index J to quantify overall error in dynamic, deterministic models relative to the real system under the same input u(t) over a period of time T. They suggest using the absolute error or the relative error to determine J, calculated as follows: J = ͵ T o e(t) T e(t)dt or J = ͵ T o ˜e(t) T ˜e(t)dt where e(t) = y s (t) – y m (t)or˜e(t) = ᎏ y e s ( ( t t ) ) ᎏ y s (t) = output observed from the real system as a function of time, t y m (t) = output predicted by the model as a function of time, t 2.2.5 SUMMARY OF THE MATHEMATICAL MODEL DEVELOPMENT PROCESS In Chapter 1, physical modeling, empirical modeling, and mathematical modeling were alluded to as three approaches to modeling. However, as could be gathered from the above, they complement each other and are applied together in practice to complete the modeling task. Empirical models are used Chapter 02 11/9/01 9:31 AM Page 27 © 2002 by CRC Press LLC to fill in where scientific theories are nonexistent or too complex (e.g., non- linear). Experimental or physical model results are used to develop empirical models and calibrate and validate mathematical models. The steps and tasks described above are summarized schematically in Figure 2.2. This scheme illustrates the feedback and iterative nature of the process as described earlier. It also shows how the real system and the “abstract” mathematical system interact and how experimentation with the real system and/or physical models is integrated with the modeling process. It is hoped that the above sections accented the science as well as the art in the craft of mathematical model building. Figure 2.2 Steps in mathematical modeling. Chapter 02 11/9/01 9:31 AM Page 28 © 2002 by CRC Press LLC [...]... further to: Q dC d 2C 0 = – ᎏᎏ ᎏᎏ + E ᎏᎏ – kC A dx dx 2 (2.15) Task 3: standardizing relationships The relationship(s) derived from the fundamental theories and principles can now be translated into standard mathematical forms for further manipulation, analysis, and solving Mathematical handbooks containing solutions to standard formulations have to be referred to in order to identify the ones matching... linear differential equation, of the standard form: 0 = ay Љ ϩ byЈ ϩ cy (2.16) whose solution can be found from handbooks as: y ϭ Me gx ϩ Ne jx © 2002 by CRC Press LLC (2.17) Chapter 02 11/9/01 9 :31 AM Page 35 where g and j are, in turn, the positive and negative values of –b ±͙ෆc/2a, b2 – 4aෆ and M and N are constants to be found from two boundary conditions Step 3: Mathematical Analysis Comparing the...Chapter 02 11/9/01 9 :31 AM Page 29 2 .3 APPLICATION OF THE STEPS IN MATHEMATICAL MODELING In this section, the application of the above steps in modeling the spatial variation of a chemical in an advective-dispersive river is detailed Because the focus of this book is on computer-based mathematical modeling using authoring software tools, the validation and calibration steps are only briefly... inflow, the waste input rate, the reaction rate constants for the various processes that the toxicant can undergo within the system, and the length of the river system Other variables can be the area of flow and the velocity of flow in the river Some © 2002 by CRC Press LLC Chapter 02 11/9/01 9 :31 AM Page 30 Figure 2 .3 Schematic of real system of the environmental processes that the toxicant can undergo... substituting from the previous expressions for C, d[C0 e gx] –EA ᎏᎏ dx [C0 e jx] + W = –EA ᎏᎏ x=0–ε dx (2. 23) x = 0 +ε and simplifying, –EAC0g ϩ W = –EAC0 j (2.24) W C0 = ᎏᎏ EA(g – j) (2.25) or, Input of toxicant,,W toxicant x Figure 2.7 Element at point of discharge © 2002 by CRC Press LLC Chapter 02 11/9/01 9 :31 AM Page 37 On substituting for g and j from the above, C0 = W/αQ, where W is... model for this problem is, therefore: W C = ᎏᎏ e gx αQ for x ≤ 0 (2.26) W C = ᎏᎏ e jx αQ for x ≥ 0 (2.27) Step 4: Interpretation of Results The calibration and validation of the model will be highly problemspecific Initial interpretations can include simulations, sensitivity analysis, and comparison with other similar systems As a first step in this case, the model can be run with typical parameters and. .. parameters, such as area of cross-section and the flow rate of the river, etc., can vary spatially or temporally Considering the project goals agreed upon and the physical, chemical, and biological properties of the toxicant and the system, it may be reasonable to make the following simplifying assumptions for the preliminary model: • • • • • • Instantaneous mixing in the z- and y-directions occurs at the point... simplified system © 2002 by CRC Press LLC Chapter 02 11/9/01 9 :31 AM Table 2.1 Page 32 Variables, Symbols, Dimensions, and Units Variable Symbol Dimension Unit River flow rate Concentration of toxicant First-order reaction rate constant Area of flow Velocity of flow Dispersion coefficient Length in direction of flow Time Q C k A U E x t L3T 3 ML 3 T –1 L2 LT –1 L2T –1 L T cfs mg/L 1/day sq ft ft/s sq miles/day... those of the standard equation, a = E, b = –(Q/A), and c = –K Recognizing that Q/A = U, the river velocity, b = –U Thus, g and j are first found as follows: U ± ͙ෆෆ U 2 + 4Ek U g, j ϭ ᎏᎏ = ᎏᎏ (1 ± α) 2E 2E where, α = 4 k Ί1 + ᎏEᎏ U 2 (2.18) (2.19) Now, the constants M and N have to be determined using appropriate boundary conditions for this particular situation (This is another reason for establishing... listing Task 2: deriving relationships The fundamentals identified in Task 2 can now be combined to derive an expression for the output(s) This involves © 2002 by CRC Press LLC Chapter 02 11/9/01 9 :31 AM Page 33 standard mathematical manipulations such as simplification, substitution, and rearrangement In this example, a distributed model is appropriate because of spatial variations of the output The . the modeling effort. Modeling projects may be launched for various reasons, such as those pointed out in Chapter 1. The scope of the modeling effort will be dictated by the objective(s) and the expectation(s) results. Task 3: simplifying and idealizing the system. Based on the goals of the modeling effort, the system characteristics, and available resources, appropri- ate assumptions and approximations. mod- eler should backtrack and reevaluate the system characterization and/ or the model formulation steps. Fundamental theorems and principles as well as the model formulation and their applicability