Assignment 7 (Python)
Assignment 7 (Python)
Sol:
𝑓𝑐𝑘 4.6. 𝑀𝑢
𝐴𝑠𝑡 = [1 − √1 − ] 𝑏𝑑
2. 𝑓𝑦 𝑓𝑐𝑘. 𝑏𝑑2
c) Spacing of reinforcement, Sp =
𝐴𝑟𝑒𝑎 𝑜𝑓 𝑑𝑏
𝑆𝑝 = 𝑋1000
𝐴𝑠𝑡
Python code
import math
print("_____________________________________________________________")
print("Program to calculate the area of reinforcement in a RC slab")
print("_____________________________________________________________")
print("Input data required")
print("Grade of materials - fck and fy")
print("Design bending moment, Mu")
print("Depth of slab, d")
print("Diameter of re-bars,db")
print("_____________________________________________________________")
fck=float(input("Enter the grade of concrete, fck in MPa = "))
print("fck = ",fck," MPa")
print("_____________________________________________________________")
fy=float(input("Enter the grade of steel, fy in MPa = "))
print("fy = ",fy," MPa")
print("_____________________________________________________________")
d=float(input("Enter the effective depth of slab in mm = "))
print("Effective depth = ",d,"mm")
print("_____________________________________________________________")
Mu=float(input("Enter the design bending moment in N.mm = "))
print("Mu = ",Mu," N.mm")
print("_____________________________________________________________")
db=float(input("Enter the diameter of bar in mm = "))
print("Diameter of bar = ",db," mm")
print("_____________________________________________________________")
Ast=float(0.50*fck/fy)*(1-math.sqrt(1-4.6*Mu/(fck*1000*d*d)))*1000*d
Amin=float(0.0012*1000*d)
print("Area of minimum reinforcement = ",Amin,"sq.mm")
print("Area of reinforcement calculated =",round(Ast,2)," sq.mm")
if Ast<Amin:
print("Area of reinforcement calculated is less than the
permissible limit of 0.12% of bd")
print("Area of reinforcement to be provided = ", Amin," sq.mm")
elif Ast>Amin:
print("Area of reinforcement, Ast = ", round(Ast,2)," sq.mm")
Sp=((3.14*db**2/4)/Ast)*1000
print("Spacing of",db," mm bars = ",round(Sp,0)," mm")
if Sp>350:
print("Spacing exceeds permissible limit of 350 mm")
print("Provide",db," mm bars at 350 mm c/c")
elif Sp<=350:
print("Provide",db," mm bars at",round(Sp,0), " mm c/c")