Present worth factor of a uniform yearly amount
The present value of a saving
A site borrows at 12 percent a year to fit equipment that “pays back in three years”, and the loan is still not cleared in the fourth year. Nobody made an error in arithmetic: the payback counted a saving in year three as if it arrived today, and the bank did not. The same blind spot makes a project that earns for fifteen years look no better than one that earns for four. This lesson gives money a date. You will discount future savings to today’s value and calculate net present value, internal rate of return and discounted payback for a pump drive and a capacitor bank. #EnergyEconomics #NetPresentValue #InternalRateOfReturn
By the end of this lesson, you will be able to:
The variable speed drive for the booster pump costs 95,000 currency units, installed. It is expected to save 31,800 a year at today’s energy price, and it needs 2,000 a year of extra maintenance. The simple payback is about three years. The drive should last 10 years.
The site manager does not have 95,000 idle. The money must be borrowed, or taken from another use that also earns something. Here that cost of money is 12 percent a year, an example: each organisation has its own figure. Ask the finance office for the rate it uses to judge projects (often called the hurdle rate); it is usually above the loan rate, because it also allows for risk. The question is no longer “when does the money come back?” but “after paying 12 percent a year for the money, is anything left, and how much?”
The second proposal, a capacitor bank that removes a demand charge and a surcharge, costs 450,000 and saves 172,880 a month. It will need new capacitors in year 7 for 120,000. The manager wants one method that handles both: a steady saving and a cost that arrives late.
Put 100 currency units in an account that pays 12 percent a year, and after one year you hold 112. So 100 today equals 112 in one year, and 100 received in one year is worth less than 100 today. The same holds if you borrow: a unit received sooner repays the loan sooner and saves interest.
This is not inflation, which is treated later in this section. Even with stable prices, money that arrives earlier can be put to work earlier.
Let
This is compounding. Discounting is the same relation read backwards. The present value of an amount
The term
At 12 percent, a saving in year 10 counts for less than a third of its face value, so the late years of a long project add less than a simple sum suggests, but they still add something.
Many energy projects save about the same amount
Present worth factor of a uniform yearly amount
The present value of a saving
Two checks help you trust it. With
Let
Net present value
A positive NPV means the project repays its cost, pays the cost of money at rate
A positive NPV at your discount rate means the project is worth more than it costs. Between two projects that exclude each other, the larger NPV adds more value. NPV counts the whole life, the timing of every cash flow and any late cost: all that simple payback ignores.
Discounted payback is the time at which the cumulative discounted cash flow first becomes positive. It is always longer than simple payback, because each saving counts for less. For a part of a year, interpolate in a straight line inside the year of the crossing: an approximation, because discounting is not linear within a year.
Discounted payback still ignores everything after the crossing. Use it as a measure of how long the money is at risk, and use NPV for the decision.
The NPV falls as the discount rate rises, because later savings count for less. The rate at which it reaches zero is the internal rate of return, IRR.
The IRR is the highest cost of money at which the project still does not lose. If the IRR is above your discount rate, the NPV is positive, and the two tests agree.
For more than two cash flows there is no formula for the IRR. It is found numerically: write the NPV as a function of brentq from SciPy) narrow the interval until the NPV is zero.
Some cash-flow patterns, with costs that return after savings have begun (a large replacement or a clean-up cost late in life), can have more than one IRR, and then NPV is the test to rely on.
If the energy price rises by a fraction
A price rise is a forecast. Report the result with it and without it, and do not let a project depend on it.
A nominal rate includes inflation: it is the rate a bank quotes. A real rate has inflation removed. They are linked by
Use one kind throughout a calculation:
Both give the same NPV when done consistently. Mixing them makes a good project look poor. For the drive below, the net saving of 29,800 in today’s prices at a real 12 percent gives an NPV of 73,377; the same savings inflated by 5 percent a year and discounted at the nominal 17.6 percent give 73,377 again; today’s prices discounted at 17.6 percent give only 40,850.
In this course
Net saving each year.
Present worth factor. With
Ten years of saving count as 5.65 years’ worth today. ✅
Present value of the net savings.
The savings are worth 168,377 today, against 298,000 as a simple sum. ✅
Net present value.
After repaying the cost and paying 12 percent a year for the money, the drive leaves a surplus of 73,377 in today’s currency units. ✅
Build the table. Each year’s net saving is multiplied by its discount factor
| Year | Net saving | Discount factor | Present value | Cumulative |
|---|---|---|---|---|
| 1 | 29,800 | 0.8929 | 26,607 | -68,393 |
| 2 | 29,800 | 0.7972 | 23,756 | -44,636 |
| 3 | 29,800 | 0.7118 | 21,211 | -23,425 |
| 4 | 29,800 | 0.6355 | 18,938 | -4,487 |
| 5 | 29,800 | 0.5674 | 16,909 | 12,422 |
| 6 | 29,800 | 0.5066 | 15,098 | 27,520 |
| 7 | 29,800 | 0.4523 | 13,480 | 41,000 |
| 8 | 29,800 | 0.4039 | 12,036 | 53,036 |
| 9 | 29,800 | 0.3606 | 10,746 | 63,782 |
| 10 | 29,800 | 0.3220 | 9,595 | 73,377 |
Check the NPV. The last cumulative value is 73,377, the same as Step 1 by the factor. ✅
Simple payback.
Discounted payback. The cumulative value turns positive in year 5. At the end of year 4 it is
The discounted payback is in year 5, about 4.27 years by straight-line interpolation. ✅
Check it before anyone signs. Two quick tests catch most errors in an NPV sheet. At a rate of 0 the NPV must equal the simple sum: 10 years of 29,800 less 95,000, which is 203,000. At the IRR it must be 0. Also watch the spreadsheet function NPV(rate, range): it treats the first cell of the range as year 1. Put the year 0 cost inside the range and every flow is discounted one year too many: the result is
State the condition. The IRR is the rate at which
Bracket it by hand. At 28 percent,
Solve numerically. brentq is given the NPV function and the interval from 0.1 to 2,000 percent, and returns
The drive would still not lose money if the site paid up to 28.9 percent a year for the capital. ✅
Net saving each year. The saving is
Net present value. Discount each year at 12 percent and add.
The rising price adds 36,353 to the NPV. ✅
Check with the closed form. The present value of the rising savings is
The maintenance is worth
Internal rate of return. Solved in the same way,
Paybacks. The simple payback is 3.02 years. The cumulative discounted value is
| Project A at 12 percent | Case (a), constant price | Case (b), price rises 5 percent a year |
|---|---|---|
| NPV | 73,377 | 109,730 |
| IRR | 28.9 percent | 33.8 percent |
| Simple payback | 3.19 years | 3.02 years |
| Discounted payback | 4.27 years | 3.90 years |
Recalculate the NPV at each rate. Only
| Discount rate | NPV, case (a) | NPV, case (b) |
|---|---|---|
| 6 percent | 124,331 | 177,859 |
| 8 percent | 104,960 | 151,817 |
| 10 percent | 88,108 | 129,297 |
| 12 percent | 73,377 | 109,730 |
| 14 percent | 60,440 | 92,652 |
| 16 percent | 49,030 | 77,679 |
| 18 percent | 38,924 | 64,497 |
| 20 percent | 29,936 | 52,843 |
Read the table. The NPV in case (a) falls from 124,331 at 6 percent to 29,936 at 20 percent. It is positive at every rate in the range, so the decision does not depend on the exact rate. ✅
Where the NPV is zero. At higher rates the NPV reaches zero at 28.9 percent in case (a) and 33.8 percent in case (b): the IRRs of Steps 3 and 4, found from the other side. ✅
Present worth factor for 12 years.
✅
Present value of the savings.
Present value of the replacement. It is a single amount in year 7.
A cost of 120,000 seven years away counts as 54,282 today. ✅
Net present value.
The NPV is about 12.3 million currency units, more than 27 times the cost. ✅
Internal rate of return. brentq on the NPV function gives
Check the IRR. When the saving is large and the life is long, later years add almost nothing at such a rate, and the IRR is close to
Discounted payback from yearly cash flows. The first year’s saving has a present value of
Discounted payback from monthly bills. The saving really arrives every month. With a monthly rate of
No refined analysis. The bank pays back in months. No reasonable discount rate, life or replacement cost changes the decision. The year 7 replacement, which looked like a complication, removes 0.4 percent of the NPV. ✅
Proof of the saving. The whole result rests on the tariff: a demand charge per kVA and a surcharge for low power factor. The bank saves almost no kWh. If the utility changes its charges, or the site’s peak moves to another time, the saving changes although the bank works as designed. ✅
What to check. Compare the maximum demand in kVA and the power factor on the bills before and after, and confirm that the surcharge line has gone. Three bills are enough to see it. ✅
The script defines the present worth factor, the NPV, the IRR (with brentq) and the payback, then applies them to project A in both cases and to project B. It prints the year-by-year table and the sensitivity table, and plots the NPV of project A against the discount rate.
"""NPV, IRR and discounted payback of a pump drive and a power factor bank."""import numpy as npfrom scipy.optimize import brentqimport matplotlib.pyplot as plt
RATE = 0.12 # discount rate, an example
def pw_factor(i, n): """Present worth factor of a uniform yearly amount, P/A.""" return ((1 + i) ** n - 1) / (i * (1 + i) ** n)
def npv(i, cost, flows): """Net present value. flows[0] is the cash flow of year 1.""" years = np.arange(1, len(flows) + 1) return -cost + np.sum(np.asarray(flows) / (1 + i) ** years)
def irr(cost, flows, low=0.001, high=20.0): """The rate at which the NPV is zero, found by Brent's method.""" return brentq(npv, low, high, args=(cost, flows))
def payback(cost, flows, i=0.0): """Payback in years; discounted when i > 0. Linear inside the year.""" total = -cost for year, flow in enumerate(flows, start=1): pv = flow / (1 + i) ** year if total + pv >= 0.0: return year - 1 + (-total) / pv total += pv return float("nan")
def report(name, cost, flows): print(f"{name}") print(f" NPV at {100 * RATE:.0f} %: {npv(RATE, cost, flows):,.0f}") print(f" IRR: {100 * irr(cost, flows):.1f} %") print(f" simple payback: {payback(cost, flows):.2f} y, " f"discounted payback: {payback(cost, flows, RATE):.2f} y")
# ---------- Project A: drive on the booster pump ----------COST_A, SAVE_A, UPKEEP, LIFE_A, RISE = 95_000, 31_800, 2_000, 10, 0.05n = np.arange(1, LIFE_A + 1)flows_a = np.full(LIFE_A, SAVE_A - UPKEEP, dtype=float)flows_b = SAVE_A * (1 + RISE) ** (n - 1) - UPKEEP
print(f"P/A at 12 % for 10 years: {pw_factor(RATE, LIFE_A):.4f}")print(f" check, 29,800 x P/A - 95,000 = " f"{29_800 * pw_factor(RATE, LIFE_A) - COST_A:,.0f}")report("Project A, case (a): constant price", COST_A, flows_a)print(" year net flow factor present value cumulative")total = -COST_Afor year, flow in zip(n, flows_a): factor = 1 / (1 + RATE) ** year total += flow * factor print(f" {year:4d} {flow:10,.0f} {factor:8.4f} {flow * factor:15,.0f} " f"{total:12,.0f}")report("Project A, case (b): price rises 5 % a year", COST_A, flows_b)
# ---------- Project B: power factor correction bank ----------COST_B, LIFE_B = 450_000, 12flows_pf = np.full(LIFE_B, 172_880 * 12, dtype=float)flows_pf[7 - 1] -= 120_000 # capacitors replaced in year 7report("Project B: bank, capacitors replaced in year 7", COST_B, flows_pf)print(f" present value of the year 7 replacement: " f"{120_000 / (1 + RATE) ** 7:,.0f}")monthly_rate = (1 + RATE) ** (1 / 12) - 1months = payback(COST_B, np.full(12, 172_880.0), monthly_rate)print(f" discounted payback from monthly bills: {months:.2f} months")
# ---------- Sensitivity of project A to the discount rate ----------print("Project A, NPV against discount rate")print(" rate % case (a) case (b)")for pct in range(6, 21, 2): print(f" {pct:6d} {npv(pct / 100, COST_A, flows_a):10,.0f} " f"{npv(pct / 100, COST_A, flows_b):10,.0f}")for label, flows in (("a", flows_a), ("b", flows_b)): r = irr(COST_A, flows) print(f" case ({label}): NPV is zero at {100 * r:.1f} %")
# ---------- Real and nominal rates ----------print(f"Real 12 % with inflation 5 % is nominal " f"{100 * (1.12 * 1.05 - 1):.1f} %")
# ---------- Plot ----------rates = np.linspace(0.02, 0.45, 200)fig, ax = plt.subplots(figsize=(8, 4.5))ax.plot(100 * rates, [npv(r, COST_A, flows_a) for r in rates], label="case (a): constant price")ax.plot(100 * rates, [npv(r, COST_A, flows_b) for r in rates], "--", label="case (b): price rises 5 % a year")ax.axhline(0.0, color="gray", linewidth=0.8)ax.set_xlabel("discount rate (%)")ax.set_ylabel("NPV of project A (currency units)")ax.set_title("NPV falls as the discount rate rises; it is zero at the IRR")ax.legend()fig.tight_layout()fig.savefig("npv_irr_projects.png", dpi=120)print("Saved npv_irr_projects.png")Expected output
P/A at 12 % for 10 years: 5.6502 check, 29,800 x P/A - 95,000 = 73,377Project A, case (a): constant price NPV at 12 %: 73,377 IRR: 28.9 % simple payback: 3.19 y, discounted payback: 4.27 y year net flow factor present value cumulative 1 29,800 0.8929 26,607 -68,393 2 29,800 0.7972 23,756 -44,636 3 29,800 0.7118 21,211 -23,425 4 29,800 0.6355 18,938 -4,487 5 29,800 0.5674 16,909 12,422 6 29,800 0.5066 15,098 27,520 7 29,800 0.4523 13,480 41,000 8 29,800 0.4039 12,036 53,036 9 29,800 0.3606 10,746 63,782 10 29,800 0.3220 9,595 73,377Project A, case (b): price rises 5 % a year NPV at 12 %: 109,730 IRR: 33.8 % simple payback: 3.02 y, discounted payback: 3.90 yProject B: bank, capacitors replaced in year 7 NPV at 12 %: 12,346,319 IRR: 461.0 % simple payback: 0.22 y, discounted payback: 0.24 y present value of the year 7 replacement: 54,282 discounted payback from monthly bills: 2.65 monthsProject A, NPV against discount rate rate % case (a) case (b) 6 124,331 177,859 8 104,960 151,817 10 88,108 129,297 12 73,377 109,730 14 60,440 92,652 16 49,030 77,679 18 38,924 64,497 20 29,936 52,843 case (a): NPV is zero at 28.9 % case (b): NPV is zero at 33.8 %Real 12 % with inflation 5 % is nominal 17.6 %Saved npv_irr_projects.pngIn the plot both curves fall as the rate rises and cross zero at their IRR.
1. Find the present value of 50,000 currency units received in 5 years, at a discount rate of 10 percent.
2. Find the present worth factor for 15 years at 8 percent, and the present value of a saving of 12,000 a year over that time.
3. A heat recovery unit costs 200,000 and saves 45,000 a year for 8 years. Find the NPV at 12 percent.
4. For the project of exercise 3, find the simple payback and the discounted payback at 12 percent.
Simple payback:
5. Find the IRR of the project of exercise 3. Bracket it between two whole-percent rates first.
At 15 percent the NPV is
6. A project costs 120,000. It saves 30,000 in the first year, and the energy price rises 4 percent a year. The life is 6 years and the discount rate is 10 percent. Find the NPV with and without the price rise. Then give the nominal rate that matches a real rate of 10 percent when inflation is 6 percent.
Without the rise:
A project costs 95,000 currency units today and saves 29,800 net in each of the next 10 years. The discount rate rises from 12 percent to 20 percent, and nothing else changes. What happens to the net present value?
Amounts are in currency units, and the chart is scaled in thousands. The cost is paid at year 0 and each saving arrives at the end of its year. The faint bar of a year is its net saving: the saving minus the maintenance. The strong bar inside it is the same amount divided by (1 + i)ⁿ. The line adds the strong bars to the cost, year by year. It ends at the NPV, and the gold mark shows where it crosses zero, which is the discounted payback. The energy price rise is applied to the saving only. The maintenance stays constant, as in the lesson. The IRR is found by bisection: the rate is narrowed between a low and a high value until the NPV is zero. Which case the numbers show: the first button is project A of this lesson, case (a), and the second is case (b). The third button keeps everything and ends the life after year 4. The discount rate is an example.
Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.
1. The drive saves 29,800 currency units net in each of 10 years. The discount rate is 12 percent. What are these savings worth today?
2. Only one of two projects can be done. The drive costs 95,000 and has an IRR of 28.9 percent and an NPV of 73,377. A small project costs 10,000 and saves 6,000 a year for 10 years: its IRR is 59.4 percent and its NPV is 23,901. The discount rate is 12 percent. Which adds more value?
3. The drive has a simple payback of 3.19 years. It fails at the end of year 4 and is not replaced. The site paid 12 percent a year for the money. What is the NPV?
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.