import math
#Declaration Of Variables
b1=12 #cm #width of flange
d1=3 #cm #depth
#web
b2=3 #cm
d2=10 #cm
#Calculations
#area of flange
a1=b1*d1 #cm**2
#area of web
a2=b2*d2 #cm**2
#C.G of flange
y1=d1*2**-1+d2 #cm
#C.G of web
y2=d2*2**-1 #cm
#C.G of section
Y=(a1*y1+a2*y2)*(a1+a2)**-1
#Result
print"C.G of section is",round(Y,2),"cm"
import math
#Declaration Of Variables
b1=10 #cm #width of top flange
d1=2 #cm #depth
#web
b2=2 #cm
d2=15 #cm
#bottom flange
b3=20 #cm
d3=2 #cm
#Calculations
#area of top flange
a1=b1*d1 #cm**2
#area of web
a2=b2*d2 #cm**2
#area of bottom flange
a3=b3*d3 #cm**2
#C.G of flange
y1=d1*2**-1+d2+d3 #cm
#C.G of web
y2=d2*2**-1+d3 #cm
#C.G of bottom flange
y3=d3*2**-1 #cm
#C.G of section
Y=(a1*y1+a2*y2+a2*y3)*(a1+a2+a3)**-1
#Result
print"C.G of section is",round(Y,3),"cm"
import math
#Declaration Of Variables
b2=8 #cm #width of flange
d2=2 #cm #depth
#web
b1=2 #cm
d1=10 #cm
#Calculations
#area of flange
a1=b1*d1 #cm**2
#area of web
a2=b2*d2 #cm**2
#distance of C.G of flange(y-axis)
y1=d1*2**-1+d2 #cm
#distance of C.G of web(y-axis)
y2=d2*2**-1 #cm
#C.G of section(y-axis)
Y=(a1*y1+a2*y2)*(a1+a2)**-1 #cm
#distance of C.G of flange(y-axis)
x1=b1*2**-1 #cm
#distance of C.G of web(y-axis)
x2=b2*2**-1 #cm
#C.G of section(y-axis)
X=(a1*x1+a2*x2)*(a1+a2)**-1 #cm
#Result
print"C.G of section(X-axis) is",round(X,2),"cm"
print"C.G of section(Y-axis) is",round(Y,2),"cm"
import math
from math import sin, cos, tan, radians, pi
#Declaration Of Variables
b=2.5 #cm #width of triangle
h=5 #cm #height of triangle
b2=10 #cm #width of rectangle
h2=5 #cm #height of rectangle
r=2.5 #cm #radius of semicircle
#Calculations
#Area of semicircle
a1=pi*2**-1*r**2 #cm**2
#C.G of semicircle
y1=h2*2**-1 #cm
x1=r-(4*r*(3*pi)**-1)
#area of rectangle
a2=b2*h2 #cm**2
#C.G of rectangle
y2=h*2**-1 #cm
x2=r+b2*2**-1 #cm
#Area of triangle
a3=2*b*h*2**-1 #cm**2
#c.G of triangle
y3=h2+h2*3**-1 #cm
x3=r+b2*2**-1+b #cm
#C.G of section (y-axis)
Y=(a1*y1+a2*y2+a3*y3)*(a1+a2+a3)**-1 #cm
#C.G of section (x-axis)
X=(a1*x1+a2*x2+a3*x3)*(a1+a2+a3)**-1 #cm
#Result
print"C.G of uniform lamina is",round(Y,2),"cm"
print" ",round(X,2),"cm"
import math
from math import sin, cos, tan, radians, pi
#Declaration Of Variables
r=6 #cm #radius
b1=12 #cm #width of rectangle angle and triangle
h=6 #cm #height of triangle and rectangle
#Calculations
#Semicircle
#area
A1=pi*r**2*2**-1 #cm**2
#distance of C.G
x1=4*r*(3*pi)**-1 #cm
y1=r*2**-1*2 #cm
#Triangle
#Area
A2=h*b1*2**-1 #cm**2
#Distance of c.g
x2=-b1*3**-1 #cm
y2=h*3**-1+h #cm
#rectangle
#Area
A3=b1*h #cm**2
#Distance of C.G
x3=-b1*2**-1 #cm
y3=h*2**-1 #cm
#C.G of section
X=(A1*x1+A2*x2+A3*x3)*(A1+A2+A3)**-1
Y=(A1*y1+A2*y2+A3*y3)*(A1+A2+A3)**-1
#Answer for Y is incorrect in textbook
#Result
print"Centroid of Area is",round(X,2),"cm"
print" ",round(Y,2),"cm"
import math
#Declaration Of Variables
b=10 #cm #width
h=12 #cm #Height
b1=3 #cm #Width of cut hole
h2=4 #cm #height
#Calculations
#Area of rectangle
A=b*h #cm**2
#Distance of C.G
y=h*2**-1 #cm
#Area of hole cut
A2=h2*b1 #cm**2
#Distance of C.G of cut hole
y2=2+h2*2**-1 #cm
#Distance between C.G of section with a cut hole
y3=(A*y-A2*y2)*(A-A2)**-1 #cm
#Distance of C.G with acut hole from left
x1=b*2**-1 #cm
#Distance of C.G of cut hole from left lineAD
x2=b*2**-1+1+b1*2**-1
#C.G of section
X=(A*x1-A2*x2)*(A-A2)**-1 #cm
#Result
print"C.G of section is",round(X,2),"cm"
print" ",round(y3,2),"cm"
import math
#Declaration Of Variables
b=100 #mm #Width of triangle
h=90 #mm #height of triangle
#Calculations
#M.I about BC
I_BC=b*h**3*12**-1 #cm**4
#Result
print"M.I of section about an axispassing through base BC",round(I_BC,2),"cm"
import math
#Declaration Of Variables
#Rectangle ABCD
L1=10 #cm #Length of rectangle
D1=2 #cm #Depth
#Rectangle HGEF
L2=2 #cm
D2=10-2 #cm
D=10 #cm #Total Depth
L=10 #cm #Total Length
#Calculations
#Areas
a1=L1*D1 #cm**2 #Area of rectangle ABCD
a2=L2*D2 #cm**2 #Area of Rectangle HGEF
#Centre of gravity of respective bodies From Bottom
y1=D1*2**-1+D2 #cm #C.G of rectangle ABCD from bottom
y2=D2*2**-1 #cm #C.G of rectangle HGEF from bottom
#Centre of gravity of whole section From bottom
y_bar=(a1*y1+a2*y2)*(a1+a2)**-1 #cm
#Centre of gravity of whole section From top
y_bar2=D-y_bar #cm
#M.I of respective bodies
i1=L1*D1**3*12**-1 #cm**4 #M.I of ABCD about an axis passing through it's C.G
i2=L2*D2**3*12**-1 #cm**4 #M.I of HGEF about an axis passing through it's C.G
h1=y_bar2-D1*2**-1 #cm #Distance of C.G of ABCD from C.G of whole section
h2=y_bar-D2*2**-1 #cm #Distance of C.G of HGEF from C.G of whole section
I1=i1+a1*h1**2 #cm**4 #M.I of ABCD about an axis passing through C.G of section
I2=i2+a2*h2**2 #cm**4 #M.I of ABCD about an axis passing through C.G of section
#Moment of Inertia of section about horizontal axis passing through C.G of given section
I_xx=I1+I2 #cm**4
#Moment of Inertia of section about vertical axis passing through C.G of given section
I_yy=D1*L1**3*12**-1+D2*L2**3*12**-1 #cm**4
#Result
print"Moment of Inertia of section about horizontal axis passing through C.G of given section",round(I_xx,2),"cm**4"
print"Moment of Inertia of section about vertical axis passing through C.G of given section",round(I_yy,2),"cm**4"
import math
#Declaration Of Variables
#Rectangle ABCD
L1=10 #cm #Length
d1=2 #cm #depth
#Rectangle EHGF
L2=2 #cm #Length
d2=10 #cm #depth
#Rectangle JKLM
L3=20 #cm #Length
d3=2 #cm #depth
D=14 #cm #Overall Depth
#Calculations
a1=L1*d1 #cm**2 #Area of rectangle 1
a2=L2*d2 #cm**2 #Area of Rectangle 2
a3=L3*d3 #cm**2 #Area of rectangle 3
#Centre of gravity of respective bodies From Bottom
y1=D-d1*2**-1 #cm #C.G of rectangle 1 from bottom
y2=d2*2**-1+d3 #cm #C.G of rectangle 2from bottom
y3=d3*2**-1 #cm #C.G of rectangle 3from bottom
#Centre of gravity of whole section From bottom
y_bar=(a1*y1+a2*y2+a3*y3)*(a1+a2+a3)**-1 #cm
#Centre of gravity of whole section From top
y_bar2=D-y_bar #cm
#M.I of respective bodies
i1=L1*d1**3*12**-1 #cm**4 #M.I of ABCD about an axis passing through it's C.G
i2=L2*d2**3*12**-1 #cm**4 #M.I of HGEF about an axis passing through it's C.G
i3=L3*d3**3*12**-1 #cm**4 #M.I of JKLM about an axis passing through it's C.G
h1=y_bar2-d1*2**-1 #cm #Distance of C.G of ABCD from C.G of whole section
h2=y_bar2-(d2*2**-1+d1) #cm #Distance of C.G of HGEF from C.G of whole section
h3=y_bar-d3*2**-1 #cm #Distance of C.G of JKLM from C.G of whole section
I1=i1+a1*h1**2 #cm**4 #M.I of ABCD about an axis passing through C.G of section
I2=i2+a2*h2**2 #cm**4 #M.I of HGEF about an axis passing through C.G of section
I3=i3+a3*h3**2 #cm**4 #M.I of JKLM about an axis passing through C.G of section
#Moment of Inertia of section about horizontal axis passing through C.G of given section
I_xx=I1+I2+I3 #cm**4
#Result
print"Moment of Inertia of section about horizontal axis passing through C.G of given section",round(I_xx,2),"cm**4"
import math
#Declaration Of Variables
#Rectangle 1
L1=80 #cm #Length
d1=12 #cm #depth
#Rectangle 2
L2=12 #cm #Length
d2=128 #cm #depth
#Rectangle 3
L3=120 #cm #Length
d3=10 #cm #depth
D=150 #cm #Overall Depth
#Calculations
a1=L1*d1 #cm**2 #Area of rectangle ABCD
a2=L2*d2 #cm**2 #Area of Rectangle EHGF
a3=L3*d3 #cm**2 #Area of rectangle JKLM
#Centre of gravity of respective bodies From Bottom
y1=D-d1*2**-1 #cm #C.G of rectangle ABCD from bottom
y2=d2*2**-1+d3 #cm #C.G of rectangle HGEF from bottom
y3=d3*2**-1 #cm #C.G of rectangle JKLM from bottom
#Centre of gravity of whole section From bottom
y_bar=(a1*y1+a2*y2+a3*y3)*(a1+a2+a3)**-1 #cm
#Centre of gravity of whole section From top
y_bar2=D-y_bar #cm
#M.I of respective bodies
i1=L1*d1**3*12**-1 #cm**4 #M.I of 1 about an axis passing through it's C.G
i2=L2*d2**3*12**-1 #cm**4 #M.I of 2 about an axis passing through it's C.G
i3=L3*d3**3*12**-1 #cm**4 #M.I of 3 about an axis passing through it's C.G
h1=y_bar2-d1*2**-1 #cm #Distance of C.G of 1 from C.G of whole section
h2=y_bar2-(d2*2**-1+d1) #cm #Distance of C.G of 2 from C.G of whole section
h3=y_bar-d3*2**-1 #cm #Distance of C.G of 3 from C.G of whole section
I1=i1+a1*h1**2 #cm**4 #M.I of 1 about an axis passing through C.G of section
I2=i2+a2*h2**2 #cm**4 #M.I of 2 about an axis passing through C.G of section
I3=i3+a3*h3**2 #cm**4 #M.I of 3 about an axis passing through C.G of section
#Moment of Inertia of section about x-x axis
I_xx=(I1+I2+I3)*10**-6 #cm**4
#Moment of Inertia of section about y-y axis
I_yy=(d1*L1**3*12**-1+d2*L2**3*12**-1+d3*L3**3*12**-1)*10**-6 #cm**4
#Polar Moment of Inertia
I_zz=I_xx+I_yy #mm**4
#Result
print"Polar Moment of Inertia is",round(I_zz,2),"mm**4"
import math
from math import sin, cos, tan, radians, pi
#Declaration Of Variables
b=12 #cm #width of culvert
d=6 #cm #Depth
x=1 #cm #distance between axis of rectangle and semicircle
b1=3 #cm #width of triangles
h1=6 #cm #height
x1=0 #cm #distance between axis of rectangle and triangles
r=4 #cm #radius of semicircle
#Calculations
#area of rectangle
A=b*d #cm
#M.I of rectangle about an axis A-A
M1=b*d**3*12**-1+A*x #cm**4
#Area of rectangle
A1=b1*h1*2**-1 #cm**4
#M.I of triangles
M2=2*(b1*h1**3*36**-1+A1*x1) #cm**4
#M.I of semicircle
M3=0.11*r**4+pi*r**2*2**-1*(r-4*r*(3*pi)**-1)**2 #cm**4
#M.I of c/s of culvert
M4=M1-M2-M3 #cm**4
#Result
print"Cross-section of culvert is",round(M4,2),"cm**4"