summaryrefslogtreecommitdiff
path: root/sample_notebooks/harishsahu/Chapter1.ipynb
diff options
context:
space:
mode:
authorhardythe12015-04-07 15:58:05 +0530
committerhardythe12015-04-07 15:58:05 +0530
commitc7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131 (patch)
tree725a7d43dc1687edf95bc36d39bebc3000f1de8f /sample_notebooks/harishsahu/Chapter1.ipynb
parent62aa228e2519ac7b7f1aef53001f2f2e988a6eb1 (diff)
downloadPython-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.gz
Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.bz2
Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.zip
added books
Diffstat (limited to 'sample_notebooks/harishsahu/Chapter1.ipynb')
-rwxr-xr-xsample_notebooks/harishsahu/Chapter1.ipynb134
1 files changed, 134 insertions, 0 deletions
diff --git a/sample_notebooks/harishsahu/Chapter1.ipynb b/sample_notebooks/harishsahu/Chapter1.ipynb
new file mode 100755
index 00000000..40f0220e
--- /dev/null
+++ b/sample_notebooks/harishsahu/Chapter1.ipynb
@@ -0,0 +1,134 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e3cd5ced27f4cedce3cbdbb3b5b1f422b536f401e599f719b4c9b39198a059c3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Mohrs circle"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Mohr's circle\n",
+ "#calculate center of the circle and maxi principal stress and pricipal stress and maxi shearing stresss\n",
+ "import numpy\n",
+ "from numpy.linalg import inv\n",
+ "import math\n",
+ "sigma=((40+80)/2.)\n",
+ "print'%s %.2f %s'%(\"center of the circle in MPa = \",sigma,\"\")\n",
+ "\n",
+ "##solution a\n",
+ "x=((80-40)**2.);\n",
+ "y=30**2.;\n",
+ "sigma1=60.+math.sqrt((.25*x)+y)\n",
+ "print'%s %.2f %s'%(\"maxi pricipal stress in MPa = \",sigma1,\"\");## print'%s %.2f %s'%laying result\n",
+ "sigma2=60.-math.sqrt((.25*x)+y)\n",
+ "print'%s %.2f %s'%(\"mini pricipal stress in MPa = \",sigma2,\"\");## print'%s %.2f %s'%laying result\n",
+ "theta1=((math.atan((30./20.))/2)*57.3)\n",
+ "print'%s %.2f %s'%(\"pricipal stresses in degree\",theta1,\"\");## print'%s %.2f %s'%laying result\n",
+ "theta2=(((math.atan(30/20.))+180.)/2.)*57.3\n",
+ "print'%s %.2f %s'%(\"pricipal stresses in degree\",theta2,\"\");## print'%s %.2f %s'%laying result\n",
+ "\n",
+ "##solution b\n",
+ "tau=math.sqrt((.25*x)+y)\n",
+ "print'%s %.2f %s'%(\"maxi shearing stress in MPa = \",tau,\"\");## print'%s %.2f %s'%laying result\n",
+ "theta3=theta1+45.\n",
+ "print'%s %.2f %s'%(\"stress in MPa = \",theta3,\"\");## print'%s %.2f %s'%laying result\n",
+ "theta4=theta2+45\n",
+ "print'%s %.2f %s'%(\"stress in MPa = \",theta4,\"\");## print'%s %.2f %s'%laying result\n",
+ "\n",
+ "##final solution in matrix form\n",
+ "p=([[80 ,30], [30 ,40]])\n",
+ "print(p) \n",
+ "q=([[sigma1, 0 ],[0 ,sigma2]])\n",
+ "print(q)\n",
+ "r=([[sigma ,-tau], [-tau ,sigma]])\n",
+ "print(r)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "center of the circle in MPa = 60.00 \n",
+ "maxi pricipal stress in MPa = 96.06 \n",
+ "mini pricipal stress in MPa = 23.94 \n",
+ "pricipal stresses in degree 28.16 \n",
+ "pricipal stresses in degree 5185.16 \n",
+ "maxi shearing stress in MPa = 36.06 \n",
+ "stress in MPa = 73.16 \n",
+ "stress in MPa = 5230.16 \n",
+ "[[80, 30], [30, 40]]\n",
+ "[[96.05551275463989, 0], [0, 23.944487245360108]]\n",
+ "[[60.0, -36.05551275463989], [-36.05551275463989, 60.0]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "##Mohr's circle\n",
+ "#calculate radius of the circle in and orientation of the stress\n",
+ "import math\n",
+ "radius=((14+28)/2.)\n",
+ "print'%s %.2f %s'%(\"radius of the circle in degree = \",radius,\"\")\n",
+ "sigma1=(7+radius *math.cos(60/57.3))\n",
+ "print'%s %.2f %s'%(\" the circle in MPa = \",sigma1,\"\")\n",
+ "sigma2=(7-radius *math.cos(60/57.3))\n",
+ "print'%s %.2f %s'%(\" the circle in MPa = \",sigma2,\"\")\n",
+ "tau1=radius*math.sin(60./57.3)\n",
+ "print'%s %.2f %s'%(\" orientation of the stresses in MPa = \",tau1,\"\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "radius of the circle in degree = 21.00 \n",
+ " the circle in MPa = 17.50 \n",
+ " the circle in MPa = -3.50 \n",
+ " orientation of the stresses in MPa = 18.19 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file