Two rates, each depending on both
Take and . The rate of x depends on y as well as on x, and the rate of y depends on x as well as on y. So neither equation can be separated and solved on its own: to know how x changes you must already know y, and the other way round. A pair like this is coupled, and the two equations are solved together.
At the point (1, 0) the rates are 1 + 0 = 1 and 4 + 0 = 4, so x grows slowly while y grows four times as fast. At (0, 1) they are both 1. The pair gives the velocity of the point (x, y) wherever it is.
One matrix equation
Stack the two quantities into one column, X = (x; y), and the two rates into its derivative , the column whose entries are and . The right-hand sides are then a matrix times X: (1 1; 4 1) times (x; y) is (x + y; 4x + y). So the pair is the single equation with M = (1 1; 4 1).
Each equation fills one row of M, with the coefficient of x first and the coefficient of y second. A rate that leaves out a letter has a 0 in that place: and give M = (3 0; 1 −2).
A direction at every point
A solution is a pair of functions x(t) and y(t), and as t runs the point (x, y) traces a path. Dividing one rate by the other removes t: . That is a gradient at every point, so the pair draws a slope field, and every path runs along it.
The slope field has lost one thing: which way along the segment the point moves. The rates themselves still say. At (1, 0) the velocity is (1, 4), up and to the right. At (−1, 0) it is (−1, −4), down and to the left, along a segment of the same gradient. On the line y = −x, , so the path there moves straight up or down.
The slope field , with the velocity (x + y, 4x + y) drawn at a quarter of its length at six points: (1, 4) at (1, 0), (1, 1) at (0, 1), and (−1, 2) at (1, −2), each with its opposite at the opposite point. On y = −x the field is vertical and no segment is drawn.
Where nothing moves
A point where both rates are 0 is an equilibrium: a pair that starts there stays there. Here x + y = 0 and 4x + y = 0. Subtracting the first from the second gives 3x = 0, so x = 0 and then y = 0. The origin is the only equilibrium.
That is the case whenever det M is not 0: here det M = 1 × 1 − 1 × 4 = −3, so M X = 0 has only the solution X = 0. A pair with det M = 0 has a whole line of points at rest, and a pair with constant terms, such as , has its equilibrium somewhere else.
Two towns
Models of two connected quantities take the same form. Take and , for two populations that each lose people at a rate set by their own size and gain them at a rate set by the other’s. In each equation the coefficient of its own quantity is negative and the coefficient of the other is positive, and M = (−0.2 0.1; 0.3 −0.4).
Its determinant is 0.08 − 0.03 = 0.05, which is not 0, so again the only equilibrium is the origin. The next lesson solves this pair: with x = 100 and y = 50 at the start, it gives and , and by t = 10 the two are almost equal, at about 32.3 and 31.9.
Euler’s method for a pair
Euler’s method still works, one step for both quantities at once. From the values and , work out both rates there, then move each quantity by h times its own rate: and .
From (1, 0) with h = 0.1: the rates are 1 and 4, so the first step reaches (1.1, 0.4). There the rates are 1.5 and 4.8, giving (1.25, 0.88). Two more steps give (1.463, 1.468) and (1.756, 2.2).
The exact solution from (1, 0), found in the next lesson, is , . At t = 0.2 it is (1.320, 1.003), so the two Euler steps are low. As for a single equation, smaller steps miss by less.
Four Euler steps of h = 0.1 from (1, 0), drawn as arrows: to (1.1, 0.4), (1.25, 0.88), (1.463, 1.468) and (1.756, 2.2). The gold curve is the exact path, through (1.320, 1.003) at t = 0.2 and (1.995, 2.650) at t = 0.4. The arrows run above and to the left of it, and each Euler point falls short of where the exact path is at the same time.
Predators and prey
Coupled pairs need not be linear. In the instrument below, x is a number of prey and y a number of predators: and . The prey grow on their own and are eaten when they meet predators; the predators die out on their own and grow when they meet prey. The point (1, 1) is an equilibrium, and every other path circles it.
x − ln x + y − ln y is conserved, so the orbit closes: prey rise while predators are few, predators rise on the prey, prey fall, predators fall, and it repeats
Start at a peak of the prey population and read when the predators peak
The path from 2.2 prey and 0.6 predators closes up on itself, because x − ln x + y − ln y keeps the value it starts with. Beside it, the two numbers against time: each peak in the prey comes before a peak in the predators. Drag the start onto the line y = 1, right of (1, 1): there , so the path starts at a peak in the prey.
The usual mistakes
Filling M by columns. The first row of M is the first equation: and give (3 −1; 1 2), not (3 1; −1 2).
Dropping a sign or a zero. A minus sign travels with its coefficient into M, and a missing letter is a 0 entry, not a blank.
Using a new value too soon. In an Euler step both rates are worked out at step n. Updating x first and then using the new x in the rate of y is a different method, and gives a different answer.
Expecting the slope field to show the direction of travel. is the same at (1, 0) and at (−1, 0), but the point moves up the segment at one and down it at the other.
Brine in two tanks, and a technetium generator
In the applications below, salt passes between two tanks in both directions, so each tank’s salt changes at a rate set by both; eliminating one tank turns the pair into one second-order equation. In the generator, one isotope decays into another, so the second rate depends on the first quantity but the first does not depend on the second, and the pair can be solved one equation at a time.
Worked example: Two Connected Tanks of Brine: The Equations for the Salt in Each, and When the Second Tank Holds the Most
Question Two tanks, A and B, each hold 40 liters of brine and are kept well stirred. Pure water flows into tank A at 6 liters per minute. Brine is pumped from A to B at 8 liters per minute and from B back to A at 2 liters per minute, and brine drains out of B at 6 liters per minute. At the start, tank A holds 20 kilograms of salt and tank B holds pure water. Let x and y be the kilograms of salt in A and in B, m minutes after the start. (a) Write down the pair of differential equations for x and y. (b) Find the greatest amount of salt that tank B holds, and when it holds it.
1.First check that the volumes stay fixed. Tank A takes in 6 + 2 = 8 liters per minute and sends out 8; tank B takes in 8 and sends out 2 + 6 = 8. So each tank always holds 40 liters, and the concentrations are x40 and y40 kilograms per liter.
Each tank takes in 8 liters a minute and sends out 8, so both stay at 40 liters, with concentrations x40 and y40. 2.(a) Salt enters A only in the 2 liters per minute from B, carrying 2 × y40 = 0.05y kilograms per minute, and leaves in the 8 liters per minute sent to B, carrying 8 × x40 = 0.2x. So dxdm = −0.2x + 0.05y. Salt enters B at 0.2x and leaves in 2 + 6 = 8 liters per minute, carrying 0.2y, so dydm = 0.2x − 0.2y.
(a) At the start A loses salt at 0.2 × 20 = 4 kilograms a minute and B gains it at the same rate: the two short lines. 3.Eliminate x. The second equation gives x = 5dydm + y, so dxdm = 5d2ydm2 + dydm. Substituting both into the first equation gives 5d2ydm2 + dydm = −dydm − 0.2y + 0.05y, and dividing by 5 after collecting terms gives d2ydm2 + 0.4dydm + 0.03y = 0.
From the second equation x = 5dydm + y; substituting into the first leaves one second-order equation in y. 4.The auxiliary equation λ2 + 0.4λ + 0.03 = 0 factorizes as (λ + 0.1)(λ + 0.3) = 0, so y = Ae−0.1m + Be−0.3m. At the start y = 0, so B = −A, and dydm = 0.2 × 20 − 0 = 4, so −0.1A + 0.3A = 4 and A = 20. Hence y = 20e−0.1m − 20e−0.3m.
The roots −0.1 and −0.3, with y = 0 and dydm = 4 at the start, give y = 20e−0.1m − 20e−0.3m. 5.(b) The salt in B is greatest where dydm = −2e−0.1m + 6e−0.3m = 0, that is where e0.2m = 3, so m = 5ln 3 ≈ 5.49 minutes. Then e−0.1m = 1√3 and e−0.3m = 13√3, so y = 20√3 − 203√3 = 403√3 ≈ 7.70 kilograms.
(b) The salt in B is greatest where dydm = 0: m = 5ln 3 ≈ 5.49 minutes, with 403√3 ≈ 7.70 kilograms. 6.Check: x = 5dydm + y = 10e−0.1m + 10e−0.3m, which is 20 at the start, as it should be. At m = 5ln 3 it is 10√3 + 103√3 = 403√3, the same as y: tank B holds the most salt exactly when the two tanks are equally salty, because then salt flows into B as fast as it flows out.
Check: x = 10e−0.1m + 10e−0.3m crosses y exactly at the peak, where the two tanks are equally salty.
Answer: (a) dxdm = −0.2x + 0.05y and dydm = 0.2x − 0.2y; (b) tank B holds the most salt, 403√3 ≈ 7.70 kilograms, after 5ln 3 ≈ 5.49 minutes
Common mistakes
- Using the 6 liters per minute that drain from B as the only flow out of B. Brine also leaves B in the 2 liters per minute pumped back to A, so B loses salt at 8 × y40 = 0.2y, not at 6 × y40 = 0.15y.
- Writing the rates in liters instead of kilograms of salt, as in dxdm = 2 − 8. The equations are about the salt, so each flow of brine must be multiplied by the concentration of the tank it leaves.
More coupled differential equations problems, worked step by step →
Worked example: A Hospital's Technetium Generator: The Technetium Building Up From Decaying Molybdenum, and When to Draw It Off
Question A hospital's generator holds molybdenum-99, which decays with a half-life of 66 hours into technetium-99m, which itself decays with a half-life of 6 hours. Assume that every molybdenum atom that decays becomes a technetium-99m atom. Just after the technetium is drawn off, the generator holds N molybdenum atoms and no technetium. Let x and y be the numbers of molybdenum and technetium atoms h hours later, and let a = ln 266 and b = ln 26 be the two decay constants, per hour. (a) Write down the differential equations for x and y, and solve them. (b) The technetium is next drawn off when there is most of it. How many hours after the last draw is that, and how do the activities of the two isotopes, ax and by decays per hour, compare at that moment?
1.Each isotope decays at its decay constant times the number of its atoms. The molybdenum only decays, so dxdh = −ax. The technetium gains one atom for each molybdenum atom that decays and loses its own atoms as they decay, so dydh = ax − by.
The molybdenum only decays; the technetium is made as the molybdenum decays and decays itself. 2.The first equation involves x alone, and with x = N at the start its solution is x = Ne−ah.
The first equation involves x alone: x = Ne−ah. The curve is its activity, ax, as a percentage of aN. 3.Substituting gives dydh + by = aNe−ah. Try y = Ke−ah: then −aK + bK = aN, so K = aNb − a. Since b − a = ln 2(16 − 166) = 10ln 266, this is K = N10. Adding Ce−bh, the solution with right side zero, and using y = 0 at the start gives C = −N10.
A multiple of e−ah fits the technetium equation when K = aNb − a = N10. 4.(a) So x = Ne−ah and y = N10(e−ah − e−bh). This is zero at the start and positive afterward, because b > a makes e−bh the smaller of the two exponentials.
(a) y = N10(e−ah − e−bh) starts at zero; its activity, by, is the second curve. 5.(b) The technetium is greatest where dydh = N10(−ae−ah + be−bh) = 0, that is where e(b − a)h = ba = 11. So h = ln 11b − a = 6.6ln 11ln 2 ≈ 22.8 hours.
(b) The technetium is greatest where e(b − a)h = 11, at h = 6.6ln 11ln 2 ≈ 22.8 hours. 6.At that moment dydh = ax − by = 0, so ax = by: the two activities are equal. Check: e−ah = 2−22.83/66 ≈ 0.7866 and e−bh = 2−22.83/6 ≈ 0.0715, so y ≈ N10(0.7866 − 0.0715) ≈ 0.0715N. Then ax ≈ 0.01050 × 0.7866N ≈ 0.00826N and by ≈ 0.1155 × 0.0715N ≈ 0.00826N decays per hour, equal. Hospitals draw the technetium off about once a day, close to this time.
There dydh = ax − by = 0, so the two activity curves cross exactly at the peak.
Answer: (a) dxdh = −ax and dydh = ax − by, with x = Ne−ah and y = N10(e−ah − e−bh); (b) after 6.6ln 11ln 2 ≈ 22.8 hours, when the two activities are equal
Common mistakes
- Writing the technetium's equation as dydh = −by, as if it only decayed. The technetium is also being made, one atom for each molybdenum atom that decays, and without that term a generator that starts with no technetium would never hold any.
- Solving ae−ah = be−bh by setting the exponents equal, −ah = −bh, which gives h = 0. The two sides also differ in their constants: taking logarithms gives ln a − ah = ln b − bh, so (b − a)h = lnba, and ba = 666 = 11.
More coupled differential equations problems, worked step by step →