def calculate_max_bending_moment(moment_coefficient, beam_width, effective_depth):
2 """
3 Calculate the maximum allowable bending moment for a single reinforced beam.
4
5 :param moment_coefficient: Moment of coefficient resistance, Q
6 :param beam_width: Width of the beam, b
7 :param effective_depth: Effective depth of the beam, d
8 :return: Maximum allowable bending moment, Mulimit
9 """
10 Mulimit = moment_coefficient * beam_width * effective_depth ** 2
11 return Mulimit
12
13# Example usage
14moment_coefficient = 0.12 # Example value
15beam_width = 300 # Example value, in mm
16effective_depth = 600 # Example value, in mm
17
18Mulimit = calculate_max_bending_moment(moment_coefficient, beam_width, effective_depth)
19print(f"Maximum allowable bending moment (Mulimit): {Mulimit} Nmm")
def calculate_required_reinforcement(moment_coefficient, beam_width, effective_depth, f_c, f_y,
n_min):
2 """
3 Calculate the required reinforcement area (As) and number of reinforcement bars (n) for a single
reinforced beam.
4
5 :param moment_coefficient: Moment of coefficient resistance, Q
6 :param beam_width: Width of the beam, b
7 :param effective_depth: Effective depth of the beam, d
8 :param f_c: Concrete compressive strength, in MPa
9 :param f_y: Yield strength of the reinforcement, in MPa
10 :param n_min: Minimum number of reinforcement bars, in the compression zone
11 :return: Required reinforcement area (As), and number of reinforcement bars (n)
12 """
13 Mulimit = moment_coefficient * beam_width * effective_depth ** 2
14 As = (Mulimit * 1000) / (0.85 * f_c * beam_width * effective_depth)
15 n = (As * 1000) / (0.002 * f_y * effective_depth)
16 n += n_min # Add the minimum number of reinforcement bars in the compression zone
17 return As, n
18
19# Example usage
20moment_coefficient = 0.12 # Example value
21beam_width = 300 # Example value, in mm
22effective_depth = 600 # Example value, in mm
23f_c = 30 # Example value, in MPa
24f_y = 400 # Example value, in MPa
25n_min = 2 # Example value
26
27As, n = calculate_required_reinforcement(moment_coefficient, beam_width, effective_depth, f_c,
f_y, n_min)
28print(f"Required reinforcement area (As): {As} mm^2")
29print(f"Number of reinforcement bars (n): {n}")
class Footing:
2 def __init__(self, length, width, depth, fc, fy, ec):
3 self.length = length # footing length (ft)
4 self.width = width # footing width (ft)
5 self.depth = depth # footing depth (ft)
6 self.fc = fc # concrete compressive strength (psi)
7 self.fy = fy # steel yield strength (psi)
8 self.ec = ec # concrete modulus of elasticity (psi)
9 self.load = 0 # applied axial load (lb)
10 self.moment = 0 # applied moment (lb-ft
# Constants
2load_per_unit_length = 10.0 # kN/m
3# Variables
4total_length = 15.0 # m
5
6uniform_load = load_per_unit_length * total_length
7print("Uniform load:", uniform_load, "kN")
# Constants
2length = 2.0 # m
3width = 1.0 # m
4depth = 0.5 # m
5density = 24.0 # kN/m^3
6# Variables
7load_on_footing = uniform_load
8
9# Calculate the area of the footing
10area = length * width
11
12# Calculate the pressure on the footing
13pressure = load_on_footing / area
14print("Pressure on footing:", pressure, "kN/m^2")
15
16# Calculate the bending moment (assuming a uniform load)
17moment = pressure * (length / 2) * (depth - (0.5 * width))
18print("Bending moment:", moment, "kNm")
19
20# Calculate the shear force (assuming a uniform load)
21shear = pressure * length
22print("Shear force:", shear, "kN")
# Constants
2moment = 10.0 # kNm
3area = 0.5 # m^2
4# Variables
5sigma_bending = moment / area
6sigma_shear = 0.0 # Assume no shear stress for this example
7
8# Calculate stresses
9sigma_x = sigma_bending
10sigma_y = -sigma_bending
11sigma = sigma_x + sigma_y
12tau = sigma_shear / 2
13
14# Calculate magnitudes and principal stresses
15magnitude_x = abs(sigma_x)
16magnitude_y = abs(sigma_y)
17max_magnitude = max(magnitude_x, magnitude_y)
18min_magnitude = min(magnitude_x, magnitude_y)
19principal_stress_1 = (sigma + (max_magnitude + min_magnitude) * 0.5) / 2
20principal_stress_2 = (sigma - (max_magnitude + min_magnitude) * 0.5) / 2
21
22# Print results
23print("Sigma X:", sigma_x, "kPa")
24print("Sigma Y:", sigma_y, "kPa")
25print("Sigma:", sigma, "kPa")
26print("Tau:", tau, "kPa")
27print("Principal Stress 1:", principal_stress_1, "kPa")
28print("Principal Stress 2:", principal_stress_2, "kPa")