Unit 9, lesson 121

Mixing, Cooling, and First-Order Circuits

How to set up first order models for salt in a tank, a cooling object and simple electric circuits from a balance of rates, solve them, and read off what each constant means in physical units.

  • Theory part 241
  • Practice part 242
  • Modelling with Differential Equations

Salt dissolving in a tank, coffee cooling on a desk and a capacitor charging in a flash unit seem to have nothing in common. Each is a quantity that moves toward a target value at a rate proportional to how far away it is. Writing down that rate correctly, with the right units, is most of the work, and the equation that comes out is always a first order linear one.

Key terms

Input-output balance

Definition If Q(t)Q(t) is the amount of some quantity in a system at time tt, and it changes only by flows in and out, then

dQdt=(rate in)−(rate out),\frac{dQ}{dt} = (\text{rate in}) - (\text{rate out}),

where each rate is measured in units of QQ per unit of time.

In plain words The amount changes by what comes in minus what goes out. This is bookkeeping, and it is where every model in this lesson starts.

Example A bank account earns 3%3\% interest per year compounded continuously and receives deposits of 12001200 dollars per year. The balance of rates is

dQdt=0.03Q+1200,\frac{dQ}{dt} = 0.03Q + 1200,

with QQ in dollars and tt in years.

Mixing tanks

Definition A tank holds V(t)V(t) liters of a well-stirred solution containing Q(t)Q(t) kilograms of salt. Solution with concentration cinc_{\text{in}} kilograms per liter flows in at rinr_{\text{in}} liters per minute, and the mixture flows out at routr_{\text{out}} liters per minute, with cinc_{\text{in}}, rinr_{\text{in}} and routr_{\text{out}} constant. If the tank holds V0V_0 liters at time 00, then V(t)=V0+(rin−rout) tV(t) = V_0 + (r_{\text{in}} - r_{\text{out}})\,t and

dQdt=rin cin−rout Q(t)V(t),\frac{dQ}{dt} = r_{\text{in}}\,c_{\text{in}} - r_{\text{out}}\,\frac{Q(t)}{V(t)},

valid while V(t)>0V(t) > 0 and the tank does not overflow.

In plain words Salt comes in at the inflow concentration and leaves at the current concentration in the tank, which is the amount divided by the volume.

Example A tank holds 100100 liters of pure water. Brine with 0.20.2 kilograms of salt per liter flows in at 55 liters per minute, and the mixture flows out at the same rate. Then V=100V = 100 and

dQdt=1−Q20,Q(0)=0.\frac{dQ}{dt} = 1 - \frac{Q}{20}, \qquad Q(0) = 0.

With the integrating factor et/20e^{t/20} this gives

Q(t)=20(1−e−t/20).Q(t) = 20\left(1 - e^{-t/20}\right).

After 2020 minutes the tank holds 20(1−e−1)≈12.6420\left(1 - e^{-1}\right) \approx 12.64 kilograms, and in the long run Q→20Q \to 20, which is 0.20.2 kilograms per liter times 100100 liters.

Newton’s law of cooling

Definition Newton’s law of cooling says that the temperature T(t)T(t) of an object in surroundings at constant temperature TaT_a changes at a rate proportional to the difference,

dTdt=−k(T−Ta),k>0.\frac{dT}{dt} = -k\left(T - T_a\right), \qquad k > 0.

With T(0)=T0T(0) = T_0 the solution is

T(t)=Ta+(T0−Ta)e−kt.T(t) = T_a + \left(T_0 - T_a\right)e^{-kt}.

In plain words A hot object cools quickly at first and then more and more slowly as it nears room temperature. A cold object warms up the same way.

Example Coffee at 9090 degrees Celsius sits in a room at 2020 degrees. After 1010 minutes it is at 6060 degrees. Then 40=70e−10k40 = 70e^{-10k}, so

k=110ln⁡74≈0.0560 per minute.k = \frac{1}{10}\ln\frac{7}{4} \approx 0.0560 \text{ per minute}.

It reaches 4040 degrees when 20=70e−kt20 = 70e^{-kt}, that is at

t=ln⁡3.5k=10ln⁡3.5ln⁡1.75≈22.4 minutes.t = \frac{\ln 3.5}{k} = \frac{10\ln 3.5}{\ln 1.75} \approx 22.4 \text{ minutes}.

RC and RL circuits

Definition In a series circuit with resistance R>0R > 0 ohms, capacitance C>0C > 0 farads and a source of E(t)E(t) volts, the charge q(t)q(t) in coulombs on the capacitor satisfies

R dqdt+1C q=E(t),R\,\frac{dq}{dt} + \frac{1}{C}\,q = E(t),

and the current is i=dqdti = \frac{dq}{dt} in amperes. In a series circuit with resistance RR and inductance L>0L > 0 henries, the current satisfies

L didt+R i=E(t).L\,\frac{di}{dt} + R\,i = E(t).

For constant EE and q(0)=0q(0) = 0, i(0)=0i(0) = 0 the solutions are

q(t)=CE(1−e−t/(RC)),i(t)=ER(1−e−Rt/L).q(t) = CE\left(1 - e^{-t/(RC)}\right), \qquad i(t) = \frac{E}{R}\left(1 - e^{-Rt/L}\right).

In plain words The voltage drops around the loop add up to the source voltage. A capacitor charges toward CECE and the current in an inductor builds up toward ER\frac{E}{R}.

Example Take R=2000R = 2000 ohms, C=5×10−4C = 5 \times 10^{-4} farads and E=12E = 12 volts, so RC=1RC = 1 second. The charge is q(t)=0.006(1−e−t)q(t) = 0.006\left(1 - e^{-t}\right) coulombs, which is about 0.00380.0038 coulombs after one second. For an RL circuit with L=0.5L = 0.5 henries, R=10R = 10 ohms and E=20E = 20 volts, i(t)=2(1−e−20t)i(t) = 2\left(1 - e^{-20t}\right) amperes.

Units

Definition In a correct model every term of the equation has the same units, and every exponent such as ktkt or tRC\frac{t}{RC} is a pure number. A rate constant like kk has units of 1time\frac{1}{\text{time}}.

In plain words Check the units before solving. A mismatch almost always means a missing factor.

Example In the tank equation the inflow term rincinr_{\text{in}}c_{\text{in}} has units

Lmin⋅kgL=kgmin,\frac{\text{L}}{\text{min}} \cdot \frac{\text{kg}}{\text{L}} = \frac{\text{kg}}{\text{min}},

the same as dQdt\frac{dQ}{dt}. For the RC circuit, an ohm is a volt per ampere and a farad is a coulomb per volt, so RCRC is measured in coulombs per ampere. An ampere is a coulomb per second, so that unit is the second, and tRC\frac{t}{RC} is a pure number.

Initial conditions

Definition An initial condition gives the state of the system at the starting time, such as Q(0)Q(0), T(0)T(0), q(0)q(0) or i(0)i(0). Since each model is a first order linear equation with continuous coefficients, one initial condition determines exactly one solution. In an RL circuit the current cannot jump, so if the switch closes at t=0t = 0 with no current flowing, then i(0)=0i(0) = 0.

In plain words The equation describes how the system changes. The initial condition says what it was doing when you started watching.

Example Suppose the tank above starts with 55 kilograms of salt instead of none. The general solution is Q=20+Ae−t/20Q = 20 + Ae^{-t/20}, and Q(0)=20+A=5Q(0) = 20 + A = 5 gives A=−15A = -15, so

Q(t)=20−15e−t/20.Q(t) = 20 - 15e^{-t/20}.

Interpreting the parameters

Definition The tank with constant volume, the cooling model and the circuits with a constant source all have the form

y′=−1τ(y−y∞),y(t)=y∞+(y(0)−y∞)e−t/τ,y' = -\frac{1}{\tau}\left(y - y_\infty\right), \qquad y(t) = y_\infty + \left(y(0) - y_\infty\right)e^{-t/\tau},

with constants τ>0\tau > 0 and y∞y_\infty. The number y∞y_\infty is the equilibrium value, and the time constant τ\tau is the time it takes the gap y−y∞y - y_\infty to shrink by a factor of ee. The gap halves every τln⁡2\tau\ln 2 time units. In the examples, τ=Vrout\tau = \frac{V}{r_{\text{out}}} for a tank with constant volume VV, τ=1k\tau = \frac{1}{k} for cooling, τ=RC\tau = RC and τ=LR\tau = \frac{L}{R} for the circuits.

In plain words The equilibrium tells you where the system is headed, and the time constant tells you how fast it gets there. After about five time constants the gap is below one percent.

Example For the coffee, τ=1k≈17.9\tau = \frac{1}{k} \approx 17.9 minutes and the temperature gap halves every τln⁡2≈12.4\tau \ln 2 \approx 12.4 minutes. For the tank, τ=1005=20\tau = \frac{100}{5} = 20 minutes and y∞=20y_\infty = 20 kilograms. Since e−5≈0.0067e^{-5} \approx 0.0067, after 100100 minutes the tank is within one percent of its final salt content.

Check yourself

  1. A body at 100100 degrees is placed in a room at 2525 degrees and cools with k=0.1k = 0.1 per minute. What is its temperature after 1010 minutes?
Show the answer

The temperature is T(10)=25+75e−1≈52.6T(10) = 25 + 75e^{-1} \approx 52.6 degrees.

  1. A tank holds 5050 liters of water with 1010 kilograms of salt. Pure water flows in at 22 liters per minute and the mixture flows out at 22 liters per minute. Find Q(t)Q(t).
Show the answer

The balance of rates is

dQdt=−2Q50=−Q25,Q(0)=10,\frac{dQ}{dt} = -\frac{2Q}{50} = -\frac{Q}{25}, \qquad Q(0) = 10,

so Q(t)=10e−t/25Q(t) = 10e^{-t/25} kilograms.

  1. What is the time constant of an RL circuit with L=0.2L = 0.2 henries and R=40R = 40 ohms, and what current does it approach with a 1212 volt source?
Show the answer

The time constant is τ=LR=0.240=0.005\tau = \frac{L}{R} = \frac{0.2}{40} = 0.005 seconds, and the current approaches ER=1240=0.3\frac{E}{R} = \frac{12}{40} = 0.3 amperes.

How this lesson connects

It also uses physical units.