Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook ENSP-338-Homeworks/ENSP-338-HW-04/HW-04.ipynb

Project: ENSP 338
Views: 94
Kernel: Anaconda (Python 3)

Homework 4

This homework focuses on economic concepts discussed in the reading and in class:

  • Present Value

  • Finding the true cost of loan payments using Capital Recovery Factor

  • Conserved Cost of Energy

Calculating NPV

You invest 1000 USD in energy-efficient light bulbs today. Each year, these lights allow you to avoid 180 USD in energy costs. If these lights last 10 years, what is the net present value of the investment?

  1. Draw out the cash flow diagram and include it below

  2. Calculate the net present value with a discount rate of 0.05

  3. Make a recommendation

These notes may be helpful.

hint: NPV = sum of each year's PV. Start with the cost at year 0, and end with the PV of energy savings at year 10

NPV Solution

  1. Cash Flow Diagram below

  2. The Present Value equation is, PV=FutureAmount(USD)(1+Discount_rate)year PV = \frac{Future Amount(USD)}{(1+Discount\_rate)^{year}}

Net Present Value is defined as the sum of payments for each time period. In this case, we sum the Present Value of the avoided energy cost for each year. Such that

NPV=PVyear0+PVyear1+PVyear2+PVyear3....+PVyear10NPV = PV_{year0} + PV_{year1} + PV_{year2} + PV_{year3} .... + PV_{year10}

Therefore, NPV is calulated using: NPV=[FutureAmount(USD)(1+Discount_rate)year1+FutureAmount(USD)(1+Discount_rate)year2++FutureAmount(USD)(1+Discount_rate)year10]Initial_Investment NPV = \left[\frac{Future Amount(USD)}{(1+Discount\_rate)^{year1}}+ \frac{Future Amount(USD)}{(1+Discount\_rate)^{year2}} + \dots +\frac{Future Amount(USD)}{(1+Discount\_rate)^{year10}}\right] - Initial\_Investment or

NPV=[t=110FutureAmount(USD)(1+Discount_rate)t]Initial_InvestmentNPV = \left[\sum\limits_{\Large{t}=1}^{10} \frac{Future Amount(USD)}{(1+Discount\_rate)^{\Large{t}}}\right] - Initial\_Investment

Note\text{Note}: at year_0 (t = 0), the initial purchase makes PV_0 negative and equal to the investment. In the above equation, the initial investment is moved outside the sum

Here's the equation with the given values NPV=[180USD(1+0.05)1+180USD(1+0.05)2+....+180USD(1+0.05)10]1000(USD) NPV = \left[\frac{180USD}{(1+0.05)^{1}}+ \frac{180USD}{(1+0.05)^{2}} + .... +\frac{180USD}{(1+0.05)^{10}}\right] - 1000(USD)

NPV=[t=110180(USD)(1+0.05)t]Initial_InvestmentNPV = [\sum\limits_{\Large{t}=1}^{10} \frac{180(USD)}{(1+0.05)^{\Large{t}}}] - Initial\_Investment

In a code cell, the calulation can be written in expanded form or you can use the sum command. You should not\textbf{not} be typing this all out. Make the computer do most of the heavy lifting

initial_investment = 1000 yearly_avoided_cost = 180 discount_rate = 0.05 NPV = -initial_investment + yearly_avoided_cost/(1+discount_rate)**1 + yearly_avoided_cost/(1+discount_rate)**2 + yearly_avoided_cost/(1+discount_rate)**3+ yearly_avoided_cost/(1+discount_rate)**4 + yearly_avoided_cost/(1+discount_rate)**5 + 180/(1+discount_rate)**6 + yearly_avoided_cost/(1+discount_rate)**7 + yearly_avoided_cost/(1+discount_rate)**8 + yearly_avoided_cost/(1+discount_rate)**9 + yearly_avoided_cost/(1+discount_rate)**10 NPV
389.9122872532661
initial_cost = 1000 yearly_energy_savings = 180 i = 0.05 sum([-initial_cost, yearly_energy_savings/(1+i)**1 , yearly_energy_savings/(1+i)**2 , yearly_energy_savings/(1+i)**3, yearly_energy_savings/(1+i)**4 , yearly_energy_savings/(1+i)**5 , yearly_energy_savings/(1+i)**6 , yearly_energy_savings/(1+i)**7 , yearly_energy_savings/(1+i)**8 , yearly_energy_savings/(1+i)**9 , yearly_energy_savings/(1+i)**10])
389.9122872532661

Advanced Methods

# define variables initial_investment = 1000 yearly_avoided_cost = 180 i = 0.05 PV_0 = -initial_investment PV_1 = yearly_avoided_cost/(1+i)**1 PV_2 = yearly_avoided_cost/(1+i)**2 PV_3 = yearly_avoided_cost/(1+i)**3 PV_4 = yearly_avoided_cost/(1+i)**4 PV_5 = yearly_avoided_cost/(1+i)**5 PV_6 = yearly_avoided_cost/(1+i)**6 # these lines include numbers instead of the defined variables PV_7 = 180/(1+0.05)**7 PV_8 = 180/(1+0.05)**8 # python will compute any equivalent form of the equation PV_9 = 180*1.05**-9 PV_10 = 180*(1+.05)**-10 # define list of values values = [PV_0,PV_1,PV_2,PV_3,PV_4,PV_5,PV_6, PV_7,PV_8,PV_9, PV_10] # sum values in list NPV = sum(values) print(NPV)
389.9122872532661
initial_investment = 1000 yearly_avoided_cost = 180 i = 0.05 PV_0 = -initial_investment PV_1 = yearly_avoided_cost/(1+i)**1 PV_2 = yearly_avoided_cost/(1+i)**2 PV_3 = yearly_avoided_cost/(1+i)**3 PV_4 = yearly_avoided_cost/(1+i)**4 PV_5 = yearly_avoided_cost/(1+i)**5 PV_6 = yearly_avoided_cost/(1+i)**6 PV_7 = yearly_avoided_cost/(1+i)**7 PV_8 = yearly_avoided_cost/(1+i)**8 PV_9 = yearly_avoided_cost/(1+i)**9 PV_10 = yearly_avoided_cost/(1+i)**10 #here, the list includes only the first 6 years values = [PV_0,PV_1,PV_2,PV_3,PV_4,PV_5, PV_6] NPV = sum(values) print(NPV)
-86.37542789185954

Based on this last calculation; it can be seen that it would take more than six years to make the money back from this initial investment. From an economic standpoint, the recommendation would be to make the investment. Plus, as environmental studies students, this investment is exspecially enticing.

Capital Recovery Function

You are taking out a loan at 150K USD to pay for efficiency improvements for a large building. You have secured an 8-year loan at an interest rate of 4 percent.

What is the yearly payment for this loan?

Things to consider: CRF is used to convert the PV of a loan into the true cost of payments per period.

Show your calculation using the explicit formula for the CRF as well as by using the numpy library. This link may be helpful.

Cut and paste this to use the function:

from numpy import pmt pmt(rate, number_of_periods, principal)

CRF Solution

The Capital Recovery Funtion, where t is the number of payments, is defined as Interest_rate(1+Interest_rate)t(1+Interest_rate)t1{\frac{Interest\_rate(1+Interest\_rate)^{\large{t}}}{(1+Interest\_rate)^{\large{t}}−1}}

  • Solve for the yearly payments by plugging in the given values and multiplying the calculated CRF by the Total Loan amount

The Calulation should look like this yearly_payment=LoanAmountCRF yearly\_payment = Loan Amount * CRF

yearly_payment=(150000USD)0.04(1+0.04)8[(1+0.04)81]yearly\_payment = (150000 USD) * \frac{0.04(1+0.04)^{8}}{[(1+0.04)^{8}−1]}
payments = 8 interest_rate = 0.04 Capital_Recovery_Factor = (interest_rate*(1 + interest_rate)**payments)/((1+interest_rate)**payments - 1) Loan = 150000 Cost = Capital_Recovery_Factor * Loan Cost
22279.174807006922
from numpy import pmt rate = 0.04 payment_periods = 8 initial_principal = 15e4 pmt(rate,payment_periods ,initial_principal)
-22279.174807006926

Conserved Cost of Energy

A computer lab intends to replace several older workstations with newer more efficient computers.

  1. Explain how you will determine the avoided energy cost per year for the lab. List the data you need and the method you will use in sufficient detail for someone to use it to make a calculation.

  2. Explain how you will determine the annual investment cost. As above, provide enough detail so another student could easily construct a calculation.

Your answer should be a conceptual explination (make sure you're in a markdown cell)

Solution

  1. Concept:

    You will need the average power from both the existing and proposed workstations. The proposed workstations should have lower power consumption, to save energy. You will also need to know the hours per day or year that the workstations are used. The third piece is the number of workstations in the room.

The avoided energy is the product of: the hours per year of use, the difference in the powers of the workstations, and the number of computers.

  1. Concept:

    You need to know the number of workstations, and the cost of each, to determine the total cost to purchase the computers. To determine the annual cost, you must use the capital recovery function. To use the CRF, you also need to know the interest rate and the duration of the loan. Once you have all these, you can multiply the initial purchase cost by the CRF to get the annual cost.