summaryrefslogtreecommitdiff
path: root/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_4.ipynb
blob: 4d124b4102f076880bc4c57b6406ba4bbf42dc98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4: Plastic Deformation of Single Crystals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 4.1, Critical Resolved Shear Stress for Slip, Page No. 125"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tensile Stress applied = 14.6969 MPa\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "import numpy as np\n",
    "\n",
    "#variable declaration\n",
    "a=[1,-1,0];\n",
    "n=[1,-1,-1];\n",
    "s=[0,-1,-1];\n",
    "Tr=6;\n",
    "\n",
    "#calculation\n",
    "cos_fi=np.dot(a,n)/(sqrt(a[0]**2+a[1]**2+a[2]**2)*sqrt(n[0]**2+n[1]**2+n[2]**2));\n",
    "cos_lm=np.dot(a,s)/(sqrt(a[0]**2+a[1]**2+a[2]**2)*sqrt(s[0]**2+s[1]**2+s[2]**2));\n",
    "sigma=Tr/(cos_fi*cos_lm);\n",
    "\n",
    "#result\n",
    "print('Tensile Stress applied = %g MPa')%(sigma);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}