summaryrefslogtreecommitdiff
path: root/sample_notebooks/AkshayPatil/Chapter02.ipynb
blob: 0aad1c0ca4dc8f19ba60d5f29bb867b2d00102be (plain)
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
{
 "metadata": {
  "name": "",
  "signature": "sha256:1cb720af73aa9aeffe36433462db80e841a95011aedc57edfe5b2ec1f1efe5b3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 02:Highway Planning and Alignment"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2-1, Page Number-35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Note:The variables have been changed to ease coding\n",
      "Tot_Area=14400 #Total Area in km^2\n",
      "Agri_Area=4800 #Agricultural Area in km^2\n",
      "Track_Len=219 #Kength of the track in km\n",
      "Met_Road=469 #Total Existing length of metalled road in km\n",
      "Unmet_Road=412 #Total Existing Length of Unmetalled road in km\n",
      "#The tabular data will be taken as and when required\n",
      "\n",
      "#Calculations\n",
      "#Metalled Road\n",
      "A=Agri_Area\n",
      "B=Tot_Area-Agri_Area\n",
      "N=50 #No: of villages  and town in the population range of 2001 to 5000\n",
      "T=10\n",
      "#Solving for L\n",
      "Road_Length=(A/8)+(B/32)+1.6*N+8*T #Length of metalled road in km\n",
      "D=0.15*Road_Len\n",
      "R=Track_Len\n",
      "L=Road_Length+D-R\n",
      "#Unmetalled Road\n",
      "#Values from the given table\n",
      "V=500 #No: of villages and towns\n",
      "Q=300\n",
      "P=200\n",
      "S=50\n",
      "#Solving for L1\n",
      "Road_Length2=0.32*V+0.8*Q+1.6*P+3.2*S\n",
      "L1=Road_Length2+0.15*Road_Length2 #Length in km\n",
      "\n",
      "#Final Computation\n",
      "#(1)\n",
      "Tot_Len_Met_Road=Road_Length+D-Met_Road #In km\n",
      "#(2)\n",
      "Tot_Len_Un_Road=L1-Unmet_Road #In km\n",
      "#(3)\n",
      "Tot_Road=Road_Len+D+L1 #In km\n",
      "#Road per 100km^2\n",
      "Road_Len_per=(Tot_Road/Tot_Area)*100 #in km\n",
      "\n",
      "#Result\n",
      "print \"Total Additional length of metalled road is\", Tot_Len_Met_Road,\"km\"\n",
      "print \"Total Additional Length of Unmetalled road is\", Tot_Len_Un_Road,\"km\"\n",
      "print \"Total length of both categories is\",Tot_Road,\"km\"\n",
      "print \"Road Length per 100sqkm is\",round(Road_Len_per,1),\"km\"\n",
      "print \"As road length per 100km^2 is near to 16km, the target is achieved\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total Additional length of metalled road is 750.0 km\n",
        "Total Additional Length of Unmetalled road is 600.0 km\n",
        "Total length of both categories is 2231.0 km\n",
        "Road Length per 100sqkm is 15.5 km\n",
        "As road length per 100km^2 is near to 16km, the target is achieved\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}