{ "metadata": { "name": "", "signature": "sha256:b2511135f67d993f9545458e234822b8b9ce052d6d1f7413c45653c1b17f1152" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter4-Mechanical Behavior of Materials" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex1-pg101" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate diameterof the bar in all cases\n", "import numpy\n", "from numpy.linalg import inv\n", "sigmayp=350. ##MPa\n", "sigma3=0.\n", "M=8. ##kN\n", "Mt=24. ##kNm\n", "N=2.\n", "v=0.3\n", "\n", "## sigma= My/I ==32M/%pid**3\n", "## tau= Mt*r/J ==16Mt/%pid**3\n", "##sigma1=(16*(M+sqrt(M**2+Mt**2)))/(%pi*d**3)\n", "##sigma2=(16*(M-sqrt(M**2+Mt**2)))/(%pi*d**3)\n", "\n", "##solution a: max principal stress theory\n", "##(16*(M+sqrt(M**2+Mt**2)))/(%pi*d**3)=sigmayp/N\n", "\n", "a=(16.*(M+math.sqrt(M**2.+Mt**2.)))/math.pi\n", "print(a)\n", "b=sigmayp*10**6./N\n", "print(b)\n", "d=(a/b)**(1/3.)\n", "print'%s %.5f %s'%(\"diameter of the bar in meter is= \",d,\"\")\n", "\n", "##solution b:max shearing stress theory\n", "\n", "c=(32.*math.sqrt(M**2.+Mt**2.))/math.pi\n", "print(c)\n", "d=(c/b)**(1/3.)\n", "print'%s %.5f %s'%(\"diameter of the bar in meter is= \",d,\"\")\n", "\n", "##solution c:max principal strain theory\n", "##epsilon1=(sigma1-v(sigma2+sigma3))/E=epsilonyp/N=sigmayp/EN Or\n", "##sigma1-v(sigma2+sigma3)=b given\n", "##sigma1=b+v(sigma2+sigma3) substituting the values of the sigma 1,2 and 3 we get\n", "##(16*(M+sqrt(M**2+Mt**2)-vM-v*sqrt(M**2+Mt**2)))/(%pi*d**3)=b\n", "e=(16.*(M+math.sqrt(M**2.+Mt**2.)-v*M-v*math.sqrt(M**2.+Mt**2.)))/math.pi\n", "print(e)\n", "d=(e/b)**(1/3.)\n", "print'%s %.5f %s'%(\"diameter of the bar in meter is= \",d,\"\")\n", "\n", "##solution d:max energy of distortion theory\n", "\n", "f=(16.*math.sqrt(4*M**2.+3.*Mt**2.))/math.pi\n", "print'%s %.5f %s'%(\"f\",f,\"\")\n", "d=(f/b)**(1/3.)\n", "print'%s %.5f %s'%(\"diameter of the bar in meter is= \",d,\"\")\n", "print(\"all the values are converted into meter\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "169.586448419\n", "175000000.0\n", "diameter of the bar in meter is= 0.00990 \n", "257.685565975\n", "diameter of the bar in meter is= 0.01138 \n", "118.710513893\n", "diameter of the bar in meter is= 0.00879 \n", "f 226.85113 \n", "diameter of the bar in meter is= 0.01090 \n", "all the values are converted into meter\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex3-pg107" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate max principal stress\n", "sigmau1=300. ##MPa\n", "sigmau2=700. ##MPa\n", "b=0.105 ##m outer diameter\n", "a=0.100 ##m inner diameter\n", "\n", "##sigma1==(-sigma2)==tau\n", "\n", "sigma3=0.\n", "\n", "##Mt=J*tau/r= (%pi*(b**2-a**2))/2*b\n", "##Mt=((%pi*(b**4-a**4))/(2*b))*tau equation a\n", "q=(math.pi*(b**4.-a**4.))/(2.*b)\n", "\n", "##solution a: max principal stress theory\n", "tau=sigmau1\n", "Mt=q*tau*10**6.\n", "print'%s %.2f %s'%(\"max principal stress in Nm is= \",Mt,\"\")\n", "\n", "##solution b:max shearing stress theory\n", "## |sigma1-sigma2|=sigmau1\n", "## 2*sigma1==sigmau1==2*tau or\n", "\n", "Mt=q*tau*10**6\n", "print'%s %.2f %s'%(\"max shearing stress in Nm is= \",Mt,\"\")\n", "\n", "##solution c:Coulomb- mohr theory\n", "##(tau/sigmau1)-(-tau/sigmau2)=1\n", "tau=1*((sigmau1*sigmau2)/(sigmau1+sigmau2))\n", "print'%s %.2f %s'%(\"tau in MPa is= \",tau,\"\")\n", "Mt=q*tau*10**6\n", "print'%s %.2f %s'%(\"Coulomb- mohr in Nm is= \",Mt,\"\")\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "max principal stress in Nm is= 96718.98 \n", "max shearing stress in Nm is= 96718.98 \n", "tau in MPa is= 210.00 \n", "Coulomb- mohr in Nm is= 67703.29 \n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex4-pg109" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate laod and intertia\n", "a=0.05 ## m\n", "Fm=90. ##kN\n", "sigmacr=210. ## MPa\n", "sigmayp=280. ## MPa\n", "\n", "##sigmaa=Ma*c/I equation 1\n", "##Ma=0.025*Fa\n", "c=0.025\n", "I=(a**4.)/12.\n", "print'%s %.7f %s'%(\"I\",I,\"\")\n", "##sigmaa=((0.025*Fa)*c)/I substituting the values\n", "\n", "\n", "##sigmam=Fm/A equation 2\n", "sigmam=Fm/(a*a)\n", "print'%s %.2f %s'%(\"in kilo Pa is= \",sigmam,\"\")\n", "\n", "##(((1200*Fa)/sigmacr)+(sigmam/sigmayp))=1\n", "Fa=(1.-(sigmam/sigmayp))*(sigmacr/1200.)\n", "print'%s %.2f %s'%(\"load Fa in N is= \",Fa,\"\") ##wrong ans in textbook\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "I 0.0000005 \n", "in kilo Pa is= 36000.00 \n", "load Fa in N is= -22.32 \n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex5-pg110" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate the value of pressure \n", "r=0.04 ##m\n", "t=5. ##mm\n", "sigmae=250. ##MPa\n", "sigmay=300. ##MPa\n", "\n", "##sigmathetamax=(p*r)/t =8*p max values of tangential stresses\n", "##sigmathetamin=((-p/4)*r)/t =-2*p min values of tangential stresses\n", "##sigmazamax=(p*r)/2*t =4*p axial principal stresses\n", "##sigmazmin=((-p/4)*r)/2*t =-p\n", "\n", "##sigmathetaa=(sigmathetamax-sigmathetamin)/2= 5p alternating and mean stresses\n", "##sigmathetam=(sigmathetamax+sigmathetamin)/2= 3p\n", "##sigmaza=(sigmazamax-sigmazmin)/2 =2.5p\n", "##sigmazm=(sigmazamax+sigmazmin)/2 =1.5p\n", "\n", "##sqrt(sigmathetaa**2-sigmathetaa*sigmaza+sigmaza**2)=sigmaea\n", "##sqrt(sigmathetam**2-sigmathetam*sigmazm+sigmazm**2)=sigmaem\n", "\n", "##sqrt(25p**2-12.3p**2+6.25p**2)=sigmaea\n", "##sqrt(9p**2-4.5p**2+2.25p**2)=sigmaem solving this equation we get\n", "sigmaea=4.33 ##p\n", "sigmaem=2.60 ##p\n", "\n", "p=1./((sigmaea/sigmae)+(sigmaem/sigmay))\n", "print'%s %.2f %s'%(\"the value of p in MPa is= \",p,\"\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the value of p in MPa is= 38.48 \n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6-pg112" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "import numpy\n", "from numpy.linalg import inv\n", "#find alternating and mean values of stresses and sigma and cycle\n", "a=([[700 ,14 ,0], [14, -350, 0],[0, 0, -350]])\n", "print(a)\n", "c=([[-660, -7, 0], [-7 ,-350, 0], [0, 0, -350]])\n", "print(c)\n", "sigmau=2400. ##MPa\n", "K=1.\n", "sigmae=800. ##MPa\n", "Nf=1. ##cycles for SAE\n", "Nff=10**3 ##cycles for Gerber\n", "Ne=10**8 ##cycles\n", "\n", "sigmaxa=(700.+660.)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",sigmaxa,\"\")\n", "sigmaxm=(700-660)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",sigmaxm,\"\")\n", "sigmaya=(-350+350)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",sigmaya,\"\")\n", "sigmaym=(-350-350)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",sigmaya,\"\")\n", "sigmazm=(-350-350)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",sigmazm,\"\")\n", "tauxya=(14+7)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",tauxya,\"\")\n", "tauxym=(14-7)/2.\n", "print'%s %.2f %s'%(\"alternating and mean values of stresses in MPa is= \",tauxym,\"\")\n", "\n", "sigmaea=math.sqrt(((sigmaxa-sigmaya)**2.+(sigmaya-sigmaxa)**2.+6.*(tauxya)**2.)/2.)\n", "print'%s %.2f %s'%(\"in MPa is =\",sigmae,\"\")\n", "sigmaem=math.sqrt(((sigmaxm-sigmaym)**2.+(sigmaym-sigmaxm)**2.+6.*(tauxym)**2.)/2.)\n", "print'%s %.2f %s'%(\"in MPa is= \",sigmaem,\"\")\n", "\n", "##solution a: \n", "sigmacr=sigmaea/(1-(sigmaem/2400.))\n", "print'%s %.3f %s'%(\"sigmacr\",sigmacr,\"\")\n", "b=math.log(sigmau/sigmae)/math.log(1./Ne)\n", "print'%s %.3f %s'%(\"b\",b,\"\")\n", "\n", "Ncr=1.*(sigmacr/2400.)**(1./b)\n", "print'%s %.3f %s'%(\"in cycles is= \",Ncr,\"\")\n", "\n", "##solution b:\n", "sigmacr=sigmaea/(1.-(sigmaem/sigmau)**2.)\n", "print'%s %.3f %s'%(\"in MPa is= \",sigmacr,\"\")\n", "b=math.log(2160./sigmae)/math.log(10**3./Ne)\n", "print'%s %.3f %s'%(\"b\",b,\"\")\n", "\n", "Ncr=Nff*(sigmacr/(0.9*2400))**(-11.587)\n", "print'%s %.3e %s'%(\"in cycles is= \",Ncr,\"\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[[700, 14, 0], [14, -350, 0], [0, 0, -350]]\n", "[[-660, -7, 0], [-7, -350, 0], [0, 0, -350]]\n", "alternating and mean values of stresses in MPa is= 680.00 \n", "alternating and mean values of stresses in MPa is= 20.00 \n", "alternating and mean values of stresses in MPa is= 0.00 \n", "alternating and mean values of stresses in MPa is= 0.00 \n", "alternating and mean values of stresses in MPa is= -350.00 \n", "alternating and mean values of stresses in MPa is= 10.50 \n", "alternating and mean values of stresses in MPa is= 3.50 \n", "in MPa is = 800.00 \n", "in MPa is= 370.05 \n", "sigmacr 804.248 \n", "b -0.060 \n", "in cycles is= 91502934.807 \n", "in MPa is= 696.809 \n", "b -0.086 \n", "in cycles is= 4.934e+08 \n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Ex7-pg115" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#calculate Inertia and deflection of a point in meter and impact factor and pressure and static deflection of the beam and impact facotr\n", "W=180. ##N\n", "h=0.1 ##m\n", "L=1.16 ##m\n", "w=0.025 ##m\n", "d=0.075 ##m\n", "E=200. ##GPa\n", "k=180. ##kN/m\n", "\n", "I=w*d**3.\n", "print'%s %.5f %s'%(\"I\",I,\"\")\n", "##deltast=(W*L**3)/(48*E*I) equation 1\n", "deltast=(W*L**3*12.)/(48.*E*10**9.*I)\n", "print'%s %.5f %s'%(\"deflection of a point in meter is= \",deltast,\"\")\n", "\n", "##deltastmax=Mc/I equation 2\n", "deltastmax=(W*L*12*0.0375)/(4*I)\n", "print'%s %.2f %s'%(\"deflection of a point in Pa is= \",deltastmax,\"\")\n", "\n", "##solution a:\n", "a=1+math.sqrt(1.+((2.*h)/deltast))\n", "print'%s %.2f %s'%(\"imapct factor is= \",a,\"\")\n", "deltamax=deltast*a\n", "print'%s %.2f %s'%(\"in meter is =\",deltastmax,\"\")\n", "sigmamax=deltastmax*a\n", "print'%s %.2f %s'%(\"in Pa is= \",sigmamax,\"\")\n", "\n", "##solution b:\n", "deltast=deltast+(90./180000.)\n", "print'%s %.5f %s'%(\"static deflection of the beam in meter is= \",deltast,\"\")\n", "a=1+math.sqrt(1.+((2.*h)/deltast))\n", "print'%s %.2f %s'%(\"imapct factor is= \",a,\"\")\n", "deltamax=deltast*a\n", "print'%s %.3f %s'%(\"in meter is =\",deltamax,\"\")\n", "sigmamax=deltastmax*a\n", "print'%s %.2f %s'%(\"in Pa is= \",sigmamax,\"\")\n", "#round off error\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "I 0.00001 \n", "deflection of a point in meter is= 0.00003 \n", "deflection of a point in Pa is= 2227200.00 \n", "imapct factor is= 78.51 \n", "in meter is = 2227200.00 \n", "in Pa is= 174848357.07 \n", "static deflection of the beam in meter is= 0.00053 \n", "imapct factor is= 20.39 \n", "in meter is = 0.011 \n", "in Pa is= 45415592.13 \n" ] } ], "prompt_number": 2 } ], "metadata": {} } ] }