{ "metadata": { "name": "", "signature": "sha256:1d0e8ca0a27c4b0cb17e7318d009efc3241a84a31e3f27c8ca705f6cb5276ce4" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 02:Natural Soil Deposits and Subsoil Exploration" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex2.1:Pg-109" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 2.1\n", "import matplotlib.pyplot as plt\n", "import numpy\n", "import math\n", "Distance=[2.5,5,7.5,10,15,20,25,30,35,40,50];\n", "Time=(10**(-3))*numpy.array([11.2,23.3,33.5,42.4,50.9,57.2,64.4,68.6,71.1,72.1,75.5])\n", "#part1\n", "distance=5.25; # in meter\n", "time=23e-3; # in second\n", "v1=distance/time;\n", "print round(v1,2),\"is speed in m/s\"\n", "#part2\n", "distance=11; # in meter\n", "time=13.5e-3;# in second\n", "v2=distance/time;\n", "print round(v2,2),\" is speed in m/s\"\n", "#part3\n", "distance=14.75;# in meter\n", "time=3.5e-3;# in second\n", "v3=distance/time;\n", "print round(v3,2),\"speed in m/s\"\n", "plt.plot(Distance,Time);\n", "plt.title(\"distance vs time\")\n", "plt.xlabel(\"Distance in m\")\n", "plt.ylabel(\"time in s\")\n", "plt.show()\n", "#part4\n", "xc=10.4;\n", "Ta=65e-3;\n", "Z1=1/2.0*math.sqrt((v2-v1)/(v2+v1))*xc;\n", "print round(Z1,2),\" is thickness of layer 1 in m\"\n", "Z2=1/2.0*(Ta-2*Z1*math.sqrt(v3**2-v1**2)/v3/v1)*v3*v2/math.sqrt(v3**2-v2**2);\n", "print round(Z2,2),\" is thickness of layer 2 in m\"\n", "\n", "# the answers are slightly different in textbook due to approximation while here answers are precise" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "228.26 is speed in m/s\n", "814.81 is speed in m/s\n", "4214.29 speed in m/s\n", "3.9" ] }, { "output_type": "stream", "stream": "stdout", "text": [ " is thickness of layer 1 in m\n", "12.82 is thickness of layer 2 in m\n" ] } ], "prompt_number": 10 } ], "metadata": {} } ] }