You are on page 1of 3
File - C:Usersblack'PycharmProjectsipythonProjectfIM.N Diagram py from sympy import * import matplotlib.pyplot as plt fc float (input("fe' Es = float(input('Es = ')) Beta = float(input('Beta = ')) As1 = float(input("As1 = 9 As2 = float(input('As2 10 As3 = float(input('As3 11 As4 = float(input('As4 float (input ("d1 float (input ("d2 d3 = float(input("d3 float (input ("d4 1 2 3 4 fy = float(input('fy ")) 5 6 7 8 16 b = float(input('b = 17h = float(input('h 18 Pn = float(input('Pn 19 n1 = float(input('no. of Ist layer rebars = ')) float(input('no of 2nd layer rebars = ')) float(input('no of 3rd layer rebars = ')) 22 n4 = float(input('no. of 4th layer rebars = ')) 24 c = Symbol('c = ') 25 Eps1 = (0.003 * (c - d1)) /c 26 fs1 = Epsl * Es 27 Eps2 = (0.003 * (c - d2)) /c 28 fs2 = Eps2 * Es 29 Eps3 = (0.003 * (d3 - c)) /c 30 fs3 = Eps3 * Es 31 Eps4 = (0.003 * (d4-c)) /c 32 fs4 = Eps4 * Es 33 Csi = As1 * fsl 34 Cc = Beta * fc * Beta * c * b 35 Cs2 = As2 * fs2 36 Ts3 = As3 * fs3 37 Ts4 = As4 * fs4 38 a = Beta *c 39 sol = solve(Eq(Csl + Cc + Cs2 + - Ts3 - Ts4, Pn), c) 40 print('c = ' + str(sol) 41 Page 1 of3 File - C:Usersblack'PycharmProjectsipythonProjectfIM.N Diagram py 42 cu = float(input('c = ')) 43 44 a2 = Beta * cu 45 ysl = (h / 2) - dl 46 ycc = (h / 2) - (a2 / 2) 47 ys2 = (h / 2) - d2 48 ys3 = d3 - (h / 2) 49 ys4 = d4 - (h / 2) 50 51 Epsi1 = (0.003 * (cu - d1)) / cu 52 fs11 = Epsi1 * Es 53 Eps22 = (0.003 * (cu - d2)) / cu 54 #s22 = Eps22 * Es 55 Eps33 = (0.003 * (d3 - cu)) / cu 56 fs33 = Eps33 * Es 57 Eps44 = (0.003 * (d4 - cu)) / cu 58 fs44 = Eps44 * Es 59 Cs11 = As1 * fs11 68 Ccc = Beta * fc * Beta * cu * b 61 Cs22 = As2 * fs22 62 Ts33 = As3 * fs33 63 Ts44 = As4 * fs44 65 Mn = ((ys1 * Cs11) + (ycc * Coc) + (ys2 * Cs22) - ( ys3 * Ts33) - (ys4 * Ts44)) / 10%*6 67 print('Mn = ' + str(Mn) + ' KN - m') 69 Ast = ((As1 * n1) + (As2 * n2) + (As3 * n3) + (As4 * n4)) 70 Ag =b*h 71 Pnmin = Ast * fy / 10*x3 72 print('Pnmin = ' + str(Pnmin)) 73 Pnmax = -0.8 * (Beta * fc * (Ag - Ast) + fy * Ast) / 10x43 74 print('Pnmax = ' + str(Pnmax)) 76 Mn1 = 77 Mn2 78 Mn3 79 Mn4 eooo0 tok xe zz 55 Page 2 of 3 File - C:Usersblack'PycharmProjectsipythonProjectfIM.N Diagram py 81 Pn3 = 0 82 Pn4 = (Ag - Ast) * fy / 10%*3 83 print (Pn4) [Mn1, Mn2, Mn3, Mn4] [Pnmin, Pn4, Pn3, Pnmax] 87 plt.plot(x, y) 88 plt.xlabel('Mn') 89 plt.ylabel('Pn') 90 plt.title('M-N Diagram") 91 plt.show() Page 3 of

You might also like