diff options
author | Trupti Kini | 2016-08-03 23:30:24 +0600 |
---|---|---|
committer | Trupti Kini | 2016-08-03 23:30:24 +0600 |
commit | f64be8c36d433bcb9e1e056f5ecf34093f03e935 (patch) | |
tree | ae0f8c23ed1868b8ee6d017b66dcfc53fe1561bd /sample_notebooks | |
parent | da0939454d10f0b844331734667e8faa146da8a0 (diff) | |
download | Python-Textbook-Companions-f64be8c36d433bcb9e1e056f5ecf34093f03e935.tar.gz Python-Textbook-Companions-f64be8c36d433bcb9e1e056f5ecf34093f03e935.tar.bz2 Python-Textbook-Companions-f64be8c36d433bcb9e1e056f5ecf34093f03e935.zip |
Added(A)/Deleted(D) following books
A 1000_solved_Problems_in_Fluid_Mechanics_includes_Hydraulic_machines_by_K.Subramanya/README.txt
A Fundamentals_Of_Aerodynamics_by_J._D._Anderson_Jr./README.txt
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/README.txt
A SURVYNG_AND_LEVELLING__by_N.N.BASAK/README.txt
A sample_notebooks/Harshitgarg/Chapter_1-INTRODUCTION_TO_MECHANICS_OF_SOLIDS__2.ipynb
A "sample_notebooks/KARTHIKEYAN S/CHAPTER_1.ipynb"
A sample_notebooks/NityaL/Sample-Chapter_26.ipynb
Diffstat (limited to 'sample_notebooks')
3 files changed, 710 insertions, 0 deletions
diff --git a/sample_notebooks/Harshitgarg/Chapter_1-INTRODUCTION_TO_MECHANICS_OF_SOLIDS__2.ipynb b/sample_notebooks/Harshitgarg/Chapter_1-INTRODUCTION_TO_MECHANICS_OF_SOLIDS__2.ipynb new file mode 100644 index 00000000..696f0022 --- /dev/null +++ b/sample_notebooks/Harshitgarg/Chapter_1-INTRODUCTION_TO_MECHANICS_OF_SOLIDS__2.ipynb @@ -0,0 +1,380 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example1.1 Page number 10\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The resultant velocity : 21.54 km/hour\n", + "68.2 °\n" + ] + } + ], + "source": [ + "#downstream direction as x\n", + "#direction across river as y\n", + "\n", + "from math import sqrt,atan,pi\n", + "\n", + "#variable declaration\n", + "\n", + "Vx= 8 #velocity of stream, km/hour\n", + "Vy=float(20) #velocity of boat,km/hour\n", + "\n", + "V=sqrt(pow(Vx,2)+pow(Vy,2)) #resultant velocity, km/hour\n", + "theta=Vy/Vx\n", + "\n", + "alpha= atan(theta)*180/pi #angle, degrees \n", + "\n", + "print \" The resultant velocity :\",round(V,2),\"km/hour\"\n", + "print round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 1.2 Page number 10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10.0 KN (to the left)\n", + "17.32 KN (downward)\n" + ] + } + ], + "source": [ + "\n", + "\n", + "\n", + "#components of force in horizontal and vertical components. \n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "\n", + "F= 20 #force in wire, KN\n", + "\n", + "#calculations\n", + "Fx= F*cos(60*pi/180) \n", + "Fy= F*sin(60*pi/180)\n", + "\n", + "print round(Fx,2),\"KN\" ,\"(to the left)\"\n", + "print round(Fy,2), \"KN\" ,\"(downward)\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 1.3 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Component normal to the plane : 9.4 KN\n", + "Component parallel to the plane : 3.42 KN\n" + ] + } + ], + "source": [ + "\n", + "\n", + " #The plane makes an angle of 20° to the horizontal. Hence the normal to the plane makes an angles of 70° to the horizontal i.e., 20° to the vertical\n", + "from math import cos,sin,pi\n", + "#variable declaration\n", + "W= 10 # black weighing, KN\n", + "\n", + "#calculations\n", + "\n", + "Nor= W*cos(20*pi/180) #Component normal to the plane\n", + "para= W*sin(20*pi/180) #Component parallel to the plane\n", + "\n", + "print \"Component normal to the plane :\",round(Nor,2),\"KN\"\n", + "print \"Component parallel to the plane :\",round(para,2) , \"KN\"\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 1.4 Page number 11" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 100.0 N\n", + "F2= 200.0 N\n", + "theta= 63.9 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let the magnitude of the smaller force be F. Hence the magnitude of the larger force is 2F\n", + "\n", + "from math import pi,sqrt, acos\n", + "#variable declaration\n", + "R1=260 #resultant of two forces,N\n", + "R2=float(180) #resultant of two forces if larger force is reversed,N\n", + "\n", + "\n", + "\n", + "#calculations\n", + "\n", + "F=sqrt((pow(R1,2)+pow(R2,2))/10)\n", + "F1=F\n", + "F2=2*F\n", + "theta=acos((pow(R1,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*180/pi\n", + "\n", + "print \"F1=\",F1,\"N\"\n", + "print \"F2=\",F2,\"N\"\n", + "print \"theta=\",round(theta,1),\"°\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 1.5 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F1= 326.35 N\n", + "F2= 223.24 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ?ABC be the triangle of forces drawn to some scale\n", + "#Two forces F1 and F2 are acting at point A\n", + "#angle in degrees '°'\n", + "\n", + "from math import sin,pi\n", + " \n", + "#variabble declaration\n", + "cnv=pi/180\n", + "\n", + "BAC = 20*cnv #Resultant R makes angle with F1 \n", + " \n", + "ABC = 130*cnv \n", + "\n", + "ACB = 30*cnv \n", + "\n", + "R = 500 #resultant force,N\n", + "\n", + "#calculations\n", + "#sinerule\n", + "\n", + "F1=R*sin(ACB)/sin(ABC)\n", + "F2=R*sin(BAC)/sin(ABC)\n", + "\n", + "print \"F1=\",round(F1,2),\"N\"\n", + "print \"F2=\",round(F2,2),\"N\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 1.6 Page number 12" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 78.13 °\n", + "alpha= 29.29 °\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#Let ABC be the triangle of forces,'theta' be the angle between F1 and F2, and 'alpha' be the angle between resultant and F1 \n", + "\n", + "from math import sin,acos,asin,pi\n", + "\n", + "#variable declaration\n", + "cnv= 180/pi\n", + "F1=float(400) #all forces are in newtons,'N'\n", + "F2=float(260)\n", + "R=float(520)\n", + "\n", + "#calculations\n", + "\n", + "theta=acos((pow(R,2)-pow(F1,2)-pow(F2,2))/(2*F1*F2))*cnv\n", + "\n", + "alpha=asin(F2*sin(theta*pi/180)/R)*cnv\n", + "\n", + "print\"theta=\",round(theta,2),\"°\"\n", + "print \"alpha=\",round(alpha,2),\"°\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# example 1.7 Page number 13" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "horizontal component= 2814.2 N\n", + "Vertical component = 1039.2 N\n", + "Component along crank = 507.1 N\n", + "Component normal to crank= 2956.8 N\n" + ] + } + ], + "source": [ + "\n", + "\n", + "#The force of 3000 N acts along line AB. Let AB make angle alpha with horizontal.\n", + "\n", + "from math import cos,sin,pi,asin,acos\n", + "\n", + "#variable declaration\n", + "F=3000 #force in newtons,'N'\n", + "BC=80 #length of crank BC, 'mm'\n", + "AB=200 #length of connecting rod AB ,'mm'\n", + "theta=60*pi/180 #angle b/w BC & AC\n", + "\n", + "#calculations\n", + "\n", + "alpha=asin(BC*sin(theta)/200)*180/pi\n", + "\n", + "HC=F*cos(alpha*pi/180) #Horizontal component \n", + "VC= F*sin(alpha*pi/180) #Vertical component \n", + "\n", + "#Components along and normal to crank\n", + "#The force makes angle alpha + 60 with crank.\n", + "alpha2=alpha+60\n", + "CAC=F*cos(alpha2*pi/180) # Component along crank \n", + "CNC= F*sin(alpha2*pi/180) #Component normal to crank \n", + "\n", + "\n", + "print \"horizontal component=\",round(HC,1),\"N\"\n", + "print \"Vertical component = \",round(VC,1),\"N\"\n", + "print \"Component along crank =\",round(CAC,1),\"N\"\n", + "print \"Component normal to crank=\",round(CNC,1),\"N\"" + ] + } + ], + "metadata": { + "anaconda-cloud": {}, + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/sample_notebooks/KARTHIKEYAN S/CHAPTER_1.ipynb b/sample_notebooks/KARTHIKEYAN S/CHAPTER_1.ipynb new file mode 100644 index 00000000..8f5d99cb --- /dev/null +++ b/sample_notebooks/KARTHIKEYAN S/CHAPTER_1.ipynb @@ -0,0 +1,104 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CHAPTER 1:Fundmentals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## EXAMPLE 1.1,PAGE NUMBER:3" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Carnot COP= 6.0 (error)\n" + ] + } + ], + "source": [ + "\n", + "import math\n", + "\n", + "#Variable Declaration\n", + "T_0=-5+273;\n", + "T_1=35+273;\n", + "\n", + "#Calculation\n", + "COP=(T_0)/(T_1-T_0);# Coefficient of performance\n", + "print \"Carnot COP=\",round(COP,2),\"(error)\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## EXAMPLE 1.2,PAGE NUMBER:4" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The average specific heat capacity is 4.186 kJ/(kg K)\n" + ] + } + ], + "source": [ + "\n", + "import math\n", + "\n", + "#Variable Declaration\n", + "T_f=80;# Final Temperature in °C\n", + "T_i=0;# Initial Temperature in °C\n", + "h_f=334.91;#The specific enthalpy of water in kJ/kg\n", + "\n", + "#Calculation\n", + "C=h_f/(T_f-T_i);# The average specifi c heat capacity in kJ/(kg K)\n", + "print \"The average specific heat capacity is\",round(C,3),\"kJ/(kg K)\"\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/sample_notebooks/NityaL/Sample-Chapter_26.ipynb b/sample_notebooks/NityaL/Sample-Chapter_26.ipynb new file mode 100644 index 00000000..4ae1c760 --- /dev/null +++ b/sample_notebooks/NityaL/Sample-Chapter_26.ipynb @@ -0,0 +1,226 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 26:CHARGE AND MATTER" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 26.1 Magnitude of total charges in a copper penny" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Magnitude of the charges in coulombs is 133687.50000000003\n" + ] + } + ], + "source": [ + "#Example 1.1\n", + "\n", + "m =3.1 #mass of copper penny in grams\n", + "e =4.6*10** -18 #charge in coulombs\n", + "N0 =6*10**23 #avogadro’s number atoms / mole\n", + "M =64 #molecular weight of copper in gm/ mole\n", + "\n", + "#Calculation\n", + "N =( N0 * m ) / M #No. of copper atoms in penny\n", + "q = N * e # magnitude of the charges in coulombs\n", + "print (\" Magnitude of the charges in coulomb is \",q )" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 26.2 Separation between total positive and negative charges" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Separation between total positive and negative charges in meters is 5813776741.499454\n" + ] + } + ], + "source": [ + "#Example 2\n", + "\n", + "import math\n", + "\n", + "F =4.5 #Force of attraction in nt\n", + "q =1.3*10**5 #total charge in coulomb\n", + "r = q * math.sqrt ((9*10**9) / F ) ;\n", + "print(\" Separation between total positive and negative charges in meters is \",r )" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 26.3 Force acting on charge q1" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "X component of resultant force acting on q1 in nt is 2.0999999999999996\n", + "Y component of resultant force acting on q1 in nt is -1.5588457268119893\n" + ] + } + ], + "source": [ + "#Example 3\n", + "\n", + "import math\n", + "\n", + "#given three charges q1,q2,q3\n", + "q1=-1.0*10**-6 #charge in coul\n", + "q2=+3.0*10**-6 #charge in coul\n", + "q3=-2.0*10**-6 #charge in coul\n", + "r12=15*10**-2 #separation between q1 and q2 in m\n", + "r13=10*10**-2 # separation between q1 and q3 in m\n", + "angle=math.pi/6 #in degrees\n", + "F12=(9.0*10**9)*q1*q2/(r12**2) #in nt\n", + "F13=(9.0*10**9)*q1*q3/(r13**2) #in nt\n", + "F12x=-F12 #ignoring signs of charges\n", + "F13x=F13*math.sin(angle);\n", + "F1x=F12x+F13x\n", + "F12y=0 #from fig.263\n", + "F13y=-F13*math.cos(angle);\n", + "F1y=F12y+F13y #in nt\n", + "print(\"X component of resultant force acting on q1 in nt is\",F1x)\n", + "print(\"Y component of resultant force acting on q1 in nt is\",F1y)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 26.4 Electrical and Gravitational force between two particles" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Coulomb force in nt is 8.202207191171238e-08\n", + "Gravitational force in nt is 3.689889640441438e-47\n" + ] + } + ], + "source": [ + "#Example 4\n", + "\n", + "r=5.3*10**-11 #distance between electron and proton in the hydrogen atom in meter\n", + "e=1.6*10**-19 #charge in coul\n", + "G=6.7*10**-11 #gravitatinal constant in nt-m2/kg2\n", + "m1=9.1*10**-31 #mass of electron in kg\n", + "m2=1.7*10**-27 #mass of proton in kg\n", + "F1=(9*10**9)*e*e/(r**2) #coulomb's law\n", + "F2=G*m1*m2/(r**2) #gravitational force\n", + "print(\"Coulomb force in nt is\",F1)\n", + "print(\"Gravitational force in nt is\",F2)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "# Example 26.5 Repulsive force between two protons in a nucleus of iron" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Repulsive coulomb force F 14.4 nt\n" + ] + } + ], + "source": [ + "#Example 5\n", + "\n", + "r=4*10**-15 #separation between proton annd nucleus in iron in meters\n", + "q=1.6*10**-19 #charge in coul\n", + "F=(9*10**9)*(q**2)/(r**2) #coulomb's law\n", + "print(\"Repulsive coulomb force F \",F,'nt')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [Root]", + "language": "python", + "name": "Python [Root]" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.12" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |