{
 "metadata": {
  "name": "",
  "signature": "sha256:1d0b1f24c9d10ade871ede95388991dbd93c7a64d0a0c3e5beb35a6a045b6a61"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3:Principal Stresses and Strains"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 3.8,page no.98"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "sigma1=100           #Major principal stress in N/sq.mm\n",
      "sigma2=-60           #Minor principal stress in N/sq.mm\n",
      "theta=90-50          #Angle of inclination in degrees\n",
      "\n",
      "#Calculation\n",
      "sigman=round(((sigma1+sigma2)/2)+(((sigma1-sigma2)/2)*math.cos(math.radians(2*theta))),2)\n",
      "sigmat=round((sigma1-sigma2)/2*(math.sin(math.radians(2*theta))),3)\n",
      "sigmaR=round(math.sqrt(sigman**2+sigmat**2),3)\n",
      "sigmat_max=int((sigma1-sigma2)/2)\n",
      "\n",
      "#Result\n",
      "print \"Normal stress =\",sigman,\"N/mm^2\"\n",
      "print \"Shear stress =\",sigmat,\"N/mm^2\"\n",
      "print \"Resultant stress =\",sigmaR,\"N/mm^2\"\n",
      "print \"Maximum shear stress =\",sigmat_max,\"N/mm^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Normal stress = 33.89 N/mm^2\n",
        "Shear stress = 78.785 N/mm^2\n",
        "Resultant stress = 85.765 N/mm^2\n",
        "Maximum shear stress = 80 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 3.9,page no.99"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "sigma1=100        #Major principal stress in N/sq.mm\n",
      "sigma2=-40        #Minor principal stress in N/sq.mm\n",
      "theta=90-60       #Angle of inclination in degrees\n",
      "\n",
      "#Calculation\n",
      "sigman=((sigma1+sigma2)/2)+(((sigma1-sigma2)/2)*math.cos(math.radians(2*theta)))\n",
      "sigmat=round((sigma1-sigma2)/2*(math.sin(math.radians(2*theta))),2)\n",
      "sigmaR=round(math.sqrt(sigman**2+sigmat**2),1)\n",
      "sigmat_max=int((sigma1-sigma2)/2)\n",
      "phi=int(math.degrees(math.atan(sigmat/sigman)))\n",
      "\n",
      "#Result\n",
      "print \"Resultant stress in magnitude =\",sigmaR,\"N/mm^2\"\n",
      "print \"Direction of resultant stress =\",phi,\"degrees\"\n",
      "print \"Maximum shear stress =\",sigmat_max,\"N/mm^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resultant stress in magnitude = 88.9 N/mm^2\n",
        "Direction of resultant stress = 43 degrees\n",
        "Maximum shear stress = 70 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 3.13,page no.111"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "sigma1=120       #Major tensile stress in N/sq.mm\n",
      "sigma2=-90       #Minor compressive stress in N/sq.mm\n",
      "sigma_gp=150     #Greatest principal stress in N/sq.mm\n",
      "\n",
      "#Calculation\n",
      " #case(a):Magnitude of the shearing stresses on the two planes\n",
      "tau=round(math.sqrt(((sigma_gp-((sigma1+sigma2)/2))**2)-(((sigma1-sigma2)/2)**2)),3)\n",
      " #case(b):Maximum shear stress at the point\n",
      "sigmat_max=int((math.sqrt((sigma1-sigma2)**2+(4*tau**2)))/2)\n",
      "\n",
      "#Result\n",
      "print \"Shear stress on the two planes =\",tau,\"N/mm^2\"\n",
      "print \"Maximum shear stress at the point =\",sigmat_max,\"N/mm^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Shear stress on the two planes = 84.853 N/mm^2\n",
        "Maximum shear stress at the point = 135 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Problem 3.16,page no.115"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given\n",
      "#Variable declaration\n",
      "sigma1=600        #Major tensile stress in N/sq.mm\n",
      "sigma2=300        #Minor tensile stress in N/sq.mm\n",
      "tau=450           #Shear stress in N/sq.mm\n",
      "theta1=45         #Angle of inclination in degrees\n",
      "theta2=135        #Angle of inclination in degrees\n",
      "\n",
      "#Calculation\n",
      "sigman1=int(((sigma1+sigma2)/2)+(((sigma1-sigma2)/2)*math.cos(math.radians(2*theta1)))+(tau*math.sin(math.radians(2*theta1))))                                                    \n",
      "sigman2=int(((sigma1+sigma2)/2)+(((sigma1-sigma2)/2)*math.cos(math.radians(2*theta2)))+(tau*math.sin(math.radians(2*theta2))))                                                         \n",
      "sigmat1=int(round((sigma1-sigma2)/2*(math.sin(math.radians(2*theta1)))-(tau*math.cos(math.radians(2*theta1))),0))\n",
      "sigmat2=int(round((sigma1-sigma2)/2*(math.sin(math.radians(2*theta2)))-(tau*math.cos(math.radians(2*theta2))),0))                                                         \n",
      "\n",
      "#Result\n",
      "print \"Normal stress(when theta is 45 degrees)=\",sigman1,\"N/mm^2\"\n",
      "print \"Normal stress(when theta is 135 degrees)=\",sigman2,\"N/mm^2\"                                                         \n",
      "print \"Tangential stress(when theta is 45 degrees)=\",sigmat1,\"N/mm^2\"\n",
      "print \"Tangential stress(when theta is 135 degrees)=\",sigmat2,\"N/mm^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Normal stress(when theta is 45 degrees)= 900 N/mm^2\n",
        "Normal stress(when theta is 135 degrees)= 0 N/mm^2\n",
        "Tangential stress(when theta is 45 degrees)= 150 N/mm^2\n",
        "Tangential stress(when theta is 135 degrees)= -150 N/mm^2\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}