Learn
Lesson · First-Order Linear Equations · Forcing

Circuits, Tanks and Loans

A capacitor charging through a resistor, salt flowing through a well-mixed tank and a balance growing with interest while it is paid down are the same equation with different letters. In each, the steady state is b/a, and the sign of a decides whether it attracts or repels. The loan has a negative a, which is why the naive payoff time of balance divided by payment is wrong.

rate of change = gain − loss collect: y′ + a·y = b, steady state b/a capacitor, tank: a > 0, steady state pulls loan: interest is a gain, a < 0, it repels payoff: closed form = 0, then take ln
Three situations, one equation

Core ideas

What this lesson establishes

Three ideas: how a situation is turned into the equation, what the steady state means in each, and why the loan behaves differently.

1

Write the rate as what comes in minus what goes out

Each equation starts as a sentence: the rate of change of the unknown is a gain minus a loss. A tank gains salt at a fixed rate and loses it in proportion to how much is there. A loan gains interest in proportion to the balance and loses a fixed payment. Collect the terms in y on the left and the equation is y′ + a·y = b, with a taking its sign from what is on the right.

2

The steady state is where gain equals loss

At y = b/a the rate is zero: the tank loses salt exactly as fast as it gains it, the capacitor draws no current, and the balance grows by interest exactly as fast as the payment removes it. The steady state is the particular solution for a constant forcing, from “Homogeneous Plus Particular”.

3

A negative a turns the steady state around

For the tank and the capacitor, loss is in proportion to the unknown and a is positive, so every solution is pulled toward the steady state. For the loan the proportional term is a gain, so a is negative, and the steady state is where the balance stalls: start below it and the balance falls, start above it and the balance grows for ever.

The material

Three situations, one equation, one question each

The three models with their numbers, the steady state in each, the loan in detail and the payoff time it gives, and the naive answer it corrects.

All three situations on this page have the same skeleton. There is an unknown quantity, a constant source and a loss or gain proportional to the unknown. Once the equation is written as y′ + a·y = b the solution and its steady state follow from “Constant Coefficients and the Steady State” with no new idea.

situation unknown a b steady state b/a capacitor q 2 5 5/2 tank y 1/20 10 200 loan B −1/20 −6 120

The capacitor

A capacitor with capacitance C is charged through a resistor R from a source of voltage V. The charge q satisfies R·q′ + q/C = V. With R = 1, C = 1/2 and V = 5 in consistent units, dividing by R gives q′ + 2q = 5. The steady state is C·V = 5/2, the charge at which the capacitor's voltage equals the source's. From an empty capacitor the charge approaches 5/2 and is below it at every finite time.

The tank

A tank holds 20 litres of well-mixed brine. Brine at 10 units of salt per litre flows in at one litre per minute, and the mixture flows out at the same rate. The salt y gains 10 per minute and loses y/20 per minute, since a twentieth of the tank leaves each minute. So y′ = 10 − y/20, which is y′ + y/20 = 10. The steady state is 200, the inflow concentration times the volume.

The loan

A balance of 100 earns interest at 5% a year, charged continuously, and is repaid at 6 a year. The balance gains B/20 and loses 6, so B′ = B/20 − 6. Moving the B term to the left changes its sign: B′ − B/20 = −6, so a = −1/20 and b = −6. The steady state is b/a = (−6)/(−1/20) = 120.

That number has a meaning. At a balance of 120 the interest is 120/20 = 6 a year, exactly the payment, so the balance neither falls nor grows. It is a knife edge, not a destination: a < 0 makes it repelling. The loan starts at 100, below it, so the gap is −20 and grows.

B = 120 + (100 − 120)·e^(t/20) B = 120 − 20·e^(t/20) B = 0: e^(t/20) = 6 t = 20·ln 6 ≈ 35.8352 years

The payoff time is where the balance is zero. It needs a natural logarithm, ln 6 ≈ 1.79176, which is irrational, so the figure ≈ 35.8352 is rounded. The lab does not print a payoff time; it prints the closed form, and the number is yours to compute from it. You can check the sign change in the lab's Euler view with a step of one year and at least 36 steps: the rounded closed-form column falls through zero between year 35 and year 36.

Compare the naive estimate. A balance of 100 repaid at 6 a year would take 100/6 ≈ 16.6667 years if no interest were charged. At year 17 the closed form gives 120 − 20·e^(17/20) ≈ 73.2071, rounded: more than seventy are still owed. The real payoff is more than twice as long, because the balance gains interest all the way down.

Example · The same loan starting just above the steady state

Start the same loan at B(0) = 130 instead. The gap to 120 is +10, so B = 120 + 10·e^(t/20), and the balance grows without limit: the interest on 130 is 6.5 a year and the payment is only 6.

The knife edge is exactly B = 120. A payment of 6 a year pays off a loan of 100 but not a loan of 130, and the equation says so at once through the sign of the gap.

Interactive

First-order linear equations

μ, y_h, y_p and the constant, exactly

A first-order linear equationy′ + p(t)·y = q(t), solved symbolically
solutiony_py_hEuler's steps (exact)

Method

From a situation to a steady state

Name the unknown, write gain and loss, collect into standard form with the signs checked, and read the steady state before solving.

1

Name the unknown and the rate

A charge, an amount of salt or a balance, and its rate of change per unit of time. Fix the unit of time once.

2

Write the rate as gain minus loss

y′ = (what comes in) − (what goes out). A flow in proportion to the unknown carries the unknown; a fixed flow does not.

3

Collect into y′ + a·y = b

Move every term in y to the left and change its sign as it crosses. A proportional gain, like interest, becomes a negative a.

4

Read the steady state b/a and its direction

a > 0 attracts and a < 0 repels. Say what the number means in the situation: a charge, an amount of salt, a balance.

5

Solve, then answer the question asked

Write y = b/a + (y₀ − b/a)·e^(−a·t). For a payoff, set it to zero and take a logarithm; the answer is irrational and printed rounded.

Models, steady states and payoffs

Score 0 / 0

How long a loan of 100 takes at 5% with 6 paid a year

The balance gains B/20 a year in interest and loses 6 in payments. The equation is written, the steady state read, and the balance set to zero.

B′ = B/20 − 6, B(0) = 100 B′ − B/20 = −6: a = −1/20, b = −6 steady state: B* = b/a = 120 (repelling) gap at the start: 100 − 120 = −20 B = 120 − 20·e^(t/20) B = 0: e^(t/20) = 6 t = 20·ln 6 ≈ 35.8352 years naive estimate: 100/6 ≈ 16.6667 years

The payoff time is more than twice the naive estimate. The naive estimate assumes each payment of 6 takes 6 off the balance. It does not: interest of about 5 a year on a balance near 100 puts most of that back, so the balance falls by only about 1 a year at first.

For a rehearsal, run the tank. Write y′ = 10 − y/20, collect it to y′ + y/20 = 10, read the steady state before the lab does, and check that it is 200 and attracting.

Common mistakes

1
Taking 100/6 as the payoff timeA balance of 100 repaid at 6 a year is not paid off in 100/6 ≈ 16.6667 years. At year 17 the closed form still gives ≈ 73.2071, rounded, and the balance reaches zero only at 20·ln 6 ≈ 35.8352 years. The estimate ignores the interest that is charged on the way down.
2
Reading the steady state of a loan as where the balance ends upThe steady state 120 repels, because a = −1/20. Starting at 100 the balance moves away from 120, downward, and through zero; starting at 130 it moves away upward. A solution settles at the steady state only when a is positive, as for the tank and the capacitor.
3
Moving the interest term without changing its signFrom B′ = B/20 − 6 the slip gives B′ + B/20 = −6, so a = +1/20 and the steady state −120, attracting. That is a different loan: from 100 its balance is −120 + 220·e^(−t/20), which falls through zero at 20·ln(11/6) ≈ 12.1227 years, sooner than even the no-interest estimate, and then keeps falling toward −120. Interest cannot clear a loan faster than paying with no interest at all, and that impossibility is the sign that a term crossed the equals sign with its sign unchanged. Collecting the terms carefully gives B′ − B/20 = −6.

Check your understanding

✓
Finish when you can write a charging capacitor, a flowing tank or a loan as y′ + a·y = b, name the steady state, and find a payoff time.

You should be able to write the rate as gain minus loss, collect it into standard form with the signs checked, read the steady state b/a and say whether it attracts or repels, write the closed form, and find when a loan balance reaches zero by setting the closed form to zero, giving the answer rounded.

Note: The steady state in these models is the particular solution for a constant forcing. What the models do not show is how the equation behaves when it is solved by a computer, one step at a time. The last lesson of the course returns to Euler’s method on the simplest decay, where the step size alone decides whether the answer follows the curve or leaves it.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.