The Recipe to Build a Mathematical Model
- 1.4k Downloads
Abstract
Most chemical engineering students feel a shiver down the spine when they see a set of complex mathematical equations generated from the modeling of a chemical engineering system. This is because they usually do not understand how to achieve this mathematical model, or they do not know how to solve the equation system without spending a lot of time and effort.
Most chemical engineering students feel a shiver down the spine when they see a set of complex mathematical equations generated from the modeling of a chemical engineering system. This is because they usually do not understand how to achieve this mathematical model, or they do not know how to solve the equations system without spending a lot of time and effort.
Trying to understand how to generate a set of mathematical equations to represent a physical system (to model) and how to solve these equations (to simulate) is not a simple task. A model, most of the time, takes into account all phenomena studied during a chemical engineering course (mass, energy and momentum transfer, chemical reactions, etc.). In the same way, there is a multitude of numerical methods that can be used to solve the same set of equations generated from the modeling, and many different computational languages can be adopted to implement the numerical methods. As a consequence of this comprehensiveness and the combinatorial explosion of possibilities, most books that deal with this subject are very comprehensive, requiring a lot of time and effort to go through the subject.
This book tries to deal with this modeling and simulation issue in a simple, fast, and friendly way, using what you already know or what you can intuitively or easily understand to build a model step by step and, after that, solve it using Excel, a very friendly and widely used tool.
The first question is: 2 h later, what is the volume of water inside the tank? If you say 10 m^{3}, you are correct. The flow rate that enters the tank is equal to the flow rate that exits (2 m^{3}/s), so the volume of water in the tank remains constant (10 m^{3}).
Now, if the input volumetric flow rate changes to 3 m^{3}/h and the flow rate at the exit remains at 2 m^{3}/h, what is the volume of water in the tank after 2 h? If you correctly say 12 m^{3}, it is because you mentally develop a model to represent this tank and after that you simulate it. When the inflow rate becomes 3 m^{3}/h, by inspection one can conclude easily that the volume of water will increase 1 m^{3} in each hour.
Unfortunately, you only know how to do mental modeling and simulation if the problem is very simple. In order to understand how to model and simulate complex systems, let us try to understand what was mentally done in this simple example and transform that into a step-by-step procedure that is robust enough to successfully work also for very complex systems.
2.1 The Recipe
- 1.Conservation Law : The conservation law says that what enters the system (E), minus what leaves the system (L), plus what is generated in the system (G), minus what is consumed (C) in the system, is equal to the accumulation in the system (A); or:$$ \mathrm{E}\hbox{--} \mathrm{L}+\mathrm{G}\hbox{--} \mathrm{C}=\mathrm{A} $$
The accumulation is the variation that occurs in a period of time. This accumulation can be positive or negative, i.e., if what enters plus what is generated in the system is greater than what leaves plus what is consumed in this system, there is a positive accumulation. Otherwise, there is a negative accumulation.
When developing mass and energy balances in the problems presented in this book, we will assume that terms of generation and/or consumption can exist if there are chemical reactions. For example, there is energy generation if there is an exothermic chemical reaction , which will result in an increase in temperature.
- 2.
Control volume : The control volume is the volume in which the model is developed and the conservation law is applied. All variables (concentration, temperature, density, etc.) have to be uniform inside the control volume. In the example of the tank presented previously, all variables do not change with the position inside the tank (a lumped-parameter problem), so the control volume is the entire tank.
- 3.Infinitesimal variation of the dependent variable with the independent variable : Imagine that a dependent variable y varies with x (an independent variable) according to the function shown in Fig. 2.2. Also imagine that in an initial condition x_{0} the initial value of y is y_{0}. To estimate the value of the dependent variable y after an infinitesimal increment in x (Δx), one can draw a tangent line to the curve starting from the point (x_{0}, y_{0}), as shown in Fig. 2.2.
2.2 The Recipe Applied to a Simple System
Keeping in mind the three fundamental concepts presented in Sect. 2.1, let us apply the step-by-step procedure (the recipe) to model the tank presented previously. This procedure, used to model this simple system, will be the same used throughout the entire book, in order to solve more and more complex problems.
The E and L terms can be easily obtained, since the flow rates that enter and leave the tank are known (3 m^{3}/h and 2 m^{3}/h, respectively); however, how can the accumulation term be obtained?
t | t + Δt | Dimension |
M | \( M+\frac{dM}{dt}\Delta t \) | kg |
A very important tool to check if a model is correct is to do a dimensional analysis on all terms of the conservation law equation.
t | t + Δt | Accumulation | Dimension |
V | \( V+\frac{dV}{dt}\Delta t \) | \( \frac{dV}{dt}\Delta t \) | m^{3} |
Equation (2.6) represents the model for this simple system and agrees with the mental calculation you did previously. Having completed the modeling stage, we need to do the simulation, which is nothing more than solving, by analytical or numerical methods, the equations generated from the modeling. In our case, as the system is greatly simplified, a single and very simple ordinary differential equation (ODE) is generated from the modeling, and it will be solved by direct integration.
Equation (2.7) shows how the volume of liquid in the tank varies with time, making it possible to predict, for example, the time it takes for the liquid to overflow the tank (also observe that the equation says that after 2 h, the volume of water is 12 m^{3}, as predicted previously).
The procedure adopted for this simple example will be used from now on for more and more complex examples.
Proposed Problem
2.1) Develop a model for the tank presented in Fig. 2.3, but consider that the flow rate of water that leaves the tank (Q_{ out }, m^{3}/h) depends on the level of the water (h) inside the tank, in the way Q_{ out } = 1 + 0.1h (m^{3}/h). This can be a real situation because as the column of water increases, the pressure on the exit point also increases, and consequently the exit flow rate becomes greater. Assuming that the initial volume of water inside the tank is equal to 10 m^{3} and the cross-sectional area of this tank is equal to 1 m^{2}, the initial level of water (h) is 10 m, so in the beginning, the flow rate that leaves the tank (Q_{ out }) is equal to 2 m^{3}/h. In the beginning, the input flow rate is equal to 2 m^{3}/h, so the volume of water remains constant, in a steady-state regime. If for some reason the inflow rate varies from 2 to 3 m^{3}/h, develop a mathematical model to represent how the level of water inside the tank varies with time. Define the initial condition needed to solve the equation generated from the modeling.