Differential Equations
Units and Topics
Unit 2. First Order Equations
2.7 Models with First Order Equations
A model is a differential equation that describes how a quantity in the real world changes. This topic applies the methods of the unit to five models: the amount of salt in a tank, the size of a population, the decay of a radioactive substance, the charge of a capacitor, and the velocity of a falling object. Each model is built in the same way: the rate of change of the quantity is written in terms of the quantity and the time.
You need Topics 2.1, 2.2, 2.4, and 2.5 for this topic.
1. How a Model Is Built
The work on a model has five steps.
- Name the unknown quantity and the independent variable, with their units.
- Write the rate of change of the quantity. For an amount that flows into and out of a container, the rate of change is the rate in minus the rate out.
- State the initial condition.
- Recognize the type of the equation, and solve it.
- Check the solution. The units must agree, the initial condition must hold, and the behavior for large times must be reasonable.
Many models of this topic lead to the equation y′ + ky = b with constants k and b. Topic 2.2 found its solutions.
The equation y′ + ky = b. The general solution is y = b/k + Ce−kt. For a positive k, each solution approaches the steady state b/k. The time 1/k is called the time constant. In one time constant, the distance from the steady state is multiplied by e−1 = 0.37.
2. Mixing in a Tank
A tank contains 100 liters of water in which 5 kg of salt are dissolved. Salt water with the concentration 0.5 kg per liter flows in at the rate 4 liters per minute. The mixture is stirred, so that the concentration is the same at all points of the tank, and it flows out at the rate 4 liters per minute. Let Q(t) be the amount of salt in the tank in kilograms, with t in minutes.
rate in = (0.5 kg/L)(4 L/min) = 2 kg/minthe concentration of the inflow times the flow rateconcentration in the tank = Q/100 kg/Lthe amount of salt divided by the volume, which stays at 100 litersrate out = Q/100(4) = Q/25 kg/minthe concentration in the tank times the flow rateQ′ = 2 − Q/25the rate in minus the rate outThe equation is linear with constant coefficients. In the standard form it is Q′ + 1/25 Q = 2, with k = 1/25 and b = 2.
Q = 2/1/25 + Ce−t/25the general solution of Q′ + kQ = bQ = 50 + Ce−t/25because 2(25) = 505 = 50 + Cthe initial condition Q(0) = 5Q = 50 − 45e−t/25the solution, with C = −45The steady state is 50 kg. This is reasonable: after a long time the tank contains the same mixture as the inflow, and 100 liters at 0.5 kg per liter contain 50 kg. The time constant is 25 minutes, which is the volume of the tank divided by the flow rate.
A tank whose volume changes
Now the mixture flows out at only 2 liters per minute, and the rest of the data stay the same. The volume increases by 2 liters in each minute, so it is 100 + 2t liters at the time t.
rate out = Q/(100 + 2t)(2) = Q/(50 + t)the concentration in the tank times the flow rate outQ′ = 2 − Q/(50 + t)the rate in minus the rate outQ′ + 1/(50 + t) Q = 2the standard form of a linear equationμ = eln(50 + t) = 50 + tthe integrating factor((50 + t)Q)′ = 2(50 + t)multiply by the integrating factor(50 + t)Q = (50 + t)² + Cintegrate both sidesQ = 50 + t + C/(50 + t)divide by 50 + t5 = 50 + C/50the initial condition Q(0) = 5Q = 50 + t − 2250/(50 + t)the solution, with C = −2250After 50 minutes the tank contains 200 liters and 100 − 2250/100 = 77.5 kg of salt. The concentration is then 0.39 kg per liter, which is still below the concentration 0.5 of the inflow.
Try it: salt in a tank
The tank contains 100 liters. Salt water flows in, and the mixture flows out at the same rate. The blue curve is the amount of salt Q(t). The green dashed line is the steady state. The sliders set the concentration of the inflow, the flow rate, and the amount of salt at the start.
3. Populations
The simplest model of a population P(t) says that the rate of growth is proportional to the population: P′ = rP. Its solution is P = P₀ert, which grows without limit. A real population cannot do that, because food and space are limited.
The logistic model reduces the rate of growth as the population approaches a largest value K that the environment can support. The number K is called the carrying capacity.
P′ = rP(1 − P/K)For a population that is small compared with K, the factor in parentheses is close to 1, and the growth is exponential. At P = K the factor is 0. The equation is autonomous, and the methods of Topic 2.5 give its equilibrium solutions: P = 0, which is unstable, and P = K, which is stable.
The solution
The equation is a Bernoulli equation with n = 2, because it can be written as P′ − rP = −r/K P². The substitution u = 1/P of Topic 2.4 gives a linear equation.
u′ + ru = r/Kthe equation for u = 1/P, from the rule of Topic 2.4u = 1/K + Ce−rtthe general solution of u′ + ku = b, with k = r and b = r/KP = 1/(1/K + Ce−rt)return to P with P = 1/uP = K/(1 + Ae−rt)multiply the numerator and the denominator by K, with A = KCP₀ = K/(1 + A)the initial condition P(0) = P₀A = (K − P₀)/P₀solve for AAn example
A population of 100 fish is placed in a lake with the carrying capacity 1000. The rate r is 0.5 per year.
A = (1000 − 100)/100 = 9the constantP = 1000/(1 + 9e−0.5t)the solution, with t in years500 = 1000/(1 + 9e−0.5t)the time at which the population is 5001 + 9e−0.5t = 2take the reciprocal and multiply by 1000e−0.5t = 1/9subtract 1, then divide by 9t = 2 ln 9 = 4.4 yearstake the natural logarithm, then divide by −0.5The rate of growth rP(1 − P/K) is a quadratic function of P, with the value 0 at P = 0 and at P = K. It is greatest in the middle, at P = K/2. So the population grows fastest when it is one half of the carrying capacity. In the example this happens at 4.4 years, with 500 fish.
4. Radioactive Decay
The atoms of a radioactive substance decay independently of each other. In a short time, a fixed fraction of the atoms that are present decays. So the rate of decay is proportional to the number N of atoms.
N′ = −λNThe positive constant λ is called the decay constant. The solution is N = N₀e−λt, from Topic 2.1. The half-life T is the time in which one half of the atoms decay.
N₀/2 = N₀e−λTone half of the atoms are left at the time Te−λT = 1/2divide by N₀−λT = −ln 2take the natural logarithm of both sidesT = (ln 2)/λthe half-lifeThe half-life does not depend on the number of atoms at the start. With the half-life, the solution can be written as N = N₀ (1/2)t/T.
Carbon dating
A living plant contains a fixed fraction of the radioactive carbon 14, which has the half-life 5730 years. After the plant dies, it takes in no new carbon, and the carbon 14 decays. A piece of old wood contains 20 percent of the carbon 14 of living wood.
0.2 = (1/2)t/5730the fraction that is leftln 0.2 = t/5730 ln(1/2)take the natural logarithm of both sidest = 5730 (ln 0.2)/(ln 0.5)solve for tt = 5730(2.32) = 13300 yearsthe age of the wood5. A Circuit with a Resistor and a Capacitor
A battery with the voltage V is connected to a resistor with the resistance R and a capacitor with the capacitance C, one after the other. The capacitor has no charge at the time 0. Let q(t) be the charge of the capacitor. The current in the circuit is the rate of change of the charge, q′. The voltage across the resistor is Rq′, and the voltage across the capacitor is q/C. The two voltages add up to the voltage of the battery.
Rq′ + q/C = V q′ + 1/RC q = V/Rdivide by R to reach the standard formq = CV + Ae−t/(RC)the general solution of q′ + kq = b, with k = 1/(RC) and b/k = CV0 = CV + Athe initial condition q(0) = 0q = CV(1 − e−t/(RC))the solution, with A = −CVThe constant of integration is called A here, because C is the capacitance. The steady state is the charge CV. The time constant is the product RC.
For V = 6 volts, R = 2000 ohms, and C = 0.0005 farads, the time constant is RC = 1 second, and the final charge is CV = 0.003 coulombs. After 1 second the charge is 0.003(1 − e−1) = 0.0019 coulombs, which is 63 percent of the final charge.
This equation has the same form as the equation of the tank in Part 2 and the equation of the falling object with a resistive force proportional to v in Topic 2.2. Systems of very different kinds follow the same differential equation, and one solution describes all of them.
6. Falling with a Resistive Force Proportional to v²
Topic 2.5 studied the equation v′ = g − cv² of an object that falls fast through air, and found the terminal velocity √g/c without a formula for v(t). The equation is separable, and this part finds the formula for g = 9.8 and c = 0.2, where the terminal velocity is 7 m/s. The object falls from rest.
v′ = 0.2(49 − v²)factor out c = 0.2, with g/c = 491/(49 − v²) dv = 0.2 dtseparate the variables, for v less than 71/(49 − v²) = 1/14(1/(7 − v) + 1/(7 + v))partial fractions, which can be checked by adding the two fractions1/14(−ln(7 − v) + ln(7 + v)) = 0.2t + C₁integrate both sides, for v between 0 and 7ln((7 + v)/(7 − v)) = 2.8t + C₂multiply by 14 and combine the logarithms, with C₂ = 14C₁ln(7/7) = 0 = C₂the initial condition v(0) = 0(7 + v)/(7 − v) = e2.8tapply the exponential function7 + v = 7e2.8t − ve2.8tmultiply by 7 − vv(1 + e2.8t) = 7(e2.8t − 1)collect the terms with vv = (7(e2.8t − 1))/(e2.8t + 1)the solutionAt t = 1 second, e2.8 is 16.44, and the velocity is 7(15.44)/17.44 = 6.2 m/s. As t increases, the quotient approaches 1, and v approaches 7 m/s. The number 2.8 in the exponent is the rate that the linearization of Topic 2.5 found.
Common Mistakes
- Using the concentration of the inflow for the rate out. The mixture leaves with the concentration in the tank, which is the amount of salt divided by the volume.
- Keeping the volume constant when the flow rates in and out are different.
- Mixing units, such as a rate per year with a time in months.
- Using the exponential model for a long time. It describes a population only while the population is small compared with the carrying capacity.
- Confusing the decay constant with the half-life. They are related by T = (ln 2)/λ.
- Confusing the time constant with the time to reach the steady state. After one time constant, 37 percent of the distance to the steady state is still left.
Summary
| Model | Equation | Solution | Long term behavior |
|---|---|---|---|
| Tank with constant volume V₀, flow rate r, and inflow concentration c | Q′ = cr − r/V₀ Q | Q = cV₀ + Ce−rt/V₀ | Q approaches cV₀ |
| Exponential growth | P′ = rP | P = P₀ert | Grows without limit |
| Logistic growth | P′ = rP(1 − P/K) | P = K/(1 + Ae−rt) | P approaches K |
| Radioactive decay | N′ = −λN | N = N₀e−λt | N approaches 0, with the half-life (ln 2)/λ |
| Resistor and capacitor | Rq′ + q/C = V | q = CV(1 − e−t/(RC)) | q approaches CV, with the time constant RC |
| Falling, force proportional to v² | v′ = g − cv² | A quotient of exponential functions | v approaches √g/c |
Practice
Work each problem on paper first. Then open the answer to check your work.
1. A tank contains 200 liters of pure water. Salt water with 0.2 kg per liter flows in at 5 liters per minute, and the mixture flows out at 5 liters per minute. Find Q(t) and the amount of salt after 40 minutes.
Q′ = (0.2)(5) − Q/200(5) = 1 − Q/40the rate in minus the rate outQ = 40 + Ce−t/40the general solution, with the steady state 1(40) = 400 = 40 + Cthe initial condition Q(0) = 0Q = 40(1 − e−t/40)the solutionQ(40) = 40(1 − e−1) = 25.3 kgwith e−1 = 0.368
2. For the tank of Part 2 with the constant volume, find the time at which the tank contains 40 kg of salt.
40 = 50 − 45e−t/25set Q equal to 40e−t/25 = 10/45 = 2/9subtract 50, then divide by −45−t/25 = ln(2/9)take the natural logarithm of both sidest = 25 ln(9/2) = 37.6 minutesmultiply by −25, with ln(9/2) = 1.504
3. A population follows the logistic model with r = 0.5 per year and K = 1000, and it starts at 100. Find the population after 2 years.
P = 1000/(1 + 9e−0.5t)the solution from Part 3P(2) = 1000/(1 + 9e−1)substitute t = 2P(2) = 1000/(1 + 3.311)with 9e−1 = 3.311P(2) = 232the population after 2 years
4. A radioactive substance has the decay constant 0.03 per day. Find its half-life, and the fraction that is left after 100 days.
T = (ln 2)/0.03 = 23.1 daysthe half-lifeN/N₀ = e−0.03(100) = e−3the fraction after 100 daysN/N₀ = 0.050about 5 percent is left
5. A capacitor with C = 0.002 farads is charged through a resistor with R = 5000 ohms by a battery with V = 12 volts. Find the time constant, the final charge, and the time at which the capacitor has one half of the final charge.
RC = (5000)(0.002) = 10 secondsthe time constantCV = (0.002)(12) = 0.024 coulombsthe final charge1 − e−t/10 = 1/2one half of the final chargee−t/10 = 1/2solve for the exponential functiont = 10 ln 2 = 6.9 secondstake the natural logarithm, then multiply by −10
6. For the falling object of Part 6, find the time at which the velocity is 3.5 m/s, which is one half of the terminal velocity.
(7 + v)/(7 − v) = e2.8tthe relation from Part 6(7 + 3.5)/(7 − 3.5) = 3the left side for v = 3.5e2.8t = 3the conditiont = (ln 3)/2.8 = 0.39 secondstake the natural logarithm, then divide by 2.8
Python Practice
Step 1. The tank and the method of Euler
Part 2 found the solution Q = 50 + Ce−t/25 of the equation Q′ = 2 − Q/25, with C = Q(0) − 50. The code below follows the amount of salt by the method of Euler for 25 minutes, starting at 5 kg, and compares the result with the formula.
Python
The method gives 33.45 kg, and the formula gives 33.45 kg. Now start with 80 kg of salt, which is more than the steady state. Both values should be close to 61.04.
Python
The amount of salt decreases toward 50 kg when it starts above 50 kg.
Step 2. The tank whose volume changes
For the tank with the outflow 2 liters per minute, Part 2 found Q′ = 2 − Q/(50 + t) and the solution Q = 50 + t + C/(50 + t). Substituting t = 0 gives C = 50(Q(0) − 50). The code below follows the amount of salt for 50 minutes.
Python
The method gives 77.51 kg, and the formula gives 77.5 kg. Now start with pure water, Q(0) = 0. Both values should be close to 75.
Python
Step 3. The time at which a population reaches a given size
The logistic solution P = K/(1 + Ae−rt) can be solved for t.
1 + Ae−rt = K/Ptake the reciprocal and multiply by Ke−rt = (K/P − 1)/Asubtract 1, then divide by At = 1/r ln(A/(K/P − 1))take the natural logarithm, then divide by −rThe code below calculates the time at which the population of Part 3 reaches 500 fish.
Python
The time is 4.39 years, as in Part 3. Now find the time at which the population reaches 900 fish. The result should be about 8.79 years.
Python
The population needs 4.39 years to grow from 100 to 500, and the same time again to grow from 500 to 900. The logistic curve is symmetric about the point where the population is one half of the carrying capacity.
Step 4. Carbon dating
If the fraction f of the carbon 14 is left, then f = (1/2)t/5730, and the age is t = 5730 log₂(1/f). The logarithm with the base 2 is typed as np.log2. The code below calculates the age of the wood of Part 4.
Python
The age is about 13300 years. Now find the age of a sample in which 10 percent of the carbon 14 is left. The result should be about 19035 years.
Python
Step 5. Falling with a force proportional to v²
Part 6 found the velocity of an object that falls from rest with v′ = g − cv². In symbols, with the terminal velocity vT = √g/c, the solution is v = v_T (e2cv_T t − 1)/(e2cv_T t + 1). The code below compares this formula with the method of Euler at t = 1 second, for c = 0.2.
Python
The method gives 6.199 m/s, and the formula gives 6.197 m/s. Now use c = 0.1. Both values should be close to 7.50 m/s.
Python
With the smaller c the object is faster after 1 second, because the resistive force is smaller at each velocity.
Quiz
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. A tank contains 200 liters of water. Salt water with 0.2 kg per liter flows in at 5 liters per minute, and the mixture flows out at 5 liters per minute. Which equation describes the amount of salt Q in kilograms, with t in minutes?
rate in = (0.2)(5) = 1 kg/minthe concentration of the inflow times the flow raterate out = Q/200(5) = Q/40 kg/minthe concentration in the tank times the flow rateQ′ = 1 − Q/40the rate in minus the rate out
2. Which amount of salt, in kilograms, does the tank of Question 1 approach after a long time?
The steady state of Q′ = 1 − Q/40 is the value at which Q′ = 0, which is Q = 40. This is the amount of salt in 200 liters with the concentration 0.2 kg per liter of the inflow.
3. A radioactive substance has the decay constant 0.1 per year. Find its half-life in years.
e−0.1T = 1/2one half of the atoms are left at the time T−0.1T = −ln 2take the natural logarithm of both sidesT = (ln 2)/0.1 = 6.931the half-life
4. A population follows the logistic model with the carrying capacity K. At which size does it grow fastest?
The rate of growth rP(1 − P/K) is a quadratic function of P that is 0 at P = 0 and at P = K. Its largest value is in the middle between these two points, at P = K/2.
5. A capacitor with C = 0.004 farads is charged through a resistor with R = 500 ohms. Find the time constant in seconds.
RC = (500)(0.004)the time constant of the circuitRC = 2in secondsAfter 2 seconds the capacitor has 63 percent of its final charge.
This is the last topic that is posted so far. Back to the list of units and topics