summaryrefslogtreecommitdiff
path: root/backup/Mechanical_Metallurgy_version_backup/Chapter_14.ipynb
blob: bd230ae6d447d41daaa364e89bc7d2ccc7134fa8 (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
83
84
85
86
87
88
89
90
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 14: Brittle Fracture and Impact Testing"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 14.1, Stress Corrosion Cracking, Page No. 494"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Estimated Life = 11.5741 days\n",
      "\n",
      "\n",
      "\n",
      "---------------------------------\n",
      "Stress, MPa\tCrack Length, mm\n",
      "---------------------------------\n",
      "\n",
      "\t500\t\t0.105226\n",
      "\n",
      "\t300\t\t0.292296\n",
      "\n",
      "\t100\t\t2.63066\n",
      "\n",
      "---------------------------------\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "\n",
    "#variable declaration\n",
    "cg=0.01;\n",
    "gr=10**-8;\n",
    "\n",
    "#calculation\n",
    "l=cg/(gr*3600*24);\n",
    "K_l_SCC=10;\n",
    "a_sigma2=K_l_SCC**2/(1.21*pi);\n",
    "s=[500,300,100];\n",
    "\n",
    "#result\n",
    "print('\\nEstimated Life = %g days')%(l);\n",
    "print('\\n\\n\\n---------------------------------\\nStress, MPa\\tCrack Length, mm\\n---------------------------------\\n');\n",
    "for i in range (0,3):\n",
    "    print('\\t%g\\t\\t%g\\n')%(s[i],a_sigma2*1000/s[i]**2);\n",
    "print('---------------------------------');"
   ]
  }
 ],
 "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
}