Compartmental Analysis Math 366 - Differential Equations Material Covering Lab 3 We now learn how to model some physical phonomena through DE. General steps for modeling (you are encouraged to find your own): - Fix the variables and decide which variable(s) are dependent and which are independent. - Determine whether any rate of change is interesting to study the phenomenon. - Look for any possible relation between the variables, this step may be useful to reduce the number of variables. - Look for any relation involving the rates of change of the variables (that is to say their derivatives). A relation of this kind is a DE. - Look for initial conditions. - Solve the IVP. - Graph the function. Comment on the result. In this section we study simple systema with only one compartment (or block). Mixing Problems Let x t be the amount of substance dissolved in a fluid contained in a tank at time t. We usually know the initial amount of the dissolved substance x 0. Let V t be the volume of the fluid in the tank at time t. Assumption: the solution in the tank is kept well stirred so the concentration of the substance is uniform. This means that the concentration at time t is given by x t V t Let R in be the rate at which the substance enters the tank and R out be the rate at which the substance exits the tank. [See picture on the board] We have the following relation dx = R in KR out Example: A large tank is filled to capacity with 500 gallons of pure water. Brine containing 2 pounds of salt per gallon is pumped into the tank at a rate of 5 gal/min. The well-mixed solution is pumped out at the same rate. Find the mass x t of salt in the tank at time t. Do not forget to define a suitable interval. Sulution: on the board. Let us check on Maple ode d ics d x 0 = 0 d d t x t = 0 K x t 00 d x t = 0 K 00 x t x 0 = 0 (..) (..2)
dsolve ode, ics plot 000 K 000 e K 00 t, t = 0..000 000 x t = 000 K 000 e K 00 t (..3) 800 600 400 200 0 0 200 400 600 800 000 t Reading: Examples and 2 on the textbook. Population Models Let p t be the population at time t. Assumption: even if the population is always an integer we assume that p t is a continuous and differentiable function. We also assume that the growth rate dp So we get the following DE dp = kp. [see the board for general solution] We get is proportional to the population present at time t.
p t = p 0 $e k$t. This is called the Malthusian model. Example: The population of a town grows according to the Malthausian model. The initial population of 500 increases to 575 in 0 years. What will be the population in 30 years? How fast is the population growing at t = 30 years? Solution: on the board plus computations on Maple. Read example 3 Section 3.2. A more sophisticated model is the logistic model. We make the assuption that the growth rate is negatively affected by some constrains which can be taken into account by assuming that there is a upper bound p for the population. More precisely we get an equation of the form dp = A$p$ p Kp [General solution on the board] We get p t = p KA$p $t C c$e In case we have an initial population p 0 we get that c = p p 0 K. Example: Suppose a student carrying a flu virus returns to an isolated college campus of 000 students. If it is assumed that the rate at which the virus spreads is proportional not only to the number p of infected students but also to the number of students not infected, determine the number of infected students after 6 days if it is further observed that after 4 days x 4 = 50. Solution: on the board. Heating and Cooling (of Buildings) Newton's law of Cooling Let T t be the temperature inside a building at time t and let M t the temperature outside the building at time t. Empirical law: the rate of change of the temperature inside the building is proportional to the difference between the temperature outside the building and the temperature inside the bulding. The corresponding DE is dt t = K$ M t K T t Remark: notice that the constant K must be positive (see Exam ) and it is the reciprocal of the time constant K. The above DE can be refining by taking into account the following components. - People, lights, and machines contribute to increase the rate of change of the temperature, we label this contribution H t. Notice that H t will always be positive. - Heater (or cooler) contribute to increase (or decrease) the rate of change of T. We label this contribution U t. Notice that U t will be positive if we have a heating system or negative if we have a cooling system.
The modified DE equation is: dt t = K$ M t K T t C H t C U t. However, no matter what DE we are using, we can always rewrite it as dt t C K$T t = Q t. [Solve the g eneral equation on the board] Final solution is T t = e KKt $ e Kt $Q t C C. Read examples, 2, and 3 on your textbook (especially example 2 which is useful for exercise 6 on Lab 3). Example: On a mild Saturday morning while people are working inside, the furnace keeps the temperature inside the building at 2 + C. At noon the furnace is turned off and the people go home. The temperature outside is a constant 2 + C for the rest of the afternoon. If the time constant for the building is 3hr, when will the temperature inside the building reach 6 + C? If some windows are left open and the time constant drop to 2hr, when will the temperature inside reach 6 + C? Solution: with reference to the above equation, we have Q t = K$M t C H t C U t. Since during the period we are considering, the bulding is empty and everything is turned off, we have H t = 0 and U t = 0, moreover M t = 2 + C is constant. So we can write Q t d 2$K t/2 K (2.) In the first case we have K d 3 and we have the general solution T t d e KK$t $ int e K$t $Q t, t C C t/e KK t 3 e K t Q t C C (2.2) (2.3) T t Let us redefine the function T t d e K 3 t 3 $ 2 e t C C e K 3 t t/e K 3 t 2 e 2 e 3 t C C 3 t C C We need to make sure that the initial condition T 0 = 2 is satisfied so we need to solve: solve T 0 = 2, C 9 So the solution to the IVP is (2.4) (2.5) (2.6)
T t d e K 3 t $ 2 e simplify expand T t 3 t C 9 t/e K 3 t 2 e 2 C 9 e K 3 t Remark: exponential term will eventually "die off". 3 t C 9 (2.7) (2.8) Finally we need to solve solve T t = 6, t at 5 digits K3 ln 4 9 (2.9) 2.4328 If the time constant is 3hr, the building reaches 6 + C at 2:26pm. (2.0) In the second case we have Q t d 2$K2 t/2 K2 (2.) K2 d 2 and we have the general solution T2 t d e KK2$t $ int e K2$t $Q t, t C C t/e KK2 t 2 e K2 t Q t C C (2.2) (2.3) T2 t Let us redefine the function T2 t d e K 2 t 2 $ 2$e t C C e K 2 t t/e K 2 t 2 e 2 e 2 t C C 2 t C C We need to make sure that the initial condition T 0 = 2 is still satisfied so we need to solve: solve T2 0 = 2, C 9 So the solution to the IVP is T2 t d e K 2 t 2 $ 2 e t C 9 (2.4) (2.5) (2.6)
simplify expand T2 t t/e K 2 t 2 e 2 C 9 e K 2 t 2 t C 9 (2.7) (2.8) Finally we need to solve solve T2 t = 6, t at 5 digits K2 ln 4 9 (2.9).629 (2.20) If the time constant is 2hr, the building reaches 6 + C at :37pm. Let us plot the two graphs together for comparison: plot T t, T2 t, 2, t = 0..5 2 20 9 8 7 6 5 4 3 2 0 2 3 4 5 t T(t) T2(t) Outside Temperature
Newtonian Mechanics For simplicity's sake, we consider motions of a point along a linear path with coordinate x. We express Newton's second law of motion as dp = F t, x, v where p is the momentum of the point which is m$v (where m is the mass and v = dx is the velocity) F represents the net sum of all the forces acting on the point, F may depend on time t, position x, and velocity v. Remark : we need to be careful in considering all the forces acting on the point. Remark 2: dp = d m$v = m$ dv = m$a since the mass m is considered constant. Read Examples, 2, 3, and 4 Sec. 3.5 on you textbook. Example: An object of mass 5 kg is given an initial downward velocity of 50 m/sec and then allowed to fall under the influence of gravity. Assume the force in newtons due to air resistance is K0 v, where v is the velocity of the object in m/sec. Assume the object is initially 500m above the ground. a) Write a DE describing the motion. b) Determine the terminal velocity of the object. c) Solve the IVP. d) Determine when the object will strike the ground. e) Plot the graph of motion from the beginning till the object hits the ground. Solution: to be done in class. Electrical Circuits We consider two simple circuits. RL-circuits L$ di C R$I = E t where E is the voltage (unit: volt, V), I is the current (unit: ampere, A), L is the inductance (unit: henry, H)), R is the resistance (unit: ohm, Ω). General solution: to be done in class. RC-circuits R$ dq C q C = E t where we used the identity I = dq q is the charge (unit: coulomb C) C is the capacitance (unit: farad F)
General solution: to be done in class. Remark: in case E t is constant, the problems can be solve by separation of variables. Read Examples and 2 Sec. 3.5 on your textbook.