summaryrefslogtreecommitdiff
path: root/Non_Conventional_Energy_Resources_by_B.H.Khan
diff options
context:
space:
mode:
Diffstat (limited to 'Non_Conventional_Energy_Resources_by_B.H.Khan')
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter1.ipynb178
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter10.ipynb118
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter11.ipynb111
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter12.ipynb71
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter13.ipynb61
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter14.ipynb961
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter2.ipynb64
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter4.ipynb350
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter6.ipynb164
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter7.ipynb185
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter8.ipynb221
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/Chapter9.ipynb303
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/README.txt10
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex14.7.pngbin0 -> 28252 bytes
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.1.pngbin0 -> 15873 bytes
-rwxr-xr-xNon_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.2.pngbin0 -> 35759 bytes
16 files changed, 2797 insertions, 0 deletions
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter1.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter1.ipynb
new file mode 100755
index 00000000..fb3cb83c
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter1.ipynb
@@ -0,0 +1,178 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2235c937260175b0ab97c5358d9d0f83ecc788771c1f725849b19d038912d334"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter01:Fundamental of Energy - Science and Technology"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.1:pg-36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data:\n",
+ "T1=500+273.0 #source temp in kelvin \n",
+ "T2=100+273.0 #sink temperature in kelvin\n",
+ "W=1 # output power in kW\n",
+ "\n",
+ "nth=1-(T2/T1) # thermal efficiency\n",
+ "\n",
+ "Q1=1/nth # heat supplied in kW\n",
+ "\n",
+ "Q2=Q1-W # heat rejected in kW\n",
+ "\n",
+ "print \" The heat rejected is \",Q2,\"kW\"\n",
+ "\n",
+ "# the answer in book is wrong due to incorrect value of T1 "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The heat rejected is 0.9325 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.2:pg-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data:\n",
+ "T1=40+273.0 # ambient temp in kelvin\n",
+ "T2=-10+273.0 # freezer temp in kelvin\n",
+ "Q2=2 # heat loss rate for freezer in kJ/s\n",
+ "\n",
+ "Q1=T1*(Q2/T2) # heat transfer rate in kJ/s\n",
+ "\n",
+ "W=Q1-Q2 # work in kW\n",
+ "\n",
+ "print \"The least power required is \",round(W,2),\"kW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The least power required is 0.38 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.3:pg-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data:\n",
+ "Q1=3e4 # heat required in kJ/h\n",
+ "W=2e3 # work required in kJ/h\n",
+ "\n",
+ "Q2=Q1-W # heat abstracted from outside in kJ/h\n",
+ "\n",
+ "COP=Q1/(Q1-Q2) # COP of heat pump\n",
+ "\n",
+ "print \"Heat abstracted from outside air is \",Q2,\"kJ/h\"\n",
+ "print \"COP heat pump is \",COP\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat abstracted from outside air is 28000.0 kJ/h\n",
+ "COP het pump is 15.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.4:pg-38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data:\n",
+ "T11=320+273.0 # temp at source 1 in kelvin\n",
+ "Q1=10000.0 # heat transfer rate at source 1 in kJ/min\n",
+ "T12=65+273.0 # temp at source 2 in kelvin\n",
+ "Q2=120000.0 # heat transfer rate at source 2 in kJ/min\n",
+ "T2=35+273.0 # temp of surrounding in kelvin\n",
+ "\n",
+ "n1=1-(T2/T11) # efficiency by source 1\n",
+ "n2=1-(T2/T12) # efficiency by source 2\n",
+ "\n",
+ "W1=Q1*n1 # work at source 1 in kJ/min\n",
+ "W2=Q2*n2 # work at source 2 in kJ/min\n",
+ "\n",
+ "print \"The work done at two sources is W1=\",W1,\" kJ/min W2=\",W2,\"kJ/min\"\n",
+ "print \"The larger power is provided by source 2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The work done at two sources is W1= 4806.07082631 kJ/min W2= 10650.887574 kJ/min\n",
+ "The larger power is provided by source 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter10.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter10.ipynb
new file mode 100755
index 00000000..03ebc1f8
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter10.ipynb
@@ -0,0 +1,118 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:24612751ac65a9de19e1dea072c5ab537e43d1545604927f1edd7f0e4f7a9d58"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10:Ocean Energy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10.1:pg-320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "R=13.0 # in m\n",
+ "r=3.0 # in m\n",
+ "A=2.0 # area in km^2\n",
+ "ebbcycle=12.42 # in hours\n",
+ "effi=0.7 # efficiency of turbine\n",
+ "g=9.8 # gravitational acceleration in m/sec^2\n",
+ "rho=1025 # density of sea in kg/m^3\n",
+ "Powerpotential=0.225*A*(10**6)*((R**2)-(r**2))/10**6 # power potential in MW\n",
+ "\n",
+ "Powergenerated=effi*Powerpotential # in MW\n",
+ "\n",
+ "print \"The average power generated by plant is \",Powergenerated,\"MW\"\n",
+ "\n",
+ "Energysingle=rho*A*(10**6)*g*((R**2)-(r**2))/(2.0*10**6) # Energy in single emptying in MJ\n",
+ "\n",
+ "ebbyear=364.0*24/ebbcycle\n",
+ "\n",
+ "annualenergy=Energysingle*ebbyear*effi*1000/3600.0 # in kWh\n",
+ "\n",
+ "print \"The annual average energy generation is \",round(annualenergy,-7),\"kWh\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average power generated by plant is 50.4 MW\n",
+ "The annual average energy generation is 220000000.0 kWh\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10.2:pg-324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "a=2.0/2 # in m\n",
+ "T=8.0 # in secs\n",
+ "rho=1025.0 # in kg/m^3\n",
+ "w=2*math.pi/T # angular frequency in radian/sec\n",
+ "g=9.8 # gravitational acceleration in m/sec^2\n",
+ "\n",
+ "Lamda=2*(math.pi)*g/(w**2) # in m\n",
+ "print \"wavelength is\",round(Lamda,1),\"m\"\n",
+ "v=g/w # phase velocity in m/s\n",
+ "print \"phase velocity is\",round(v,2),\"m/s\"\n",
+ "P=rho*(g**2)*(a**2)*T/(8*math.pi*1000) # power in wave in kW/m\n",
+ "print \"power in wave is \",round(P,2),\"kW/m\"\n",
+ "E=P*8.76 # average annual wave energy in mWh/m\n",
+ "\n",
+ "print \"average annual wave energy is \",round(E,1),\"mWh/m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "wavelength is 99.8 m\n",
+ "phase velocity is 12.48 m/s\n",
+ "power in wave is 31.33 kW/m\n",
+ "average annual wave energy is 274.5 mWh/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 84
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter11.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter11.ipynb
new file mode 100755
index 00000000..ef0f355f
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter11.ipynb
@@ -0,0 +1,111 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:131e5807eda8c30572547a9b8e6ec8831945c814f15b621bc05038f1dbaad1ff"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11:Small Hydro Resources"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11.1:pg-355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "rho=996 # density in kg/m^3\n",
+ "effi=0.55 # oveall efficiency\n",
+ "Q=100/1000.0 # discharge in m^3/sec\n",
+ "h=30 # gross head in m\n",
+ "g=9.81 # gravitational acceleration in m/sec^2\n",
+ "\n",
+ "\n",
+ "Pnet=effi*rho*Q*g*h/1000 # net power in watts\n",
+ "print \"Power available is\",round(Pnet,3),\"kilowatts\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power available is 16.122 kilowatts\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11.2:pg-356"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "pf=0.8 # power factor\n",
+ "Load=3 # load in kW\n",
+ "V=230 # voltage of kettle in V\n",
+ "P=500 # power of kettle in W\n",
+ "VA=pf*Load # VA load in kVA\n",
+ "C=4200 # specific heat of water in j/kg-K\n",
+ "T=45-20 # temperature difference in degree celsius\n",
+ "\n",
+ "VAR=VA*1.6 # net required VAR rating thus 60% extra capacity\n",
+ "\n",
+ "R=(V**2)/P # resistance by kettle in ohms\n",
+ "\n",
+ "Po=7*(V**2)/R # power dissipation in W for 7 elements\n",
+ "\n",
+ "print \"7 elements are connected in parallel\"\n",
+ "\n",
+ "Q=Load*1000.0/(C*T) # flow rate in kg/sec\n",
+ "\n",
+ "print\"The required flow rate is \",round(Q,5),\"litre/sec\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "7 elements are connected in parallel\n",
+ "The required flow rate is 0.02857 litre/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter12.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter12.ipynb
new file mode 100755
index 00000000..58982291
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter12.ipynb
@@ -0,0 +1,71 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:51836aeee86fdbe9ff075e142b59a3694a305b3949989cbb3e8809bdfd1573b6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12:Emerging Technologies"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.1:pg-375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "delG=-39.59 # kJ/mol\n",
+ "delH=-56.83 # change in enthalpy in kJ/mol\n",
+ "mdotmethanol=32.0 # in g/s\n",
+ "mdotoxygen=48.0 # in g/s\n",
+ "\n",
+ "Wmax=166.3 # -delG in kJ\n",
+ "\n",
+ "flowmethanol=mdotmethanol*100*3600/(Wmax*1000) # in kg/h\n",
+ "flowoxygen=mdotoxygen*100*3600/(Wmax*1000) # in kg/h\n",
+ "print \"The required flow rate of methanol is \",round(flowmethanol,2),\"kg/h\"\n",
+ "print \"The required flow rate of oxygen is \",round(flowoxygen,2),\"kg/h\"\n",
+ "delQ=delH-delG # using eq 12.7 \n",
+ "\n",
+ "fuelrate=-delQ*19.24/mdotmethanol # in kcal/s\n",
+ "\n",
+ "print \"The required heat removal rate is \",round(fuelrate,3),\"kcal/s\"\n",
+ "\n",
+ "# The answer is wrong in textbook because of incorrect conversion from g/s to kg/h"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required flow rate of methanol is 69.27 kg/h\n",
+ "The required flow rate of oxygen is 103.91 kg/h\n",
+ "The required heat removal rate is 10.366 kcal/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter13.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter13.ipynb
new file mode 100755
index 00000000..534f0e2b
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter13.ipynb
@@ -0,0 +1,61 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f398a98eb03764e3df9c76bb9b69ca1418effde2602c77ec655bb3f8f666faf0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter13:Miscellaneous Non-conventional Technologies"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13.1:pg-400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "A=0.25 # area in m^2\n",
+ "d=0.5 # distance between electrodes in m \n",
+ "B=1.8 # flux density in Wb/m^2\n",
+ "u=1200.0 # average gas velocity in m/s\n",
+ "sigma=10.0 # mho/m\n",
+ "\n",
+ "Vo=B*u*d # in Volts\n",
+ "Pmax=1*sigma*(u**2)*(B**2)*A*d/(4.0*10**6) # in MW\n",
+ "\n",
+ "print \"Maximum Power output\",Pmax,\"MW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Power output 1.458 MW\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter14.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter14.ipynb
new file mode 100755
index 00000000..6a934569
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter14.ipynb
@@ -0,0 +1,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": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter2.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter2.ipynb
new file mode 100755
index 00000000..17e1a25e
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter2.ipynb
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fcec1d0bbd87d6cfda378ca8b1be1663bde590b6487e23dd0b577f818a453620"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2: Energy Conservation"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.1:pg-56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data:\n",
+ "Hcoal=20.0 # heating value of coal in MJ\n",
+ "W=200.0e3 # weight of coal in kg\n",
+ "E=1.2e6 # Electrical energy generated in MJ\n",
+ "delH=1.6e6 # Heat energy generated in MJ\n",
+ "ne=0.30 # electrical efficiency\n",
+ "nb=0.8 # thermal efficiency\n",
+ "\n",
+ "QA=Hcoal*W # total thermal energy input to plant in MJ\n",
+ "nco=(E+delH)/QA # efficiency of cogeneration plant\n",
+ "e=E/(E+delH) # electrical fraction\n",
+ "\n",
+ "nc=1/((e/ne)+(1-e)/nb) # overall efficiency\n",
+ "\n",
+ "print \"The overall efficiency is \",round(nc*100,2),\"%\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The overall efficiency is 46.67 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter4.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter4.ipynb
new file mode 100755
index 00000000..aafcc4f4
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter4.ipynb
@@ -0,0 +1,350 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:574ebb4d4acd5d9e1ca65b924a04ae0a79a40c26934e573f22784629ff1f575c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter04:Solar Energy-Basics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.1:pg-98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "n=319 # 15th November\n",
+ "gamma=math.radians(30) # angle in radian\n",
+ "beta=math.radians(45) # angle in radian\n",
+ "phi=math.radians(18.9) # latitude in radian\n",
+ "solartime=13.5-4*(81.733-72.816)/60 +14.74/60 # in hours\n",
+ "delta=23.45*(math.sin(math.radians(360.0*(284.0+n)/365.0))) # in radian\n",
+ "B=45#(360.0*(n-81)/364)\n",
+ "E=9.87*math.sin(2*B)-7.53*math.cos(B)-15*math.sin(B)\n",
+ "w=math.radians((solartime-12)*15) # hour angle\n",
+ "thetai=math.acos((math.cos(phi)*math.cos(beta)+math.sin(phi)*math.sin(beta)*math.cos(gamma))*math.cos(delta)*math.cos(w) + math.cos(delta)*math.sin(w)*math.sin(beta)*math.sin(gamma) + math.sin(delta)*(math.sin(phi)*math.cos(beta)-math.cos(phi)*math.sin(beta)*math.cos(gamma)))\n",
+ "print round(math.degrees(thetai),2),\"degree\"\n",
+ "# The answer in the textbook is wrong due to wrong expression of Cos(Thetai)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5.77 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.2:pg-98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "n1=1 # 1st january\n",
+ "n2=182 # july 1\n",
+ "\n",
+ "phi=34.083 # latitude in degree\n",
+ "\n",
+ "delta1=23.45*math.sin(math.radians(360.0*(284.0+n1)/365.0)) # in degree\n",
+ "delta2=23.45*math.sin(math.radians(360.0*(284.0+n2)/365.0)) # in degree\n",
+ "\n",
+ "td1=(2.0/15)*math.degrees(math.acos(math.tan(phi)/math.tan(delta1))) # daylight hours for january 1\n",
+ "td2=(2.0/15)*math.degrees(math.acos(math.tan(phi)/math.tan(delta2))) # daylight hours for july 1\n",
+ "\n",
+ "print \"daylight hours for january 1 are\",round(td1,2),\"hours\"\n",
+ "print \"daylight hours for july 1 are\",round(td2,2),\"hours\"\n",
+ "\n",
+ "# the answers are slightly different in textbook due to approximation while here ansers are precise"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "daylight hours for january 1 are 9.55 hours\n",
+ "daylight hours for july 1 are 13.87 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.3:pg-101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "a=0.25 # constant for delhi from table 4.1 \n",
+ "b=0.57 # constant for delhi from table 4.1 \n",
+ "phi=27.166 # latitute in degrees\n",
+ "n=17 # day\n",
+ "nbar=7 # sunshine hours\n",
+ "\n",
+ "delta=23.45*(math.sin(math.radians(360.0*(284.0+n)/365.0))) # in radian\n",
+ "\n",
+ "wt=math.acos(math.radians(-math.tan(phi)*(math.tan(delta)))) # hour angle at sunrise\n",
+ "Nbar=(2*math.degrees(wt)/15.0)# day length\n",
+ "\n",
+ "Ho=3600*(24.0/math.pi)*1.367*(1+0.033*math.cos((360.0*n/365)))*(math.cos(phi)*cos(delta)*sin(wt)+1.3728*sin(delta)*sin(phi)) # in kj/m^2 per day\n",
+ "\n",
+ "Hg=Ho*(a+b*(nbar/Nbar)) # in kj/m^2 per day\n",
+ "print \"The monthly average is \",round(-Hg,2),\" in kj/m^2 per day\"\n",
+ "\n",
+ "# the answer in the book is wrong due to wrong calculations"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The monthly average is 19160.94 in kj/m^2 per day\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.4:pg-103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "Hg=19160.94 # in kj/m^2 per day from previous example\n",
+ "Ho=32107.62 # in kj/m^2 per day from previous example\n",
+ "KT=Hg/Ho # unitless\n",
+ "Hd=Hg*(1.354-1.570*KT) # in kj/m^2 per day\n",
+ "Hb= Hg-Hd # in kj/m^2 per day\n",
+ "\n",
+ "print \"Monthly average of daily diffused is \",round(Hd,2),\"in kj/m^2 per day\"\n",
+ "print \"beam radiation is \",round(Hb,2),\"in kj/m^2 per day\"\n",
+ "\n",
+ "# the solution inthe textbook is wrong as the values from previous examples are used which too are incorrect"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Monthly average of daily diffused is 7991.4 in kj/m^2 per day\n",
+ "beam radiation is 11169.54 in kj/m^2 per day\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.5:pg-104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "# most of the data is used is from previous example:\n",
+ "phi=27.166 # in degree\n",
+ "n=17 # day\n",
+ "ws=78.66 # degrees\n",
+ "delta=-20.96 # in degrees\n",
+ "Ho=22863.3 # kj/m^2 per day\n",
+ "Hg=14413.82 # kj/m^2 per day\n",
+ "Hd=5259.6 # kj/m^2 per day\n",
+ "\n",
+ "w=(11.5-12)*15 # in degrees\n",
+ "\n",
+ "Io=3600*1.367*(1+0.033*math.cos(360*17/365.0))*(math.cos(math.radians(phi))*math.cos(math.radians(delta))*math.cos(math.radians(w)))+math.sin(math.radians(delta))*math.sin(math.radians(phi))\n",
+ "\n",
+ "a=0.409+0.5016*math.sin(ws-60)\n",
+ "b=0.6609-0.4767*math.sin(ws-60)\n",
+ "\n",
+ "Ig=Hg*(a+b*math.cos(w))*Io/Ho # in kJ/m^2-h\n",
+ "\n",
+ "print \"The monthly average of hourly global radiation is \",round(Ig,2),\"kJ/m^2-h\"\n",
+ "\n",
+ "adash=0.4922+(0.27/(Hd/Hg))\n",
+ "bdash=2*(1-adash)*(math.sin(math.radians(ws)))-1.7328*math.cos(math.radians(78.66))/(1.7328-0.5*math.sin(math.radians(2*78.66))) \n",
+ "\n",
+ "\n",
+ "Id=5259.6*(1.2321-0.3983*math.cos(math.radians(w)))*Io/Ho # kJ/m^2-h\n",
+ "\n",
+ "\n",
+ "\n",
+ "print \"The hourly diffuse radiations are\",round(Id,2),\"kJ/m^2-h\"\n",
+ "\n",
+ "# the solution inthe textbook is wrong as the values from previous examples are used which too are incorrect\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The monthly average of hourly global radiation is 1444.92 kJ/m^2-h\n",
+ "The hourly diffuse radiations are 768.07 kJ/m^2-h\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.6:pg-108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "phi=28.58 # in degree\n",
+ "n=135 # may 15\n",
+ "delta=23.45*math.sin(math.radians(360*(284+n)/365.0))\n",
+ "\n",
+ "w=(13.5-12)*15 # in degrees\n",
+ "A=3981.6 # in W/m^2 from table 4.2\n",
+ "B=0.177# from table 4.2\n",
+ "C=0.130 # from table 4.2\n",
+ "\n",
+ "costhetaz=math.cos(phi)*math.cos(delta)*math.cos(w)+math.sin(delta)*math.sin(phi)\n",
+ "\n",
+ "Ibn=A*math.exp(-B/0.922)# kJ/m^2-h\n",
+ "\n",
+ "\n",
+ "Id=C*Ibn # kJ/m^2-h\n",
+ "\n",
+ "print \"The diffused radiation is \",round(Id,2),\"kJ/m^2-h\"\n",
+ "Ib=Ibn*0.922 # in kJ/m^2-h\n",
+ "\n",
+ "print \"The beam radiation is \",round(Ib,2),\"kJ/m^2-h\"\n",
+ "Ig=Ib+Id # in kJ/m^2-h\n",
+ "\n",
+ "print \"The global radiation is \",round(Ig,2),\"kJ/m^2-h\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diffused radiation is 427.2 kJ/m^2-h\n",
+ "The beam radiation is 3029.81 kJ/m^2-h\n",
+ "The global radiation is 3457.01 kJ/m^2-h\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex-4.7:pg-111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "phi=28.58 # in degree\n",
+ "B=30 # in degree\n",
+ "n=318 # november 14\n",
+ "Hg=16282.8 # in kJ/m^2-day from Table C1 appendix C\n",
+ "Hd=4107.6 # in kJ/m^2-day from Table C2 appendix C\n",
+ "\n",
+ "delta=23.45*(math.sin(math.radians(360.0*(284.0+n)/365.0))) # in radians\n",
+ "\n",
+ "ws=math.acos(math.radians(-math.tan(phi)*(math.tan(delta)))) # hour angle at sunrise\n",
+ "\n",
+ "Rb=(ws*sin(math.radians(delta))*math.sin(phi-B)+math.cos((delta))*math.sin(ws)*math.cos(phi-B))/(ws*sin((delta))*math.sin(math.radians(phi))+math.cos(math.radians(delta))*math.sin(ws)*math.cos(math.radians(phi)))\n",
+ "\n",
+ "Rd=(1+math.cos(math.radians(B)))/2 \n",
+ "\n",
+ "Rr=0.2*(1-math.cos(math.radians(B)))/2 \n",
+ "\n",
+ "Ht=((1-(Hd/Hg))*1.56+(Hd/Hg)*Rd + Rr)*Hg\n",
+ "print \"Monthly average total radiation is\",round(Ht,2),\"kJ/m^2-h\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Monthly average total radiation is 23043.9 kJ/m^2-h\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter6.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter6.ipynb
new file mode 100755
index 00000000..e587f8b8
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter6.ipynb
@@ -0,0 +1,164 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:19f2a8cb1c6de61d0a56800f8e56bd9bad7dc4e03b58a655a7a7ff910f23e6d6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Solar Photovoltaic Systems"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.1:Pg-162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data :\n",
+ "import math\n",
+ "T=27 +273 # temperature converted in kelvin\n",
+ "NV=1e22 # effective density of states in valence band in cm^(-3)\n",
+ "NA=1e19 # acceptor density in cm^(-3)\n",
+ "k=8.629*10**(-5) # boltzmann constant in eV/K\n",
+ "EFV=k*T*math.log(NV/NA) # closeness of fermi level i.e Ef-Ev\n",
+ "print \"Closeness of fermi level with valence bond is\",round(EFV,4),\"eV\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closeness of fermi level with valence bond is 0.1788 eV\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.2:Pg-165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data :\n",
+ "E =2.42 # Band gap in eV\n",
+ "hc=1.24 # planck's constant * speed of light\n",
+ "# solution\n",
+ "Lambda=1.24/E # in micro-meter usinf eq 6.4\n",
+ "\n",
+ "print \"The optimum wavelength is \",round(Lambda,3),\" micro meter\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The optimum wavelength is 0.512 micro meter\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.3:Pg-182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data :\n",
+ "Pout=1*735 # motor power output in W\n",
+ "Peffi=0.85 # motor efficiency\n",
+ "cellarea=9*4*125*125e-6 # area in m^2 \n",
+ "Rad=1000 #incident radiation in kW/m^2\n",
+ "celleffi=0.12 # cell efficiency\n",
+ "\n",
+ "# soln.\n",
+ "Pin=Pout/Peffi # power req by motor in W\n",
+ "N=Pin/(Rad*cellarea*celleffi) # number of modules\n",
+ "\n",
+ "print round(N),\" number of modules are required\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "13.0 number of modules are required\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.4:Pg-185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given:\n",
+ "noMPPTpower=10*8 # power without MPPT in W from fig 6.25\n",
+ "MaxP=25*5 # maximum power by PV module in W from fig 6.25\n",
+ "effi=0.95 # efficiency of MPPT\n",
+ "MPPTcost=4000 # Cost in rupees\n",
+ "# Soln\n",
+ "Pact=MaxP*effi # actual power produced in W\n",
+ "Psurplus=Pact-noMPPTpower # Surplus power in W\n",
+ "t=MPPTcost/(3*Psurplus/1000) # time required in hours \n",
+ "print \"time required is \",round(t,2),\"hours\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "time required is 34408.6 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter7.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter7.ipynb
new file mode 100755
index 00000000..abfadf7d
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter7.ipynb
@@ -0,0 +1,185 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4b902b7e06643df09d54725c85a046b0d243304126721453ed87eafe8f5d46d6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7: Wind Energy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.1:Pg-216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "rho=1.226 # air density in kG/m^3\n",
+ "alpha =0.14\n",
+ "H=10.0 # height at which wind speed is given in m\n",
+ "uH=12.0 # speed in m/s\n",
+ "z=100.0 # tower height in m\n",
+ "D=80.0 # diameter in m\n",
+ "effigen=0.85 # efficiency og generator\n",
+ "\n",
+ "A=math.pi*(D**2)/4 # area in m^3\n",
+ "u0=uH*(z/H)**alpha # velocity at 100 m in m/s\n",
+ "u1=0.8*u0 # exit velocity in m/s \n",
+ "Po=(A*rho*u0**3)/2 # Total Power in Wind\n",
+ "# Part 1 \n",
+ "print \"Total Power in Wind is \",round(Po/1000000,2),\"MW\"\n",
+ "\n",
+ "# Part 2\n",
+ "a=(u0-u1)/u0 # interference factor\n",
+ "Cp=4*a*(1-a)**2 # Power Coefficient\n",
+ "PT=Cp*Po/1000000 # power to turbine in MW\n",
+ "\n",
+ "print \"The power extracted by turbine is \",round(PT,2),\"MW\"\n",
+ "\n",
+ "# Part 3\n",
+ "Pelec=effigen*PT # electrical power generated in MW\n",
+ "\n",
+ "print \"The Electrical power generated is \",round(Pelec,2),\"MW\"\n",
+ "\n",
+ "# Part 4\n",
+ "FA=4*a*(1-a)*(A*rho*u0**2)/2 # axial thrust in N\n",
+ "\n",
+ "print \"The axial thrust is \",round(FA,2),\"N\"\n",
+ "\n",
+ "# Part 5\n",
+ "\n",
+ "Fmax=(A*rho*u0**2)/2 # maximum thrust in N\n",
+ "print \"Maximum axial thrust is \",round(Fmax,2),\"N\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Power in Wind is 14.0 MW\n",
+ "The power extracted by turbine is 7.17 MW\n",
+ "The Electrical power generated is 6.09 MW\n",
+ "The axial thrust is 541094.1 N\n",
+ "Maximum axial thrust is 845459.53 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.2:Pg-216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# given data\n",
+ "import math\n",
+ "u0=20.0 # wind speed in m/s\n",
+ "T=273+27.0 # temp in kelvin\n",
+ "P=1.01325e5 # pressure in Pa\n",
+ "R=287.0 # gas constant\n",
+ "r=80/2.0 # radius of rotor in m\n",
+ "w=2*math.pi*40/60.0 # rotor speed in rad/s\n",
+ "A=math.pi*r**2 # area of rotor in m^2\n",
+ "\n",
+ "# soln:\n",
+ "rho=P/(R*T) # density in Kg/m^3\n",
+ "a=1/3.0 # condition for maximum output\n",
+ "Cpmax=4*a*(1-a)**2 # Power Coefficient\n",
+ "Lambda=r*w/u0 #tip speed ratio\n",
+ "\n",
+ "Po=(A*rho*u0**3)/2000000 # Total Power in Wind in W\n",
+ "\n",
+ "Tm=Po*r/u0 # Torque in N\n",
+ "\n",
+ "Ctmax=Cpmax/Lambda # torque coefficient \n",
+ "\n",
+ "Tshmax=Tm*Ctmax # torque at shaft\n",
+ "\n",
+ "print \"The torque at shaft for maximum output is \",round(Tshmax,2),\"N\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The torque at shaft for maximum output is 3.35 N\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.3:Pg-217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given Data\n",
+ "# given data\n",
+ "import math\n",
+ "u0=15.0 # wind speed in m/s\n",
+ "R=80/2.0 # radius of rotor in m\n",
+ "n=3 # number of blades\n",
+ "\n",
+ "Lambda=4*math.pi/n # condition of tip ratio for maximum output\n",
+ "\n",
+ "w=Lambda*u0/R # using Eq 7.21 rotor speed in rad/s\n",
+ "\n",
+ "N=w*60/(2*math.pi) # rotor speed in RPM\n",
+ "\n",
+ "print \"For optimum energy the rotor speed should be\",N,\"rpm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For optimum energy the rotor speed should be 15.0 rpm\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter8.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter8.ipynb
new file mode 100755
index 00000000..78ee7847
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter8.ipynb
@@ -0,0 +1,221 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c68fc201cfe81f16f5fdc7644c90e046b65f1cf7e7075d3bd357ce452cccc83a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter08:Biomass Energy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.1:pg-271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "Gascook=5*0.227 # gas required for cooking in m^3/day\n",
+ "Gaslight=0.126*2*3 # gas required for lighting in m^3/day\n",
+ "Totalgasreq=Gascook+Gaslight # in m^3/day\n",
+ "gasperday=0.34*0.18*7 # in m^3/day\n",
+ "\n",
+ "n=1+Totalgasreq/gasperday # no. of cows\n",
+ "print \"The number of cows is \",int(n)\n",
+ "cowfeed=7*n # in kg\n",
+ "slurry=cowfeed*2.0/1090 # in m^3\n",
+ "totalslurry=50.0*slurry # in m^3\n",
+ "reqvolume=totalslurry/0.9 \n",
+ "print \"The total volume of digester is \",round(reqvolume,2),\"m^3\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of cows is 5\n",
+ "The total volume of digester is 3.86 m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.2:pg-272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "Gaslight=10*0.227*4 # gas required for lighting in m^3/day\n",
+ "Eleccomp=10*250*6*60*60/1000000.0 # electrical energy required by computers in MJ\n",
+ "effith=0.25 # thermal efficieny\n",
+ "efficonv=0.80 # conversion efficiency\n",
+ "Heat=23.0 # heating value of biogas in MJ/m^3\n",
+ "rho=1090.0 # slurry density in kg/m^3\n",
+ "Engineinput=Eleccomp/(effith*efficonv)\n",
+ "\n",
+ "energypump=746*2*2*60*60/1000000.0 # mechanical energy required for pumping in MJ\n",
+ "themalinput=energypump/effith # required thermal input in MJ\n",
+ "totalinput=themalinput+Engineinput # total thermal input required by engine\n",
+ "\n",
+ "Volreq=totalinput/Heat # volume required per day in m^3/day\n",
+ "Totalrq=Volreq+Gaslight # total gas required in m^3 /day\n",
+ "\n",
+ "n=Totalrq/(7*0.18*0.34) # solid mass is 18% and n is number of cows required\n",
+ "n=round(n)\n",
+ "print \"The number of cows is\",n\n",
+ "feed=7*n # daily feed in kg\n",
+ "slurry=2*feed # in kg\n",
+ "volslurry=slurry/rho # volume of slurry added per day in m^3\n",
+ "totalvol=50*volslurry/0.9 # total volume for 50 days in m^3 when 90 % is occupied by slurry\n",
+ "\n",
+ "print \"The size of biogas plant is \",round(totalvol,2),\"m^3\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of cows is 53.0\n",
+ "The size of biogas plant is 37.82 m^3\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.3:pg-273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "Voldaily=1200 # daily production in m^3/day\n",
+ "prodrate=Voldaily/24.0 # gas production rate per hour\n",
+ "consrate=Voldaily/6.0 #gas consumtion rate per hour\n",
+ "Vg1=(consrate-prodrate)*2 # gas holder size required for 2 hours in litres\n",
+ "Vg2=prodrate*9 # gas holder size for 9 hours without consumption in litres\n",
+ "if Vg1>Vg2:\n",
+ " Vgmax=Vg1\n",
+ "else:\n",
+ " Vgmax=Vg2\n",
+ "Vg=Vgmax*1.25 # required gas holder with 25 % safety margin in litres\n",
+ "print \"required gas holder size is \",Vg,\"litres\"\n",
+ "Capacity=Vg/Voldaily # required gas holder capacity\n",
+ "\n",
+ "print \"required gas holder capacity is \",round(Capacity*100,2),\"%\"\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "required gas holder size is 562.5 litres\n",
+ "required gas holder capacity is 46.88 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8.4:pg-274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "drymattrprd=2 # dry matter produced in kg/day/cow\n",
+ "gasyield=0.22 # biogas yield in m^3 /kg\n",
+ "drymttr=18/100.0 # dry matter in cowdung\n",
+ "rho=1090 # slurry density in kg/m^3\n",
+ "effibrnr=0.6 # burner efficiency\n",
+ "Heat=23.0 # heating value of biogas in MJ/m^3\n",
+ "\n",
+ "dungprd=drymattrprd*2/0.18 # dung produce in kg/day by 2 cows\n",
+ "slurry=2*dungprd # slurry produce in kg/day\n",
+ "volslurry=slurry/rho # volume of slurry in m^3\n",
+ "totalslurry=30*volslurry # for 30 days slurry in m^3\n",
+ "digestersize=totalslurry/0.85 # in m^3\n",
+ "print \"the volume of digester is \",round(digestersize,2),\"m^3\"\n",
+ "\n",
+ "gasprd=drymattrprd*2*gasyield # gas produced in m^3/day\n",
+ "\n",
+ "Energytherm=gasprd*Heat*effibrnr # total thermal energy available in MJ/day\n",
+ "\n",
+ "\n",
+ "thermalpower=Energytherm*1000000/(24*60*60) # in watts\n",
+ "\n",
+ "print \"total thermal power is \",round(thermalpower,3),\"W\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the volume of digester is 1.44 m^3\n",
+ "total thermal power is 140.556 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter9.ipynb b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter9.ipynb
new file mode 100755
index 00000000..8736d9a8
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/Chapter9.ipynb
@@ -0,0 +1,303 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47ed2e07aa752d35a238880d941b7ff865358a9055d3a5d12934bca3f8fdda8e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter09:Geothermal Energy"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.1.i:pg-302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "G=39.0 # temperature gradient in K/km.\n",
+ "h2=10.0 # depth in km\n",
+ "rhor=2700.0 # kg/m^3\n",
+ "cr=820.0 # in J/kg-K\n",
+ "\n",
+ "h1=120/G # T1-T0=120 K is given\n",
+ "h21=h2-h1 # in km\n",
+ "E0byA=(rhor*(1000**3)*G*cr*h21**2)/2 # in J/km^2 Heat content per square km\n",
+ "print\" The Heat content per square km is \",E0byA,\"J/km^2\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The Heat content per square km is 2.06923846154e+18 J/km^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.1.ii:pg-302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "G=39.0 # temperature gradient in K/km.\n",
+ "h2=10.0 # depth in km\n",
+ "rhor=2700.0 # kg/m^3\n",
+ "cr=820.0 # in J/kg-K\n",
+ "QbyA=0.5 #water flow rate in m^3/sec-km^2 \n",
+ "rhow=1000.0 # density of water in kg/m^3\n",
+ "cw=4200.0 # specific heat of water in J/kg-K \n",
+ "h1=120.0/G # T1-T0=120 K is given\n",
+ "h21=h2-h1 # in km\n",
+ "t=25 # time in years\n",
+ "\n",
+ "thetao=G*h21/2.0 # in degree K\n",
+ "print \"Useful initial temp is\",thetao,\"degree K\"\n",
+ "tau=rhor*cr*h21*(1000**3)/(QbyA*rhow*cw) # in seconds\n",
+ "tau=tau/(2*60*60*24*365) # in years\n",
+ "theta=thetao*math.exp(-t/tau) # in degree Kelvin\n",
+ "print \"Useful average temp after 25 years is\",round(theta,2),\"degree K\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Useful initial temp is 135.0 degree K\n",
+ "Useful average temp after 25 years is 108.77 degree K\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.1.iii:pg-302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "G=39.0 # temperature gradient in K/km.\n",
+ "h2=10.0 # depth in km\n",
+ "rhor=2700.0 # kg/m^3\n",
+ "cr=820.0 # in J/kg-K\n",
+ "\n",
+ "h1=120/G # T1-T0=120 K is given\n",
+ "h21=h2-h1 # in km\n",
+ "E0byA=(rhor*(1000**3)*G*cr*h21**2)/2 # in J/km^2 Heat content per square km\n",
+ "\n",
+ "thetao=G*h21/2.0 # in degree K\n",
+ "tau=rhor*cr*h21*(1000**3)/(QbyA*rhow*cw) # in seconds\n",
+ "tau=tau/(2*60*60*24*365) # in years\n",
+ "theta=thetao*math.exp(-t/tau) # in degree Kelvin\n",
+ "\n",
+ "Heatinitial=E0byA/(60*60*365*24*tau)/1000000 # intial heat extraction rate in MW /km^2\n",
+ "\n",
+ "Heat25=Heatinitial*math.exp(-t/tau) # heat extraction rate after 25 years in MW /km^2\n",
+ "\n",
+ "print \"Initial Heat extraction rate is \",Heatinitial,\"MW/km^2\"\n",
+ "\n",
+ "print \"Final Heat extraction rate is \",round(Heat25,2),\"MW/km^2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Initial Heat extraction rate is 567.0 MW/km^2\n",
+ "Final Heat extraction rate is 456.84 MW/km^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.2.i:pg-304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "w=0.6 # in km \n",
+ "h2=2.5 # in km\n",
+ "p=5/100.0 # porosity\n",
+ "rhor=3000.0 # density of sediment in kg/m^3\n",
+ "cr=750.0 # specific heat of sediment in J/kg-K\n",
+ "rhow=1000.0 # density of water in kg/m^3\n",
+ "cw=4200.0 # specific heat of water in J/kg-K\n",
+ "G=35.0 # temperature gradient in degree C/km\n",
+ "T1=45.0 # temp 1 in degree celsius\n",
+ "T0=12.0 # temp 2 in degree celsius\n",
+ "Q=0.75 # water extraction rate in m^3/sec-km^2\n",
+ "\n",
+ "T2=T0+G*h2 # initial temp in degree celsius\n",
+ "\n",
+ "thetao=T2-T1 # in degree celsius\n",
+ "\n",
+ "E0byA=(p*rhow*(1000**3)*cw+(1-p)*rhor*(1000**3)*cr)*w*thetao # in J/km^2\n",
+ "\n",
+ "print \"The heat content is\",round(E0byA,-14),\"J/km^2\"\n",
+ "\n",
+ "# the answer is different in textbook due to wrong thetao\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The heat content is 7.68e+16 J/km^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.2.ii:pg-304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "w=0.6 # in km \n",
+ "h2=2.5 # in km\n",
+ "p=5/100.0 # porosity\n",
+ "rhor=3000.0 # density of sediment in kg/m^3\n",
+ "cr=750.0 # specific heat of sediment in J/kg-K\n",
+ "rhow=1000.0 # density of water in kg/m^3\n",
+ "cw=4200.0 # specific heat of water in J/kg-K\n",
+ "G=35.0 # temperature gradient in degree C/km\n",
+ "T1=45.0 # temp 1 in degree celsius\n",
+ "T0=12.0 # temp 2 in degree celsius\n",
+ "Q=0.75 # water extraction rate in m^3/sec-km^2\n",
+ "\n",
+ "tau=((p*rhow*cw+(1-p)*rhor*cr)*w*1000**3/(Q*rhow*cw))/(60*60*24*365) # in years\n",
+ "\n",
+ "print \"Time constant is \",round(tau,1),\"years\"\n",
+ "\n",
+ "# the answer is different in textbook due to wrong calculations\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time constant is 14.2 years\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9.2.iii:pg-304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# given data\n",
+ "w=0.6 # in km \n",
+ "h2=2.5 # in km\n",
+ "p=5/100.0 # porosity\n",
+ "rhor=3000.0 # density of sediment in kg/m^3\n",
+ "cr=750.0 # specific heat of sediment in J/kg-K\n",
+ "rhow=1000.0 # density of water in kg/m^3\n",
+ "cw=4200.0 # specific heat of water in J/kg-K\n",
+ "G=35.0 # temperature gradient in degree C/km\n",
+ "T1=45.0 # temp 1 in degree celsius\n",
+ "T0=12.0 # temp 2 in degree celsius\n",
+ "Q=0.75 # water extraction rate in m^3/sec-km^2\n",
+ "T2=T0+G*h2 # initial temp in degree celsius\n",
+ "t=25 # time in years\n",
+ "thetao=T2-T1 # in degree celsius\n",
+ "\n",
+ "E0byA=(p*rhow*(1000**3)*cw+(1-p)*rhor*(1000**3)*cr)*w*thetao # in J/km^2\n",
+ "\n",
+ "tau=((p*rhow*cw+(1-p)*rhor*cr)*w*1000**3/(Q*rhow*cw)) # in seconds\n",
+ "Pperkm2=(E0byA)/(tau*1000000) # initial power per square km in MW/km^2\n",
+ "print \"initial power per square km is\",Pperkm2,\" MW/km^2\"\n",
+ "Power20=Pperkm2*math.exp(-25*60*60*24*365/tau) # power per square km in MW/km^2 after 25 years\n",
+ "print \"power per square km in MW/km^2 after 25 years is \",round(Power20,2),\"MW/km^2\"\n",
+ "\n",
+ "# The answers are slightly different due to approximation in textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "initial power per square km is 171.675 MW/km^2\n",
+ "power per square km in MW/km^2 after 25 years is 29.44 MW/km^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/README.txt b/Non_Conventional_Energy_Resources_by_B.H.Khan/README.txt
new file mode 100755
index 00000000..95f3b0d4
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ashish Vimal
+Course: btech
+College/Institute/Organization: Abes Engineering college, Ghaziabad
+Department/Designation: Mechanical
+Book Title: Non Conventional Energy Resources
+Author: B.H.Khan
+Publisher: TMH.
+Year of publication: 2009
+Isbn: 9780070142763
+Edition: 2nd Edition \ No newline at end of file
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex14.7.png b/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex14.7.png
new file mode 100755
index 00000000..a5f9576f
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex14.7.png
Binary files differ
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.1.png b/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.1.png
new file mode 100755
index 00000000..79438bd1
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.1.png
Binary files differ
diff --git a/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.2.png b/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.2.png
new file mode 100755
index 00000000..44619e92
--- /dev/null
+++ b/Non_Conventional_Energy_Resources_by_B.H.Khan/screenshots/Ex9.2.png
Binary files differ