{ "metadata": { "name": "", "signature": "sha256:e6ad632e0276826941cf81a877ac22ef16f060c1d12c6f663c984c54d63b9330" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter14: Financial and Economic Evaluation" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.1:pg-414" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "P=2000 # in rs\n", "i=12 # interest rate in %\n", "n=6 # time in years\n", "\n", "F=P*(1+i/100.0)**n # Future value of investment\n", "\n", "print \"The amount will be Rs\",round(F)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The amount will be Rs 3948.0\n" ] } ], "prompt_number": 10 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.2:pg-414" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "# given data\n", "\n", "P=10.0 # in lakh rs\n", "i=12.25 # interest rate in %\n", "F=20 # final amount in lakh rs\n", "\n", "n=math.log(F/P)/math.log(1+i/100.0) # time in years\n", "\n", "print \"The number of years is \",round(n),\"years\"\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The number of years is 6.0 years\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.3:pg-415" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given data\n", "F=100000 # final amount in rs\n", "i=6 # interest rate in %\n", "n=10 # time in years\n", "\n", "P=F*(1/(1+i/100.0)**n) # initial amount\n", "\n", "print \"The initial value is Rs\",round(P)," ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The initial value is Rs 55839.0\n" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.4:pg-416" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given data\n", "A=500 # annual amount invested each year in rs\n", "i=9 # interest rate in %\n", "n=6 # time in years\n", "\n", "F=A*(((1+i/100.0)**n)-1)/(i/100.0) # future amount in rs\n", "\n", "print \"The Future amount will be Rs\",round(F)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The Future amount will be Rs 3762.0\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.5:pg-417" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given data\n", "F=12000 # Total amount in rs\n", "i=9 # interest rate in %\n", "n=4 # time in years\n", "\n", "A=F*(i/100.0)/(((1+i/100.0)**n)-1) # \n", "\n", "print \"The amount deposited each year should be Rs\",int(A)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The amount deposited each year should be Rs 2624\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.6:pg-417" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given data\n", "A=30000.0 # amount save each year in rs\n", "i=10/100.0 # interest rate \n", "n=8 # time in years\n", "\n", "P=A*(((1+i)**n)-1)/(i*((1+i)**n)) # amount spent on replacement in rs \n", "print \"Amount spent on replacement is Rs\",int(P)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Amount spent on replacement is Rs 160047\n" ] } ], "prompt_number": 26 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.7:pg-418" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given data\n", "i=12/100.0 # interest rate \n", "n=10 # time in years\n", "\n", "time=100.0 # days geyser is used in year\n", "effi=0.9 # efficiency of geyser\n", "w=100.0 # weight of water in kg\n", "C=4.2 # heat capacity in kJ/kg-degree C\n", "theta=60-15 # temperature difference in C\n", "cost=4 # cost of electricity per kWh\n", "\n", "Elec=(1/effi)*w*C*theta/3600.0 # electricity used in kWh/day\n", "Elec=round(Elec,2)\n", "\n", "\n", "A=Elec*time*cost # annual saving in Rs\n", "\n", "P=A*(((1+i)**n)-1)/(i*((1+i)**n)) # final amount in rs\n", "\n", "print \"The final amount after 10 years is Rs\",int(P)\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The final amount after 10 years is Rs 13176\n" ] } ], "prompt_number": 41 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.8:pg-419" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "\n", "P=200000.0 #principal value in rs\n", "i=10/100.0 # interest rate \n", "n=25.0 # time in years\n", "L=2.0 # power produced in kW\n", "\n", "A=P*(i*(1+i)**n)/(-1+(1+i)**n) # annualised capital cost in rs\n", "\n", "maintcost=P*0.05 # annual maintainence cost\n", "Totalcost=A+maintcost # total annual cost\n", "\n", "Elec=L*0.25*10*365 # annual electricity production\n", "\n", "Cost=Totalcost/Elec # unit cost of electricity production\n", "\n", "print \"unit cost of electricity production is Rs\",round(Cost,1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "unit cost of electricity production is Rs 17.6\n" ] } ], "prompt_number": 48 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.9:pg-421" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "\n", "G=1 #gradient per period in lakh rs\n", "i=12/100.0 # discount rate \n", "n=5 # time in years\n", "A1=10 # payment at end of 1st year in lakhs rs\n", "loan=40 # load applied for in lakhs\n", "\n", "\n", "AGin=(1/i)-5*1/(-1+(1+i)**n) # gradient to uniform series conversion factor\n", "\n", "Ag=A1+G*AGin # in lakhs Rs\n", "\n", "Pg=Ag*(-1+(1+i)**n)/(i*(1+i)**n) # present worth in lakhs rs\n", "\n", "print \"The present worth is Rs\",round(Pg,2),\"Lakh\"\n", "\n", "if (Pg*0.850):\n", " PC=(i)-ProjCcu[i]/ProjectC[i+1]\n", "\n", "print \" The payback period for project 1 is \",PA,\"\\n The payback period for project 2 is\",PB,\"\\n The payback period for project 3 is \",round(PC,2)\n", "\n", "\n", " \n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\t \t \t Project A \t \t \t \t \t \t \t \t \t Project B \t \t \t \t \t \t \t \t \t Project C\n", "year\t \t current \t cummulative \t \t \t \t \t current \t cummulative \t \t \t \t \t \t \t \t current \t \t cummulative \t\n", "1 \t \t -2400 \t \t \t \t -2400.0 \t \t \t \t \t \t -2400 \t -2400.0 \t \t \t \t \t \t \t \t \t-2400 \t -2400.0 \t\n", "2 \t \t 600 \t \t \t \t -1800.0 \t \t \t \t \t \t 800 \t -1600.0 \t \t \t \t \t \t \t \t \t500 \t -1900.0 \t\n", "3 \t \t 600 \t \t \t \t -1200.0 \t \t \t \t \t \t 800 \t -800.0 \t \t \t \t \t \t \t \t \t700 \t -1200.0 \t\n", "4 \t \t 600 \t \t \t \t -600.0 \t \t \t \t \t \t 800 \t 0.0 \t \t \t \t \t \t \t \t \t900 \t -300.0 \t\n", "5 \t \t 600 \t \t \t \t 0.0 \t \t \t \t \t \t 800 \t 800.0 \t \t \t \t \t \t \t \t \t1100 \t 800.0 \t\n", "6 \t \t 600 \t \t \t \t 600.0 \t \t \t \t \t \t 800 \t 1600.0 \t \t \t \t \t \t \t \t \t1300 \t 2100.0 \t\n", " The payback period for project 1 is 4 \n", " The payback period for project 2 is 3 \n", " The payback period for project 3 is 3.27\n" ] } ], "prompt_number": 42 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.13:pg-426" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "\n", "import numpy\n", "\n", "ProjAcu=[-2400.0,-1864.0,-1386.0,-959.0,-578.0,-238.0] # in Rs\n", "ProjBcu=[-2400,-1686,-1048,-479.0,30,484] # in Rs\n", "ProjCcu=[-2400,-1954,-1396,-755,-56.0,683] # in Rs\n", "\n", "ProjAdis=[-2400,536,478,427,381,340] # in Rs\n", "ProjBdis=[-2400,714,638,569,509.0,454] # in Rs\n", "ProjCdis=[-2400,446,558,641,699,738.0] # in Rs\n", "\n", "PA=0\n", "PB=0\n", "PC=0\n", "\n", "for i in range(0,5):\n", " if (ProjAcu[i]<0 and ProjAcu[i+1]>0):\n", " PA=(i+1)-ProjAcu[i]/ProjAdis[i+1]\n", "print \"For project A\"\n", "if (PA==0):\n", " print \"Net loss, Thus should be rejected\"\n", "else:\n", " print PA,\"years is payback period\" \n", "for i in range(0,5):\n", " \n", " if (ProjBcu[i]<0 and ProjBcu[i+1]>0):\n", " PB=(i)-ProjBcu[i]/ProjBdis[i+1]\n", "print \"For project B\"\n", "\n", "if (PB==0):\n", " print \"Net loss, Thus should be rejected\"\n", "else:\n", " print round(PB,2),\"years is payback period\" \n", " \n", "for i in range(0,5):\n", " \n", " if (ProjCcu[i]<0 and ProjCcu[i+1]>0):\n", " PC=(i)-ProjCcu[i]/ProjCdis[i+1]\n", "print \"For project C\"\n", "\n", "if (PC==0):\n", " print \"Net loss, Thus should be rejected\"\n", "else:\n", " print round(PC,2),\"years is payback period\" \n", "\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "For project A\n", "Net loss, Thus should be rejected\n", "For project B\n", "3.94 years is payback period\n", "For project C\n", "4.08 years is payback period\n" ] } ], "prompt_number": 48 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.14:pg-427" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "\n", "import numpy\n", "i=12.0/100 # interest rate \n", "n=5.0 # years\n", "\n", "ProjectA=[-2400,600,600,600,600,600] \n", "ProjectB=[-2400,800,800,800,800,800]\n", "ProjectC=[-2400,500,700,900,1100,1300]\n", "\n", "\n", "NPVA=ProjectA[0]+ProjectA[1]*(((1+i)**n) - 1)/(i*(1+i)**n)\n", "\n", "print \"NPV of Project A is \",round(NPVA)\n", "\n", "NPVB=ProjectB[0]+ProjectB[1]*(((1+i)**n) - 1)/(i*(1+i)**n)\n", "\n", "print \"NPV of Project B is \",round(NPVB)\n", "\n", "ProjectNPVc=0 # cumulative cash flow for project A\n", "for i in range(0,5):\n", " \n", " ProjectNPVc=ProjectNPVc+(-ProjectC[0]+ProjectC[i])/(1+i)**(i+1)\n", " \n", "print \"NPV of Project C is \",round(ProjectNPVc)\n", "\n", "# The answer for project C is wrong in the book" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "NPV of Project A is -237.0\n", "NPV of Project B is 484.0\n", "NPV of Project C is 852.0\n" ] } ], "prompt_number": 27 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.15:pg-428" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "import numpy\n", "Co=20000.0 # cost in Rs\n", "B=3000.0 # annual benefit in rs\n", "n=15.0 # time in years\n", "i=15.0/100 # initial guess for rate\n", "NPV=numpy.zeros(4)\n", "\n", "NPV[0]=B*(((1+i)**n)-1)/(i*(1+i)**n)-Co\n", "x=0\n", "print \"Iteration no. \\t\\t\\t i* \\t \\t \\t \\t \\t\\t\\t NPV(i*)\" \n", "while NPV[x]<0:\n", " x=x+1 \n", " i=i-0.01\n", " NPV[x]=B*(((1+i)**n)-1)/(i*(1+i)**n)-Co\n", " \n", "for z in range(0,4):\n", " print z+1,\" \\t \\t \\t \\t \\t \\t \\t \",0.15-(z/100.0),\" \\t \\t \\t\\t \\t \",round(NPV[z])\n", "\n", "IRR=i+(i+0.01-i)/(NPV[x]+NPV[x-1]) # using equation 14.28\n", "\n", "print \"The IRR is\", round(IRR*100,1)\n", "\n", "# the answer is slightly different in textbook due to approximation\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Iteration no. \t\t\t i* \t \t \t \t \t\t\t NPV(i*)\n", "1 \t \t \t \t \t \t \t 0.15 \t \t \t\t \t -2458.0\n", "2 \t \t \t \t \t \t \t 0.14 \t \t \t\t \t -1573.0\n", "3 \t \t \t \t \t \t \t 0.13 \t \t \t\t \t -613.0\n", "4 \t \t \t \t \t \t \t 0.12 \t \t \t\t \t 433.0\n", "The IRR is 12.0\n" ] } ], "prompt_number": 79 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.16:pg-429" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "\n", "i=12.0/100 # interest rate\n", "ProjAdisB=[0,536.0,478,427,381,340] # discounted benefit for A\n", "ProjAdisC=[2400.0,0,0,0,0,0] # discounted cost for A\n", "ProjBdisB=[0,714.0,638,569,509,454] # discounted benefit for B\n", "ProjBdisC=[2400.0,0,0,0,0,0] # discounted cost for B\n", "ProjCdisB=[0,446.0,558,641,699,738] # discounted benefit for C\n", "ProjCdisC=[2400.0,0,0,0,0,0] # discounted cost for C\n", "\n", "BCforA=sum(ProjAdisB)/sum(ProjAdisC) # B mius C ratio\n", "BCforB=sum(ProjBdisB)/sum(ProjBdisC) # B mius C ratio\n", "BCforC=sum(ProjCdisB)/sum(ProjCdisC) # B mius C ratio\n", "print \"B - C for project A is \",round(BCforA,1)\n", "print \"B - C for project B is \",round(BCforB,1)\n", "print \"B - C for project C is \",round(BCforC,2)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "B - C for project A is 0.9\n", "B - C for project B is 1.2\n", "B - C for project C is 1.28\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.17:pg-431" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "Co=12000.0 # cost in Rs\n", "Ca=200.0 # annual maintainence in Rs\n", "C12=3000.0 # replacement cost in 12th year\n", "S=1000.0 # salvage value in rs\n", "n=20.0 # time in years\n", "i=11/100.0 # interest rate\n", "\n", "Cnet=Co-S*(1/(1+i)**n)+Ca*((((1+i)**n)-1)/(i*(i+1)**n))+C12*(1/(1+i)**12)\n", "\n", "CR=Cnet*(i*(1+i)**n)/(((1+i)**n)-1)\n", "\n", "print \"The Capital Recovery cost is Rs\",round(CR)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The Capital Recovery cost is Rs 1799.0\n" ] } ], "prompt_number": 95 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.18:pg-432" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "i=10/100.0 # rate\n", "Acost=90000 # cost of A in Rs\n", "Bcost=75000 # cost of B in Rs\n", "Acashfl=26000 # annual cash flow of A in Rs\n", "Bcashfl=26000 # annual cash flow of B in Rs\n", "nA=5 # useful life of A in years\n", "nB=4 # useful life of B in years\n", "\n", "NPVA=Acashfl*(((1+i)**nA) - 1)/(i*(1+i)**nA) - Acost # NPV for A\n", "NPVB=Bcashfl*(((1+i)**nB) - 1)/(i*(1+i)**nB)- Bcost # NPV for B\n", "\n", "print \"The NPV for A is \",round(NPVA)\n", "\n", "print \"The NPV for B is \",round(NPVB)\n", "\n", "AEA=i*NPVA/(1-(1+i)**(-nA))\n", "\n", "\n", "AEB=i*NPVB/(1-(1+i)**(-nB))\n", "\n", "print \"The AE for A is Rs \",int(AEA)\n", "\n", "print \"The AE for B is Rs \",int(AEB)\n", "\n", "print \"The machine B will have higher profitability\"\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The NPV for A is 8560.0\n", "The NPV for B is 7417.0\n", "The AE for A is Rs 2258\n", "The AE for B is Rs 2339\n", "The machine B will have higher profitability\n" ] } ], "prompt_number": 108 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.19:pg-434" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "import numpy\n", "Co=120000.0 # cost in Rs\n", "N=5 # useful life\n", "T=40/100.0 # tax rate \n", "i=9/100.0 # interest rate\n", "Earning=[33000.0,35000.0,37000.0,39000,41000.0]\n", "Depreciate=Co/N # depreciation in Rs\n", "pretax=numpy.zeros(5)\n", "discshfl=numpy.zeros(5)\n", "for x in range(0,5):\n", " pretax=Earning[x]-Depreciate\n", " tax=0.4*pretax\n", " ernng=pretax-0.4*pretax\n", " cashf=ernng+Depreciate\n", " discshfl[x]=cashf/(1+i)**(x+1)\n", "netdiscntincm=sum(discshfl) # net discount income in Rs\n", "NPV=netdiscntincm-Co # NPV\n", "print \"NPV of dryer is Rs\",int(NPV)\n", "\n", "# The answer in the book is wrong as the value of discounted cashflow is incorrect\n", " " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "NPV of dryer is Rs 2889\n" ] } ], "prompt_number": 135 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex14.20:pg-435" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# given data\n", "\n", "Co=300000 # cost in Rs\n", "S=20000.0 # salvage value in Rs\n", "N=15 # useful life\n", "\n", "D=(Co-S)/N # Depreciation\n", "BV=Co # Book Value\n", "for i in range(0,N):\n", " BV=BV-D;\n", " print \"The Book value at the end of \",i+1,\"th year is Rs\",round(BV)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The Book value at the end of 1 th year is Rs 281333.0\n", "The Book value at the end of 2 th year is Rs 262667.0\n", "The Book value at the end of 3 th year is Rs 244000.0\n", "The Book value at the end of 4 th year is Rs 225333.0\n", "The Book value at the end of 5 th year is Rs 206667.0\n", "The Book value at the end of 6 th year is Rs 188000.0\n", "The Book value at the end of 7 th year is Rs 169333.0\n", "The Book value at the end of 8 th year is Rs 150667.0\n", "The Book value at the end of 9 th year is Rs 132000.0\n", "The Book value at the end of 10 th year is Rs 113333.0\n", "The Book value at the end of 11 th year is Rs 94667.0\n", "The Book value at the end of 12 th year is Rs 76000.0\n", "The Book value at the end of 13 th year is Rs 57333.0\n", "The Book value at the end of 14 th year is Rs 38667.0\n", "The Book value at the end of 15 th year is Rs 20000.0\n" ] } ], "prompt_number": 137 } ], "metadata": {} } ] }