1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
|
{
"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.85<loan):\n",
" print \"Loan is not given as amount is less than applied for loan\"\n",
"else:\n",
" print \"Loan is given\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The present worth is Rs 42.44 Lakh\n",
"Loan is not given as amount is less than applied for loan\n"
]
}
],
"prompt_number": 54
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex14.10:pg-423"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# given data\n",
"\n",
"g=0.2 # annual gas price increase rate\n",
"i=10/100.0 # discount rate \n",
"n=15 # time in years\n",
"A1=350*8 # payment at end of 1st year in lakhs rs\n",
"\n",
"Pgg=(A1/(i-g))*(1-((1+g)/(1+i))**n) # present worth in Rs\n",
"\n",
"print \"The present worth of saving is Rs\",round(Pgg)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The present worth of saving is Rs 75273.0\n"
]
}
],
"prompt_number": 58
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex14.11:pg-424"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# given data\n",
"Co=10000 # initial investment in rs\n",
"B=900.0 # net annual savings per year\n",
"\n",
"nsp=Co/B # simple payback period\n",
"\n",
"print \"The simple payback period is \",round(nsp,2)\n",
"if nsp<20:\n",
" print \"proposal may be accepted\"\n",
"else:\n",
" print \"proposal may not be accepted\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The simple payback period is 11.11\n",
"proposal may be accepted\n"
]
}
],
"prompt_number": 64
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex14.12:pg-425"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# given data\n",
"\n",
"import numpy\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",
"ProjAcu=numpy.zeros(6) # cumulative cash flow for project A\n",
"for i in range(0,6):\n",
" \n",
" ProjAcu[i]=ProjectA[i]+ProjAcu[i-1]\n",
" \n",
"ProjBcu=numpy.zeros(6) # cumulative cash flow for project B\n",
"for i in range(0,6):\n",
" \n",
" ProjBcu[i]=ProjectB[i]+ProjBcu[i-1]\n",
"\n",
"ProjCcu=numpy.zeros(6) # cumulative cash flow for project C\n",
"for i in range(0,6):\n",
" \n",
" ProjCcu[i]=ProjectC[i]+ProjCcu[i-1]\n",
" \n",
" \n",
"print \"\\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",
"print \"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",
"for i in range(0,6):\n",
" \n",
" print (i+1),\"\\t \\t \",ProjectA[i],\"\\t \\t \\t \\t \",ProjAcu[i],\" \\t \\t \\t \\t \\t \\t \",ProjectB[i],\" \\t \",ProjBcu[i],\"\\t \\t \\t \\t \\t \\t \\t \\t \\t\",ProjectC[i],\" \\t \",ProjCcu[i],\" \\t\"\n",
"\n",
"for i in range(0,6):\n",
" \n",
" if ProjAcu[i]==0:\n",
" PA=i \n",
"for i in range(0,6):\n",
" \n",
" if ProjBcu[i]==0:\n",
" PB=i\n",
"for i in range(0,6):\n",
" \n",
" if (ProjCcu[i]<0 and ProjCcu[i+1]>0):\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": {}
}
]
}
|