Flow Lab

Syllabus / Module 3: First-Order ODEs

Lesson 3.5

Modeling with First-Order ODEs

Building models from conservation and rate laws: mixing tanks, Newton cooling, falling with drag, RC circuits, compound interest.

Written byClaude Sonnet

🌊
Why this matters for simulation: Quadratic drag ½ρC_dAv² comes straight from fluid dynamics — it's what limits a skydiver or a plane.

By the end of this lesson you can…

  • Build a first-order ODE from a balance law, rate of change equals inflow minus outflow, writing the units of every term first.
  • Set up a mixing tank with a changing volume and show where the extra dilution term comes from.
  • Fit a cooling constant from two readings, predict a later temperature, and say when Newton's law is a poor model.
  • Choose the tool for drag, integrating factor for linear and separation for quadratic, and read terminal velocity off by setting the derivative to zero.
  • Build the RC-circuit equation from Kirchhoff and the capacitor law, and recognise it as the cooling and tracer equation renamed.
  • Catch a wrong equation with a dimensional check, and say what such a check cannot catch.
  • Compute a terminal velocity from quadratic drag with stated assumptions, and see compound interest as Euler's method.
On this page
·
  1. The balance law
  2. A mixing tank whose volume changes
  3. Newton’s law of cooling
  4. Falling bodies: linear and quadratic drag
  5. The RC circuit, and the sameness
  6. Compound interest: discrete and continuous
  7. Units and dimensional checks
  8. Quadratic drag in a real fluid
  9. Playing with the numbers
  10. Exercise: build the models
  11. Problems
  12. Where this goes
  13. Key Takeaways

The last two lessons gave you tools: separation of variables (3.3 Separable Equations) and the integrating factor (3.4 Linear First-Order Equations & Integrating Factors). Both start from an equation that someone has already written down. This lesson is about the step before that, which is where most of the real difficulty lives: getting the equation. A tank, a coffee cup, a skydiver and a circuit look unrelated, but one short recipe produces all four equations, and three of them turn out to be the same equation under different names.

That matters for simulation. A fluid solver is a bookkeeping device: for every cell, the change in what the cell holds equals what flowed in minus what flowed out. If you can do that for one tank, you can read a finite-volume code. We do it for five systems, then check our work by looking at units.

▶ Video Building rate = in minus out for a tank, a mug, a diver and a capacitor, and checking the unitscaptions only
Transcript
  1. Until now someone handed you the equation. This lesson is about writing it. One recipe: the rate of change is what comes in minus what goes out, with units written first.
  2. A tank holds 100 litres of brine at 20 grams per litre. Brine at 50 grams per litre pours in at 6 litres a minute, and the stirred mixture leaves at 4. So 300 grams of salt arrive each minute, and the volume grows by 2 litres a minute: V equals 100 plus 2t.
  3. Take the salt mass m, because mass is what is conserved. In: 300 grams per minute, from the inlet. Out: the leaving mixture has the tank's concentration, m over V, so salt leaves at 4 m over V. Every term is grams per minute.
  4. This is linear, so the integrating factor works: mu is 50 plus t, squared. Divide the mass by the volume and the concentration climbs from 20 toward 50: 41.11 at 25 minutes, 46.25 at 50, 48.89 when the tank is full at 100. It crosses 45 at 40.86 minutes.
  5. The trap is writing the concentration equation directly. With m equal to c V, the product rule gives m prime equals c prime V plus c V prime. That second term is dilution: a filling tank spreads its salt thinner. Combine it with the outflow: c prime is 6 over V times 50 minus c.
  6. A mug loses heat in proportion to its gap from the room. Coffee at 85 degrees, then 65 ten minutes later in a 21 degree room: the gaps 64 and 44 give k equals 0.03747 per minute, a time constant of 26.7 minutes. It reads 51.25 at 20 minutes, hits 55 at 16.9, and levels off at 21, where out equals in.
  7. A falling body: m v prime is weight minus drag. Linear drag is b v; quadratic is half rho C d A v squared. At steady speed v prime is zero, so drag equals weight. Below it weight wins; above it drag wins. An 80 kilogram skydiver: 56.6 metres per second, 204 kilometres an hour. Give linear drag that same terminal speed and b over m is 0.173.
  8. Both laws on one set of axes. Without drag the diver would reach 49.1 metres per second at five seconds and 98.1 at ten. Quadratic drag gives 39.6 and 53.2, reaching 95 percent of terminal speed at 10.6 seconds. Linear drag with the same terminal speed arrives more slowly: 32.8 at five seconds, 46.6 at ten.
  9. A resistor and capacitor in series with a battery. Kirchhoff: V in equals R i plus v. The capacitor: i equals C v prime. Together, R C v prime plus v equals V in, and ohms times farads is seconds.
  10. With 4.7 kilohms and 220 microfarads, R C is 1.034 seconds. A 12 volt step reaches 7.59 volts after one R C, 10 volts at 1.853 seconds, and 90 percent at 2.381 seconds.
  11. Now line them up. The tank, the mug, the tracer room, linear drag and the capacitor are one equation: y prime is one over tau times the target minus y.
  12. The target is set by what pushes. The rate, one over tau, falls as there is more stuff to move: a bigger tank, mug, ball or capacitor has a longer tau and is more sluggish. Solve one and you have solved all five. Quadratic drag stays out.
  13. Units catch mistakes. Someone writes v prime equals g minus b v. Acceleration is metres per second squared, but b v is kilograms metres per second squared, a force. The equation adds an acceleration to a force. Divide by m and every term agrees. A unit check cannot see a missing half or a wrong sign.
  14. Quadratic drag, half rho C d A v squared, is what limits a skydiver or a plane. A finite-volume fluid solver is this lesson at scale: every cell's mass, momentum and energy change by flux in minus flux out. Rate of change equals in minus out. Units first.

The balance law

Take a quantity that is conserved apart from what crosses a boundary: salt in a tank, heat in a mug, momentum of a falling body, charge on a capacitor. Over a short time Δt\Delta t,

change in stored amount=amount that came in−amount that left+amount made inside.\text{change in stored amount} = \text{amount that came in} - \text{amount that left} + \text{amount made inside} .

Dividing by Δt\Delta t gives a balance law:

dydt=rate in−rate out.\frac{dy}{dt} = \text{rate in} - \text{rate out} .

The art is in writing each rate. A rate in is usually given: a pump delivers so many litres per minute. A rate out usually depends on the state yy, because what leaves is whatever is currently inside; that dependence is what makes it an ODE.

A mixing tank whose volume changes

A tank holds V0=100V_0 = 100 L of brine at 2020 g/L, so it starts with m(0)=2000m(0) = 2000 g of salt. Brine at cin=50c_{in} = 50 g/L is pumped in at Qin=6Q_{in} = 6 L/min, and the well-stirred mixture is pumped out at Qout=4Q_{out} = 4 L/min. The tank can hold 300 L.

Last lesson’s tracer room had a fixed volume. Here the tank gains 6−4=26 - 4 = 2 L/min, so

V(t)=100+2t(L, with t in minutes),V(t) = 100 + 2t \quad \text{(L, with } t \text{ in minutes)},

and the tank is full at t=100t = 100 min. The unknown with the cleanest balance is the mass mm of salt, because mass is what is conserved. Build it term by term, with units.

  • In: Qin cin=(6 L/min)(50 g/L)=300Q_{in}\,c_{in} = (6\ \text{L/min})(50\ \text{g/L}) = 300 g/min.
  • Out: the stirred mixture leaving has the tank’s concentration m/Vm/V, so salt leaves at Qout m/VQ_{out}\,m/V g/min.

So

m′=300−4 m100+2t[g/min]=[g/min]−[g/min].m' = 300 - \frac{4\,m}{100 + 2t} \qquad [\text{g/min}] = [\text{g/min}] - [\text{g/min}] .

Every term is grams per minute. This is linear first-order, m′+p(t) m=gm' + p(t)\,m = g, with p=4/(100+2t)=2/(50+t)p = 4/(100 + 2t) = 2/(50 + t) and g=300g = 300, so it is the integrating factor’s job (last lesson’s tool, because the unknown appears to the first power). The coefficient depends on tt, which is the new feature. The integrating factor is

μ=e∫2/(50+t) dt=(50+t)2,\mu = e^{\int 2/(50+t)\,dt} = (50 + t)^2 ,

so ((50+t)2m)′=300 (50+t)2\big((50 + t)^2 m\big)' = 300\,(50 + t)^2, hence (50+t)2 m=100 (50+t)3+C(50 + t)^2\,m = 100\,(50 + t)^3 + C. The start m(0)=2000m(0) = 2000 gives 2500⋅2000=100⋅125000+C2500 \cdot 2000 = 100 \cdot 125000 + C, so C=−7.5×106C = -7.5 \times 10^6, and

m(t)=100 (50+t)−7.5×106(50+t)2,c(t)=mV=50−3.75×106(50+t)3.m(t) = 100\,(50 + t) - \frac{7.5\times 10^{6}}{(50 + t)^2}, \qquad c(t) = \frac{m}{V} = 50 - \frac{3.75\times 10^{6}}{(50 + t)^3} .

At t=25t = 25, 5050 and 100100 min the salt mass is 6166.76166.7, 9250.09250.0 and 14666.714666.7 g, and the concentration is 41.1141.11, 46.2546.25 and 48.8948.89 g/L. The concentration reaches 45 g/L at t=40.86t = 40.86 min, when the volume is 181.7181.7 L.

The trap is writing the concentration equation directly. With m=cVm = cV you must differentiate the product, and the growing volume contributes a term:

m′=c′V+cV′⟹c′=m′−cV′V=Qincin−Qoutc−(Qin−Qout)cV=QinV (cin−c).m' = c'V + cV' \quad\Longrightarrow\quad c' = \frac{m' - cV'}{V} = \frac{Q_{in}c_{in} - Q_{out}c - (Q_{in} - Q_{out})c}{V} = \frac{Q_{in}}{V}\,(c_{in} - c) .

The outflow QoutcQ_{out}c and the dilution V′cV'c combine to QincQ_{in}c: filling a tank dilutes it as surely as draining removes salt. The concentration relaxes toward cinc_{in} at a rate Qin/V(t)Q_{in}/V(t) that falls as the tank fills, so the gap decays algebraically, as 3.75×106/(50+t)33.75\times 10^{6}/(50+t)^3, not exponentially. At t=25t = 25 both sides of c′=6(50−c)/Vc' = 6(50 - c)/V equal 0.35560.3556 g/L per min.

✅ Concept check

A student models a constant-volume tank (volume $V$ in L, flow $Q$ in L/min, concentration $c$ in g/L) as $c' = Q\,(c_{in} - c)$. What is wrong, and what repairs it?

Newton’s law of cooling

A mug of coffee loses heat to the room. Let TT be its temperature and TenvT_{env} the room’s. The heat stored is mcpTmc_pT (mass times specific heat times temperature), and the only way it leaves is across the surface, at a rate we model as proportional to the temperature difference, hA (T−Tenv)hA\,(T - T_{env}) in watts, where hh is a heat-transfer coefficient in W/(m2^2K) and AA is the surface area. The balance is

mcp T′=−hA (T−Tenv)⟹T′=k (Tenv−T),k=hAmcp.m c_p\,T' = -hA\,(T - T_{env}) \quad\Longrightarrow\quad T' = k\,(T_{env} - T), \qquad k = \frac{hA}{m c_p} .

Units: hAhA is W/K, mcpmc_p is J/K, and their ratio is 1/s1/\text{s}. This has the shape of last lesson’s tracer equation c′=λ(ceq−c)c' = \lambda(c_{eq} - c), with solution T=Tenv+(T0−Tenv) e−ktT = T_{env} + (T_0 - T_{env})\,e^{-kt}. As a balance, “in” is the constant kTenvkT_{env} and “out” is kTkT, which grows with TT until the two are equal.

Fitting kk. Suppose a 0.25 kg mug of coffee, treated as water, reads 85∘85^\circC in a 21∘21^\circC room, and 65∘65^\circC ten minutes later. The gaps from the room are 6464 and 4444, so e−10k=44/64=0.6875e^{-10k} = 44/64 = 0.6875 and k=0.03747 min−1k = 0.03747\ \text{min}^{-1}, a time constant 1/k=26.71/k = 26.7 min. Predictions: T(20)=51.25∘T(20) = 51.25^\circC, T(30)=41.8∘T(30) = 41.8^\circC, and the coffee reaches 55∘55^\circC at t=ln⁡(64/34)/k=16.9t = \ln(64/34)/k = 16.9 min. With cp=4186c_p = 4186 J/(kg K) (rounded), kk implies hA=0.65hA = 0.65 W/K, or h≈22h \approx 22 W/(m2^2K) for an assumed area of 0.03 m20.03\ \text{m}^2: plausible for air. These readings are illustrative, not measurements.

Falling bodies: linear and quadratic drag

A body of mass mm falls. Newton’s second law is a balance law for momentum: mv′m v' is the sum of forces, gravity mgmg down and a drag force up that depends on the speed.

Linear drag. For slow motion through a thick fluid, drag is proportional to speed, F=bvF = bv, with bb in kg/s. Then

mv′=mg−bv[N]=[N]−[N].m v' = mg - b v \qquad [\text{N}] = [\text{N}] - [\text{N}] .

Each term is a force: bvbv is (kg/s)(m/s) = kg m/s2^2, like mgmg. Dividing by mm gives v′+(b/m) v=gv' + (b/m)\,v = g, linear, so the integrating factor μ=ebt/m\mu = e^{bt/m} gives v=mgb(1−e−bt/m)v = \dfrac{mg}{b}\left(1 - e^{-bt/m}\right) from rest.

Terminal velocity without solving. At a steady speed v′=0v' = 0, so mg=bvtmg = bv_t:

vt=mgb.v_t = \frac{mg}{b} .

The balance also shows why the speed settles: below vtv_t drag is smaller than gravity, so v′>0v' \gt 0; above it drag is larger, so v′<0v' \lt 0. The correction always points back toward vtv_t and is proportional to the distance from it, so the approach is exponential with time constant m/bm/b.

A real case: a steel ball in glycerin. Stokes’ law gives b=6πμrb = 6\pi\mu r when the Reynolds number is below about one. Take r=1r = 1 mm, steel 7800 kg/m37800\ \text{kg/m}^3, glycerin 1260 kg/m31260\ \text{kg/m}^3 and μ=1.4\mu = 1.4 Pa s (all rounded; glycerin’s viscosity is very temperature-sensitive). Then m=3.267×10−5m = 3.267\times 10^{-5} kg and b=0.02639b = 0.02639 kg/s. The driving force is weight minus buoyancy, so vt=2r2(ρs−ρf)g/(9μ)=0.01018v_t = 2r^2(\rho_s - \rho_f)g/(9\mu) = 0.01018 m/s; forgetting buoyancy gives 0.012150.01215 m/s, 19% too high. A balance law must list every force. The time constant is m/b=1.24m/b = 1.24 ms, and ρfvtd/μ=0.018\rho_f v_t d/\mu = 0.018, so the linear-drag assumption was consistent.

Quadratic drag. At high Reynolds number drag comes from pushing fluid aside and scales with v2v^2: F=κv2F = \kappa v^2 with κ=12ρCdA\kappa = \tfrac12\rho C_d A (explained below). The balance is

mv′=mg−κv2[N]=[N]−[N],κ in kg/m.m v' = mg - \kappa v^2 \qquad [\text{N}] = [\text{N}] - [\text{N}], \quad \kappa\ \text{in kg/m} .

Terminal velocity is again v′=0v' = 0: vt=mg/κv_t = \sqrt{mg/\kappa}. The equation is not linear in vv, so the integrating factor does not apply. It is autonomous, the right side depends on vv only, so it is separable, and that is lesson 3.3 Separable Equations‘s tool. In fact it is exactly the equation solved there. Divide by mm and define vt2=mg/κv_t^2 = mg/\kappa:

v′=g−κmv2=g(1−v2vt2),v=vttanh⁡ ⁣(gtvt) from rest.v' = g - \frac{\kappa}{m}v^2 = g\left(1 - \frac{v^2}{v_t^2}\right), \qquad v = v_t\tanh\!\left(\frac{gt}{v_t}\right) \text{ from rest.}

Choosing the tool is a decision. If the unknown appears to the first power, y′+p(t)y=g(t)y' + p(t)y = g(t), use the integrating factor (pp may depend on tt, as the tank’s did). If the right side is a nonlinear function of yy alone, as with v2v^2, separate.

✅ Concept check

Which tool solves $m v' = mg - \kappa v^2$ for $v(t)$, and why?

The RC circuit, and the sameness

A resistor RR and capacitor CC are in series with a source VinV_{in}. Two laws build the equation.

  1. Kirchhoff’s voltage law: the voltages around the loop sum to zero, so Vin=Ri+vV_{in} = Ri + v, where ii is the current and vv the capacitor voltage.
  2. The capacitor law: charge on the plate is q=Cvq = Cv, and current is the rate charge arrives, so i=q′=Cv′i = q' = C v'.

Substituting:

Vin=RC v′+v⟺RC v′+v=Vin⟺v′=1RC (Vin−v).V_{in} = RC\,v' + v \quad\Longleftrightarrow\quad R C\,v' + v = V_{in} \quad\Longleftrightarrow\quad v' = \frac{1}{RC}\,(V_{in} - v) .

Units: ohms times farads is seconds. From v(0)=0v(0) = 0, v=Vin (1−e−t/RC)v = V_{in}\,(1 - e^{-t/RC}).

With R=4.7R = 4.7 kΩ, C=220C = 220 µF, RC=1.034RC = 1.034 s. For a 1212 V source the capacitor reaches 7.597.59 V at t=RCt = RC, 1010 V at RCln⁡6=1.853RC\ln 6 = 1.853 s, and 90% of the way at RCln⁡10=2.381RC\ln 10 = 2.381 s.

Now line up what we have built:

SystemUnknown yyTarget (where it settles)Rate 1/τ1/\tau
Constant-volume tankconcentrationcinc_{in}Q/VQ/V
Cooling mugtemperatureTenvT_{env}k=hA/(mcp)k = hA/(mc_p)
Tracer in a room (last lesson)concentrationceqc_{eq}λ=Q/V\lambda = Q/V
Linear-drag fallspeedmg/bmg/bb/mb/m
RC circuitcapacitor voltageVinV_{in}1/(RC)1/(RC)

Quadratic drag is not in the table: its out term is nonlinear.

◆ Interactive Pick a model, move its parameters, and watch in and out balance

Loading simulation…

At the defaults the tank has cin=4c_{in} = 4 g/L and τ=V/Q=20\tau = V/Q = 20 min; cooling has τ=26.7\tau = 26.7 min; linear drag settles at 2.452.45 m/s with τ=0.25\tau = 0.25 s; quadratic drag at 56.656.6 m/s with local time scale vt/(2g)=2.88v_t/(2g) = 2.88 s; the RC circuit has τ=1.03\tau = 1.03 s. The equilibrium moves only when a parameter in its formula moves; τ\tau sets the speed. The dot marks 63% of the way, reached at t=τt = \tau by the linear models. With the quadratic model, click the left edge of the plot and slide the starting value to 100100 m/s: the out term is 30.630.6 against an in term of 9.819.81, so the speed falls at 20.820.8 m/s2^2 (a parachute opening) onto 56.656.6 m/s.

Compound interest: discrete and continuous

A bank balance BB with annual rate rr is a balance law too: it grows at a rate proportional to what is already there, B′=rBB' = rB, in dollars per year, and rr is per year. The bank, though, updates in steps. If it compounds nn times a year, each step multiplies by 1+r/n1 + r/n:

Bj+1=Bj(1+rn)=Bj+1n (rBj).B_{j+1} = B_j\left(1 + \frac{r}{n}\right) = B_j + \frac1n\,(rB_j) .

That is exactly an explicit Euler step of size h=1/nh = 1/n on B′=rBB' = rB, and continuous compounding is the exact solution B0ertB_0e^{rt}. For a starting balance of 1000 at r=5%r = 5\% over 10 years:

CompoundingBalance after 10 years (from 1000)
annual (h=1h = 1)1628.89
monthly (h=1/12h = 1/12)1647.01
daily (n=365n = 365)1648.66
continuous1648.72

The playground below reproduces the annual, monthly and continuous rows. Steady deposits ss make B′=rB+sB' = rB + s, the linear equation again, with solution (B0+s/r)ert−s/r(B_0 + s/r)e^{rt} - s/r; for s=100s = 100 per year the balance after 10 years is 2946.162946.16. Unlike cooling, the state flees its “equilibrium” −s/r-s/r.

Units and dimensional checks

Every term in an equation must have the same dimensions, and the argument of exp⁡\exp, tanh⁡\tanh or ln⁡\ln must be dimensionless. Suppose a learner, copying the linear-drag force law, writes

v′=g−b v(wrong).v' = g - b\,v \qquad \text{(wrong)} .

Check the units: v′v' and gg are m/s2^2, but bvbv is (kg/s)(m/s) = kg m/s2^2, a force. The equation adds an acceleration to a force; the leftover factor is a kilogram, so it needs b/mb/m. The correct v′=g−(b/m)vv' = g - (b/m)v has every term in m/s2^2.

A numerical test with m=1m = 1 kg would not catch this error, since dividing by one changes nothing; the units catch it at any mass.

Units also constrain the answer before any fluid mechanics. Built from mgmg, ρ\rho and AA, the only combination with units of speed squared is mg/(ρA)mg/(\rho A), so vt=(number)mg/(ρA)v_t = (\text{number})\sqrt{mg/(\rho A)}; experiment supplies the dimensionless number, 2/Cd\sqrt{2/C_d}.

Quadratic drag in a real fluid

✅ Concept check

With the same posture, the skydiver's mass doubles (gear plus a passenger). By what factor does the terminal speed change?

Playing with the numbers

This cell checks the tank solution against RK4 and runs the compounding-as-Euler loop. Edit the flow rates and watch the approach to cinc_{in} change.

🐍 PythonPlayground: variable-volume tank vs the formula, and interest as Euler
⌘/Ctrl + Enter

RK4 and the formula differ by 2.6×10−92.6\times 10^{-9}, 2.8×10−82.8\times 10^{-8} and 2.1×10−72.1\times 10^{-7} g at t=25t = 25, 5050, 100100; the concentrations are 41.11141.111, 46.25046.250, 48.88948.889 g/L. The Euler loop prints 1628.891628.89 and 1647.011647.01 against 1648.721648.72.

Exercise: build the models

🧪 Coding exerciseExercise: tank balance, RK4, terminal speed, RC time
⌘/Ctrl + Enter

The exact tank answer 410/7=58.571410/7 = 58.571 g comes from the integrating factor μ=50+2t\mu = 50 + 2t; verify it by hand.

Problems

✏️ Pen & paperA draining tank●●○

A tank holds 500500 L of pure water. Brine at 22 g/L flows in at 44 L/min, and the stirred mixture leaves at 1010 L/min, so the tank is draining. (a) Write the volume V(t)V(t) and the salt equation for m(t)m(t), with units. (b) Solve it. (c) Find the salt mass and concentration when the volume has dropped to 200200 L, and say what happens to the concentration as the tank empties.

Show worked solution

(a) V=500−6tV = 500 - 6t L, empty at t=83.3t = 83.3 min. The balance is m′=8−10 m/(500−6t)m' = 8 - 10\,m/(500 - 6t), in g/min.

(b) ∫10500−6t dt=−53ln⁡(500−6t)\int \dfrac{10}{500 - 6t}\,dt = -\dfrac{5}{3}\ln(500 - 6t), so μ=(500−6t)−5/3\mu = (500 - 6t)^{-5/3}. Then (μm)′=8(500−6t)−5/3(\mu m)' = 8(500 - 6t)^{-5/3}. Since ddt(500−6t)−2/3=4 (500−6t)−5/3\dfrac{d}{dt}(500 - 6t)^{-2/3} = 4\,(500 - 6t)^{-5/3}, we get μm=2(500−6t)−2/3+C\mu m = 2(500 - 6t)^{-2/3} + C, hence

m=2V+C V5/3,m(0)=0⇒C=−10005005/3,m=2V−1000(V500)5/3.m = 2V + C\,V^{5/3}, \qquad m(0) = 0 \Rightarrow C = -\frac{1000}{500^{5/3}}, \qquad m = 2V - 1000\left(\frac{V}{500}\right)^{5/3} .

(c) At V=200V = 200 (t=50t = 50 min): m=400−1000(0.4)5/3=400−217.15=182.85m = 400 - 1000(0.4)^{5/3} = 400 - 217.15 = 182.85 g, so c=182.85/200=0.9142c = 182.85/200 = 0.9142 g/L. Check with RK4: 182.8466182.8466 g. As V→0V \to 0, m/V=2−1000 V2/3/5005/3→2m/V = 2 - 1000\,V^{2/3}/500^{5/3} \to 2 g/L: the last of the tank is nearly all newly arrived brine.

✏️ Pen & paperWhich time constant, and what a unit check cannot see●●○

An RC circuit has RR in ohms (volts per ampere) and CC in farads (coulombs per volt, i.e. ampere-seconds per volt). (a) Using only these units, decide which of RCRC, R/CR/C and C/RC/R can be a time constant. (b) For R=10 kΩR = 10\ \text{k}\Omega and C=47 μFC = 47\ \mu\text{F}, how long does a charging step take to come within 1%1\% of its final value? (c) A student types C = 47 instead of C = 47e-6. What does the code now report, and why did a unit check on the formula not warn them?

Show worked solution

(a) RCRC has units VA⋅A sV=s\dfrac{\text{V}}{\text{A}}\cdot\dfrac{\text{A s}}{\text{V}} = \text{s}. The other two do not reduce to seconds: R/CR/C has units V2/(A2 s)\text{V}^2/(\text{A}^2\,\text{s}) and C/RC/R is its reciprocal. Only RCRC is a time.

(b) The charging step is v=V (1−e−t/RC)v = V\,(1 - e^{-t/RC}), so within 1%1\% of final means e−t/RC=0.01e^{-t/RC} = 0.01, i.e. t=RCln⁡100t = RC\ln 100. Here RC=(104)(47×10−6)=0.47RC = (10^4)(47\times10^{-6}) = 0.47 s, so t=0.47×4.605=2.16t = 0.47 \times 4.605 = 2.16 s.

(c) With C=47C = 47 the code computes RC=4.7×105RC = 4.7\times10^{5} s, about 5.45.4 days, not 0.470.47 s: a factor of 10610^6. The formula τ=RC\tau = RC is dimensionally fine for any numbers, so the equation passes; the error is in the values (microfarads entered as farads). Store quantities in SI base units, and sanity-check the order of magnitude of every answer.

✏️ Pen & paperA probe in a rising oven temperature●●●

A temperature probe obeys T′=k (Tenv(t)−T)T' = k\,(T_{env}(t) - T) with k=0.04 min−1k = 0.04\ \text{min}^{-1}. Starting at T(0)=20∘T(0) = 20^\circC, it is put into an oven whose temperature rises as Tenv=20+2tT_{env} = 20 + 2t (in ∘^\circC, tt in minutes). (a) Solve for T(t)T(t). (b) Once the transient fades, how many degrees and how many minutes does the probe lag the oven? (c) What are TT and the lag at t=60t = 60 min?

Show worked solution

(a) Write T′+kT=k(20+2t)T' + kT = k(20 + 2t). With μ=ekt\mu = e^{kt}: (ektT)′=k(20+2t)ekt(e^{kt}T)' = k(20 + 2t)e^{kt}. Integrating by parts, ∫k(20+2t)ektdt=(20+2t)ekt−2kekt+C\int k(20+2t)e^{kt}dt = (20 + 2t)e^{kt} - \dfrac{2}{k}e^{kt} + C, so T=20+2t−2k+Ce−ktT = 20 + 2t - \dfrac{2}{k} + Ce^{-kt}. With 2/k=502/k = 50 and T(0)=20T(0) = 20: C=50C = 50, and

T=20+2t−50+50e−0.04t=(20+2t)−50(1−e−0.04t).T = 20 + 2t - 50 + 50e^{-0.04t} = (20 + 2t) - 50\left(1 - e^{-0.04t}\right) .

(b) The gap Tenv−T=50(1−e−kt)T_{env} - T = 50(1 - e^{-kt}) tends to r/k=50∘r/k = 50^\circC, a delay of 1/k=251/k = 25 min: Tenv(t−25)=20+2t−50T_{env}(t - 25) = 20 + 2t - 50.

(c) T(60)=140−50(1−e−2.4)=94.54∘T(60) = 140 - 50(1 - e^{-2.4}) = 94.54^\circC (RK4 gives 94.535994.5359) against an oven at 140∘140^\circC: a lag of 45.46∘45.46^\circC, still short of 50∘50^\circC.

Where this goes

3.8 Autonomous Equations, Equilibria & Stability explains why vtv_t is stable (the out term rises faster than the in term), and 3.6 Exact Equations & Substitutions extends the equations you can solve exactly.

Key Takeaways

  • A balance law is y′=in−outy' = \text{in} - \text{out}. Write the units of each term first: all must be [units of yy] per time.
  • In a mixing tank with changing volume, use mass as the unknown; converting to concentration adds a V′cV'c dilution term, giving c′=(Qin/V)(cin−c)c' = (Q_{in}/V)(c_{in} - c) with a rate that falls as the tank fills.
  • Newton’s cooling T′=k(Tenv−T)T' = k(T_{env} - T) fails for non-uniform objects, changing convection, radiation and evaporation; a straight line of ln⁡(T−Tenv)\ln(T - T_{env}) against tt is the test.
  • Terminal velocity comes from v′=0v' = 0: mg/bmg/b for linear drag, 2mg/(ρCdA)\sqrt{2mg/(\rho C_dA)} for quadratic. It is stable: above it the out term wins, below it the in term wins.
  • Tool choice: linear in the unknown means integrating factor; a nonlinear function of the unknown alone means separation.
  • The tank, mug, tracer room, linear drag and RC circuit are all y′=(ytarget−y)/τy' = (y_{target} - y)/\tau: target from what pushes, τ\tau from how much there is to move.
  • Compound interest is explicit Euler with h=1/nh = 1/n on B′=rBB' = rB.
  • A dimensional check catches v′=g−bvv' = g - bv at any mass, but not missing dimensionless factors; follow it with limits and a numerical run.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.