summaryrefslogtreecommitdiff
path: root/Engineering_Physics/chapter8_2.ipynb
diff options
context:
space:
mode:
authorJovina Dsouza2014-06-18 12:43:07 +0530
committerJovina Dsouza2014-06-18 12:43:07 +0530
commit206d0358703aa05d5d7315900fe1d054c2817ddc (patch)
treef2403e29f3aded0caf7a2434ea50dd507f6545e2 /Engineering_Physics/chapter8_2.ipynb
parentc6f0d6aeb95beaf41e4b679e78bb42c4ffe45a40 (diff)
downloadPython-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.tar.gz
Python-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.tar.bz2
Python-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.zip
adding book
Diffstat (limited to 'Engineering_Physics/chapter8_2.ipynb')
-rw-r--r--Engineering_Physics/chapter8_2.ipynb133
1 files changed, 133 insertions, 0 deletions
diff --git a/Engineering_Physics/chapter8_2.ipynb b/Engineering_Physics/chapter8_2.ipynb
new file mode 100644
index 00000000..c344140a
--- /dev/null
+++ b/Engineering_Physics/chapter8_2.ipynb
@@ -0,0 +1,133 @@
+{
+ "metadata": {
+ "name": "chapter8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Physics of Nano Materials"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.1, Page number 320"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the surface area to volume ratio\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=5; #radius in m\npi=3.14;\n\n#Calculation \nSA=4*pi*r**2; #surface area of sphere in m^2\nV=(4/3)*pi*r**3; #volume of sphere in m^3\nR=SA/V; #ratio\n#surface area to volume ratio can also be given by 3/radius\n\n#Result\nprint(\"surface area to volume ratio of sphere in m-1 is\",R);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('surface area to volume ratio of sphere in m-1 is', 0.6)\n"
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.2, Page number 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the surface area to volume ratio\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nd=26; #distance in m\nr=d/2; #radius in m\npi=3.14;\n\n#Calculation\nSA=4*pi*r**2; #surface area of sphere in m^2\nV=(4/3)*pi*r**3; #volume of sphere in m^3\nR=SA/V; #ratio\nR=math.ceil(R*10**3)/10**3; #rounding off to 3 decimals\n#surface area to volume ratio can also be given by 3/radius\n\n#Result\nprint(\"surface area to volume ratio of sphere in m-1 is\",R);",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('surface area to volume ratio of sphere in m-1 is', 0.231)\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.3, Page number 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the volume of cone\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=1; #radius in m\nh=1; #height in m\npi=3.14\n\n#Calculation\nV=(1/3)*pi*(r**2)*h;\nV=math.ceil(V*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"volume of cone in m^3 is\",V); ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('volume of cone in m^3 is', 1.05)\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.4, Page number 321"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the total surface area of cone\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nr=3; # radius in m\nh=4; # height in m\npi=3.14\n\n#Calculation\nSA=pi*r*math.sqrt((r**2)+(h**2));\nTSA=SA+(pi*r**2);\n\n#Result\nprint(\"total surface area of cone in m^2 is\",TSA);\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('total surface area of cone in m^2 is', 75.36)\n"
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 8.5, Page number 322"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# To calculate the height of cone\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable decleration\nV=100; #volume of cone in cubic inches\nr=5; #radius of cone in inches\npi=3.14;\n\n#Calculation\nr_m=r*0.0254; #radius of cone in m\n#volume V=(1/3)*pi*(r**2)*h\n#therefore h = (3*V)/(pi*r**2)\nh=(3*V)/(pi*r**2); #height in inches\nR=3/r_m;\nh=math.ceil(h*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"height of the cone in inches is\",h);\nprint(\"surface area to volume ratio in m-1 is\",R);\n\n#answer for the surface area to volume ratio given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "('height of the cone in inches is', 3.822)\n('surface area to volume ratio in m-1 is', 23.62204724409449)\n"
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file