summaryrefslogtreecommitdiff
path: root/Mechanical_Metallurgy/Chapter_16.ipynb
blob: df731606a3acf741cc6a8b1d6ce265f76e87dca2 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 16: Forging"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 16.1, Forging in Plain Strain, Page No. 574"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "At the centerline of the slab = 63044.5 psi\n",
      "\n",
      "\n",
      "Pressure Distributon from the centerline:\n",
      "\n",
      "---------------------------------\n",
      "\n",
      "x\tp (ksi)\t\tt_i (ksi)\n",
      "\n",
      "---------------------------------\n",
      "\n",
      "0\t63.0445\t\t15.7611\n",
      "\n",
      "0.25\t38.2384\t\t9.55961\n",
      "\n",
      "0.5\t23.1928\t\t5.7982\n",
      "\n",
      "0.75\t14.0671\t\t3.51678\n",
      "\n",
      "1\t8.53215\t\t2.13304\n",
      "\n",
      "1.25\t5.17501\t\t1.29375\n",
      "\n",
      "1.5\t3.1388\t\t0.7847\n",
      "\n",
      "1.75\t1.90378\t\t0.475945\n",
      "\n",
      "2\t1.1547\t\t0.288675\n",
      "\n",
      "---------------------------------\n",
      "\n",
      "\n",
      "For sticking friction:\n",
      "p_max = 10.3923 ksi\n",
      "\n",
      "\n",
      "The Forging load = 62.7695 tons\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "from math import exp\n",
    "from math import log\n",
    "\n",
    "#variable declaration\n",
    "sigma=1000;\n",
    "mu=0.25;\n",
    "a=2;\n",
    "b=6;\n",
    "h=0.25;\n",
    "x=0;\n",
    "mu=0.25;\n",
    "\n",
    "#calculation\n",
    "p_max=2*sigma*exp(2*mu*(a-x)/h)/sqrt(3);\n",
    "print('\\nAt the centerline of the slab = %g psi\\n')%(p_max);\n",
    "print('\\nPressure Distributon from the centerline:');\n",
    "print('\\n---------------------------------\\n');\n",
    "print('x\\tp (ksi)\\t\\tt_i (ksi)\\n');\n",
    "print('---------------------------------\\n');\n",
    "while x<=2:\n",
    "    p=2*sigma*exp(2*mu*(a-x)/h)/(1000*sqrt(3));             #in ksi\n",
    "    t_i=mu*p;\n",
    "    print('%g\\t%g\\t\\t%g\\n')%(x,p,t_i);\n",
    "    x+=0.25;\n",
    "print('---------------------------------\\n');\n",
    "k=sigma/sqrt(3);\n",
    "x=0;\n",
    "p_max1=2*sigma*((a-x)/h+1)/sqrt(3);\n",
    "x1=a-h/(2*mu)*log(1/(2*mu));\n",
    "p=2*sigma*(a/(2*h)+1)/sqrt(3);\n",
    "P=2*p*a*b;\n",
    "P=P*0.000453;                      #conversion to metric tons\n",
    "\n",
    "#result\n",
    "print('\\nFor sticking friction:\\np_max = %g ksi')%(p_max1/1000);\n",
    "print('\\n\\nThe Forging load = %g tons')%(P);"
   ]
  }
 ],
 "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
}