Engineering Math - Differential Equation

 

 

 

Interest Model

 

A savings account is one of the simplest places where a differential equation appears outside physics. The balance grows by interest, which depends on the balance itself, and by the deposits you add. This gives a first order linear equation. Let's build it, solve it, and then add the expense term that the model leaves out.

What is the governing equation for a savings account ?

Let's assume that I want to model how much money I would have in my account in each period. Following equation describes how the money in your account changes over time

 

Governing law for the savings account giving dy/dt = r y + d

 

The left-hand side of the equation, dy/dt, represents the rate of change of the money in your account with respect to time. The right-hand side of the equation, ry + d, represents the sources of this change.

The first term, r * y, represents the amount of interest earned on your savings. The interest rate is multiplied by the amount of money in your account at each point in time, which gives you the amount of interest earned in that period. This implies that if you have more money in your account now, you will earn more money as interest which in turn will increase the amount of the money in your account.

The second term, d, represents the amount of money you deposit or save in each period. This increases the amount of money in your account and contributes to the rate of change of your savings. This is also intuitive. The more money you deposit, you will get more money in your account.

Overall, the equation captures how your savings grow over time with the combination of interest earned on the current balance and the additional savings you make each period. The solution to this differential equation would give you the function that describes the amount of money in your account as a function of time.

NOTE : You would notice that in this model you have only those factors increasing the money in your account. No factors descreasing the money in your account like expense. You may add those factors which would decrease the money in your account to make the model more realistic.

One arrow in the governing law diagram needs a correction. The arrow from "Decreasing Amount" points to "Savings that is deposited in each period". A deposit increases the money, and the final equation adds it as +d. So d belongs to the Increasing Amount together with the interest ry, and the Decreasing Amount of this model is zero.

  • The interest term is proportional to the balance : ry grows as y grows. This feedback is what makes the balance grow exponentially.
  • The deposit term is constant : d does not depend on y, so it adds the same amount per unit time whatever the balance is.
  • The equation is first order and linear : dy/dt = ry + d has one unknown function and no product of y with itself, so it has a closed form solution.

How much money is in the account after t years ?

The equation dy/dt = ry + d looks like the mixing problem, but with a plus sign on ry. So the balance moves away from its equilibrium instead of settling to it. Let's solve it and put in some numbers.

With the initial balance y(0) = y0, the solution is y(t) = (y0 + d/r) ert - d/r. You can check it by differentiation. The derivative is r(y0 + d/r) ert, and this equals r y + d. The constant -d/r is the balance at which ry + d = 0. For a positive d it is negative, so a real account never reaches it.

Take y0 = 1000, r = 0.05 per year and d = 1200 per year, with t in years. Then y(t) = 25000 e0.05t - 24000. After 10 years the balance is 25000 e0.5 - 24000 = 17218. The deposits alone add up to 1000 + 10 x 1200 = 13000, so interest has added about 4218. After 20 years the balance is 43957 against 25000 of deposits, because the interest also earns interest.

Keep one thing in mind when you compare this with a bank statement. The model adds interest continuously. A rate r = 0.05 in the model gives e0.05 = 1.0513 per year, which is the same as 5.13 % paid once a year.

  • The solution has two parts : (y0 + d/r) ert grows exponentially, and -d/r is a constant shift set by the deposit.
  • Interest earns interest : In the example, interest adds 4218 in the first 10 years and much more in the next 10 years.
  • r in the model is a continuous rate : A continuous rate r corresponds to an annual rate of er - 1, which is slightly larger than r.

What happens when expenses are added ?

The NOTE at the end of the first section suggests adding factors that decrease the money. Let's add a constant expense c per unit time and see what changes. The equation becomes dy/dt = ry + d - c.

The equation keeps the same form, with d replaced by d - c. When c is larger than d, the right side is zero at y* = (c - d)/r, and this equilibrium is now positive. It is unstable. A balance above y* earns more interest than the net expense, so it grows. A balance below y* loses more than it earns, so it falls faster and faster until the account is empty.

Take r = 0.05 per year, no deposit and c = 1200 per year. Then y* = 1200/0.05 = 24000. An account that starts with 30000 is above y*, and it grows to about 33892 after 10 years even though 1200 is spent every year. An account that starts with 10000 is below y*, and y(t) = 24000 - 14000 e0.05t. It is empty when e0.05t = 24000/14000, that is at t = 20 ln(1.714), or about 10.8 years. Without interest, the same 10000 would last 10000/1200 = 8.3 years.

  • An expense turns the equilibrium positive : With c > d, the balance y* = (c - d)/r separates growth from depletion.
  • The equilibrium is unstable : A balance slightly above y* grows, and a balance slightly below y* falls to zero. This is the opposite of the mixing tank, where the equilibrium attracts the solution.
  • Interest delays the depletion : In the example, interest stretches 8.3 years of spending to about 10.8 years.