summaryrefslogtreecommitdiff
path: root/Solid_Mechanics/Chapter6.ipynb
diff options
context:
space:
mode:
authorhardythe12015-06-03 15:27:17 +0530
committerhardythe12015-06-03 15:27:17 +0530
commitdf60071cf1d1c18822d34f943ab8f412a8946b69 (patch)
treeab059cf19bad4a1233a464ccf5d72cf8b3fb323c /Solid_Mechanics/Chapter6.ipynb
parentfba055ce5aa0955e22bac2413c33493b10ae6532 (diff)
downloadPython-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.gz
Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.bz2
Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.zip
add books
Diffstat (limited to 'Solid_Mechanics/Chapter6.ipynb')
-rwxr-xr-xSolid_Mechanics/Chapter6.ipynb813
1 files changed, 813 insertions, 0 deletions
diff --git a/Solid_Mechanics/Chapter6.ipynb b/Solid_Mechanics/Chapter6.ipynb
new file mode 100755
index 00000000..ce9f3b90
--- /dev/null
+++ b/Solid_Mechanics/Chapter6.ipynb
@@ -0,0 +1,813 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:896289250902762570d264c824478fdd14a2d522b88f8b0060498f7db1b84675"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Torision;Including Non-Circular Sections"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization o variables\n",
+ "#find the shear force on each rivet and suitable diameter of rivets\n",
+ "p=5. ##cm\n",
+ "D=10. ##cm\n",
+ "d=2. ##mm\n",
+ "T= 10. ##kgm\n",
+ "ss= 785. ##kg/cm^2\n",
+ "## calculations\n",
+ "P= 2.*T/(math.pi*D**2)\n",
+ "P=P*5*100.\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Force per rivet is ',P,' kg')\n",
+ "print'%s %.2f %s'%('\\n The diameter of rivet, using a permissible stress of',ss,' kg/cm^2 = 0.227 cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force per rivet is 31.83 kg\n",
+ "\n",
+ " The diameter of rivet, using a permissible stress of 785.00 kg/cm^2 = 0.227 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#what is maximum torque\n",
+ "D=5. ##cm\n",
+ "Y=3500. ##kg/cm^2\n",
+ "\n",
+ "##part (a)\n",
+ "Ta=350. ##kg-m\n",
+ "tau=Y/2.\n",
+ "Ip=Ta*D*100./(2.*tau)\n",
+ "d1=Ip*32./math.pi\n",
+ "d1=(D**4-d1)**(1/4.)\n",
+ "\n",
+ "##part (b)\n",
+ "Tb= 700. ##kg-m\n",
+ "Ip=Tb*D*100./(2.*tau)\n",
+ "d2=Ip*32./math.pi\n",
+ "d2=(D**4-d2)\n",
+ "T=tau*math.pi*(D**4)*2./(32.*D)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum diameter corresponding to the case a is ',d1,' cm')\n",
+ "print'%s %.2f %s'%('\\n Since the daimeter for the case (b) is coming out to be negative, \\n The maximum torque transmitted is ',T/100,' kg-m')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum diameter corresponding to the case a is 3.28 cm\n",
+ "\n",
+ " Since the daimeter for the case (b) is coming out to be negative, \n",
+ " The maximum torque transmitted is 429.51 kg-m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the weight of students\n",
+ "A=3 ##cm^2\n",
+ "E= 2*10**6 ##kg/cm^2\n",
+ "nu= 0.25\n",
+ "l= 60. ##m\n",
+ "L=150. ##cm\n",
+ "d=0.5 ##cm\n",
+ "dd=10 ##cm\n",
+ "D=180 ##cm\n",
+ "##calculations\n",
+ "K=(l*100./(A*E))+(L*D/2.*D*32.*2.*(1.+nu)/(E*math.pi*dd**4*2))\n",
+ "P=d/K\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The weight of the students that entered the length is',P,' kg')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The weight of the students that entered the length is 196.31 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the stress in the cable and the shaft\n",
+ "## linked to 6_5\n",
+ "A=3. ##cm^2\n",
+ "E= 2.*10**6 ##kg/cm^2\n",
+ "nu= 0.25\n",
+ "l= 60. ##m\n",
+ "L=150. ##cm\n",
+ "d=0.5 ##cm\n",
+ "dd=10 ##cm\n",
+ "D=180. ##cm\n",
+ "##calculations\n",
+ "K=(l*100./(A*E))+(L*D/2.*D*32.*2.*(1+nu)/(E*math.pi*dd**4*2.))\n",
+ "P=d/K\n",
+ "Ts=P/A\n",
+ "fs=dd*D*P*32./(math.pi*4.*dd**4)\n",
+ "\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The tensile stress is ',Ts,'kg/cm^2')\n",
+ "print'%s %.2f %s'%('\\n Maximum shear stress is ',fs,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The tensile stress is 65.44 kg/cm^2\n",
+ "\n",
+ " Maximum shear stress is 89.98 kg/cm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the value of x and length of the suspension arm and D\n",
+ "F=500. ##kg\n",
+ "k=25. ##kg/cm\n",
+ "dd=15. ##cm\n",
+ "ss=3500. ##kg/cm^2\n",
+ "L=2. ##m\n",
+ "G=8.*10**5 ##kg/cm^2\n",
+ "## calculations\n",
+ "x=math.sqrt(math.pi*G/(25.*L*32.*100.))\n",
+ "d=x*16.*(F+dd*k)/(ss*math.pi)\n",
+ "x2=x*d**2.\n",
+ "## results\n",
+ "print'%s %.2f %s'%('d=',d,' cm')\n",
+ "print'%s %.2f %s'%('\\n x=',x,' cm')\n",
+ "\n",
+ "## Text: not exact\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "d= 5.05 cm\n",
+ "\n",
+ " x= 3.96 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the horse power\n",
+ "d=5. ##cm\n",
+ "rpm1=300. ##rpm\n",
+ "rpm2=30000. ##rpm\n",
+ "s=1000. ##kg/cm^2\n",
+ "##calcuations\n",
+ "T=(d/2.)*math.pi*10**2*s/32.\n",
+ "hp1= 2*math.pi*rpm1*T/4500.\n",
+ "hp2=hp1*100.\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s'%('Horse power at 300 rpm and 30000 rpm are respecively ',hp1/10,''and '',hp2/10,' h.p.')\n",
+ "\n",
+ "print('wrong/approximate answers in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Horse power at 300 rpm and 30000 rpm are respecively 1028.08 102808.38 h.p.\n",
+ "wrong/approximate answers in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Ex12-pg200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#selct solid transmits and diameter required find\n",
+ "hp=300. ##h.p.\n",
+ "N1=30. ##rpm\n",
+ "N2=30000. ##rpm\n",
+ "fs=600. ##kg/cm^2\n",
+ "## calculations\n",
+ "T1=4500.*hp*100./(2.*math.pi*N1)\n",
+ "T2=T1/1000.\n",
+ "D1=16.*T1/(math.pi*fs)\n",
+ "D1=D1**(1/3.)\n",
+ "D2=16.*T2/(math.pi*fs)\n",
+ "D2=D2**(1/3.)\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('Diameters required are ',D1,''and '',D2,'cm')\n",
+ "\n",
+ "print('wrong calculations in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameters required are 18.25 1.83 cm \n",
+ "wrong calculations in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#find the strain energy per unit volume stored and the energy if the lenght 5cm \n",
+ "d=10. ##cm\n",
+ "t =1. ##mm\n",
+ "T= 100. ##kg-m\n",
+ "L=5. ##m\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "\n",
+ "##calculations\n",
+ "r=d/2.\n",
+ "fs=T*r*100./(r**2*2*math.pi*L*t*10**-1)\n",
+ "U=fs**2/(2*G)\n",
+ "U1=U*(math.pi*L*100.)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('Energy per unit volume = ',U,' kg-cm/cm^3')\n",
+ "print'%s %.2f %s'%('\\n Total strain energy= ',U1,' kg-cm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy per unit volume = 0.25 kg-cm/cm^3\n",
+ "\n",
+ " Total strain energy= 397.89 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the actual deflection of closely coiled comperssion spring\n",
+ "D=10. ##cm\n",
+ "d= 1. ##cm\n",
+ "n=20.\n",
+ "P=60. ##kg\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "##calculations\n",
+ "n=n-0.75*2\n",
+ "delta=P*n*math.pi*D**3*32./(4.*math.pi*G)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The deflection is ',delta,' cm')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The deflection is 11.10 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the shear stress in the wire\n",
+ "## linked to 6_14\n",
+ "D=10. ##cm\n",
+ "d= 1. ##cm\n",
+ "n=20.\n",
+ "P=60. ##kg\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "## calculations\n",
+ "m=D/d\n",
+ "fs=8.*P*D/(d**3*math.pi)\n",
+ "fs1=fs*(1+0.615/m+3./(4.*m-4.))\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('The shear stress with and without correction facor are \\n respectively ',fs,''and '',fs1,'kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The shear stress with and without correction facor are \n",
+ " respectively 1527.89 1749.18 kg/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find their angles of twist and maximum stresses\n",
+ "\n",
+ "## circle\n",
+ "D=1. ##unit diameter\n",
+ "Ip=D**4/32.\n",
+ "Zp=D**3/16.\n",
+ "\n",
+ "##Square\n",
+ "s=math.sqrt(math.pi/4.)*D\n",
+ "Is=0.886*D**4/32.\n",
+ "Zs=0.7383*D**3/16.\n",
+ "\n",
+ "##Rectangle\n",
+ "a=math.sqrt(math.pi/2.)*D\n",
+ "b=math.sqrt(math.pi/8.)*D\n",
+ "Ir=0.719*D**4/32.\n",
+ "Zr=0.616*D**3/16.\n",
+ "\n",
+ "## Trianle\n",
+ "t=math.sqrt(math.pi/math.sqrt(3))*D\n",
+ "It=0.725*D**4/32.\n",
+ "Zt=0.622*D**3/16.\n",
+ "\n",
+ "##Ellipse\n",
+ "A=D/math.sqrt(2)\n",
+ "B=D/math.sqrt(8)\n",
+ "Ie=A**3*B**3/(A**2+B**2)\n",
+ "Ze=A*B**2/2.\n",
+ "\n",
+ "##Normalization\n",
+ "Is=Is/Ip\n",
+ "Ie=Ie/Ip\n",
+ "It=It/Ip\n",
+ "Ir=Ir/Ip\n",
+ "\n",
+ "Zs=Zs/Zp\n",
+ "Ze=Ze/Zp\n",
+ "Zt=Zt/Zp\n",
+ "Zr=Zr/Zp\n",
+ "Ip=1.\n",
+ "Zp=1.\n",
+ "##results\n",
+ "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('Z:: Circle:Square:Ellipse:Triangle:Rectangle = ',Zp,'' and '',Zs,'' and '',Ze,'' and '',Zt,' 'and '',Zr,'')\n",
+ "\n",
+ "print'%s %.2f %s %.2f %s %.2f %s %.2f %s %.2f %s '%('\\n I:: Circle:Square:Ellipse:Triangle:Rectangle = ',Ip,'' and '',Is,'' and '',Ie,'' and '',It,'' and '',Ir,'')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Z:: Circle:Square:Ellipse:Triangle:Rectangle = 1.00 0.74 0.71 0.62 0.62 \n",
+ "\n",
+ " I:: Circle:Square:Ellipse:Triangle:Rectangle = 1.00 0.89 0.80 0.72 0.72 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the maximum torque that can be transmitted without yeilding\n",
+ "\n",
+ "yp=2450. ##kg/cm^2\n",
+ "d=0.4 ##cm\n",
+ "ys=4200. ##kg/cm^2\n",
+ "sa=1.6 ##mm\n",
+ "sb=7. ##mm\n",
+ "## calculations\n",
+ "sa=sa/10.\n",
+ "sb=sb/10.\n",
+ "T1=yp*math.pi*d**3/16.\n",
+ "T2=ys*0.303*sa**2*sb\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum torque that can be transitted by the screw-driver is ',T2,' kg-cm')\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum torque that can be transitted by the screw-driver is 22.80 kg-cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the maximum stress in the walls \n",
+ "b=5. ##cm\n",
+ "h=10. ##cm\n",
+ "tL=3. ##mm\n",
+ "tl=1.5 ##mm\n",
+ "T=100. ##kg-cm\n",
+ "## calculations\n",
+ "tl=tl/10.\n",
+ "fs=T*100./(2.*b*h*tl)\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The maximum stress is ',fs,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum stress is 666.67 kg/cm^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg216"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#compare its strength with hollow circular shaft of same thickness\n",
+ "b=5. ##cm\n",
+ "h=10. ##cm\n",
+ "tL=3. ##mm\n",
+ "tl=1.5 ##mm\n",
+ "T=100. ##kg-cm\n",
+ "## calculations\n",
+ "D=2.*(b+h)/math.pi\n",
+ "AR=b*h\n",
+ "AC=math.pi*D**2/4.\n",
+ "r=AC/AR\n",
+ "## results\n",
+ "print'%s %.2f %s'%('The ratio is 1:',r,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio is 1: 1.43 \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg217"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##initialization of variables\n",
+ "#find the value of maximum shear stress and angle of twist\n",
+ "G=8*10**5 ##kg/cm^2\n",
+ "##part (a)\n",
+ "T =20. ##kg-m\n",
+ "t1=0.9 ##cm\n",
+ "t2=0.5 ##cm\n",
+ "b1=6.8 ##cm\n",
+ "b2=14.2 ##cm\n",
+ "I0=1/3.*(2.*b1*t1**3+b2*t2**3)\n",
+ "Zt=I0/max(t1,t2)\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100./(G*I0)\n",
+ "print('part (a)')\n",
+ "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and'',Phi, ' radians/cm ')\n",
+ "\n",
+ "##part (b)\n",
+ "t1=1. ##cm\n",
+ "t2=1. ##cm\n",
+ "b1=10. ##cm\n",
+ "b2=9. ##cm\n",
+ "I0=1/3.*(b1*t1**3+b2*t2**3)\n",
+ "Zt=I0/max(t1,t2)\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100/(G*I0)\n",
+ "print('\\n part (b)')\n",
+ "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,'kg/cm^2'and '',Phi,'radians/cm ')\n",
+ "\n",
+ "##part (c)\n",
+ "t1=0.76 ##cm \n",
+ "t2=0.48 ##cm\n",
+ "b1=8. ##cm\n",
+ "b2=14.04 ##cm\n",
+ "I0=(1/3.)*(2*b1*t1**3+b2*t2**3)\n",
+ "Zt=I0/max(t1,t2)\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100./(G*I0)\n",
+ "print('\\n part (c)')\n",
+ "print'%s %.2f %s %.5f %s ' %('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and '',Phi,'radians/cm ')\n",
+ "\n",
+ "##part(d)\n",
+ "t=1 ##cm \n",
+ "b=19 ##cm\n",
+ "I0=1/3.*t**3*b\n",
+ "Zt=I0/t\n",
+ "fs=T*100./Zt\n",
+ "Phi=T*100./(G*I0)\n",
+ "print('\\n part (d)')\n",
+ "print'%s %.2f %s %.5f %s '%('\\n The maximum shear stress and twist rate are respectively \\n ',fs,' kg/cm^2'and '',Phi,'radians/cm ')\n",
+ "\n",
+ "print('Twist rate: answers differ by a scale of 10. wrong answers in the text')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part (a)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 461.96 0.00064 radians/cm \n",
+ "\n",
+ " part (b)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 315.79 0.00039 radians/cm \n",
+ "\n",
+ " part (c)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 531.70 0.00087 radians/cm \n",
+ "\n",
+ " part (d)\n",
+ "\n",
+ " The maximum shear stress and twist rate are respectively \n",
+ " 315.79 0.00039 radians/cm \n",
+ "Twist rate: answers differ by a scale of 10. wrong answers in the text\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex21-pg221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "## initialization of variables\n",
+ "#caclualte Maximum +ve residual stress occurs at r and'radius\n",
+ "D=5. ##cm\n",
+ "d=2. ##cm\n",
+ "t_y=3000. ##kg/cm^2\n",
+ "## calculations\n",
+ "R=D/2. \n",
+ "r=d/2. \n",
+ "Tep=2.*math.pi*R**3*t_y/3.-math.pi*r**3.*t_y/6.\n",
+ "t_er=2*Tep/(math.pi*R**3)\n",
+ "t_er1=t_er*r/R\n",
+ "prs=t_y-t_er1\n",
+ "nrs=t_er-t_y\n",
+ "## results\n",
+ "print'%s %.2f %s %.2f %s '%('Maximum +ve residual stress occurs at ',r,' cm' and'radius and is equal to \\n ',prs,' kg/cm^2')\n",
+ "print'%s %.2f %s %.2f %s '%('\\n Maximum -ve residual stress occurs at ',R,' cm'and' radius and is equal to \\n ',-nrs,' kg/cm^2')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum +ve residual stress occurs at 1.00 radius and is equal to \n",
+ " 1425.60 kg/cm^2 \n",
+ "\n",
+ " Maximum -ve residual stress occurs at 2.50 radius and is equal to \n",
+ " -936.00 kg/cm^2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file