import math
#Variable Decleration
V=1000 #Force acting on he section in lb
t=0.5 #Thickness in inches
#Dimensions
d=8 #Depth of the section in inches
wf=12 #Width of the flange in inches
wbf=8 #Width of the bottom flange in inches
#Calculations
y_bar=((d*t*0)+wbf*t*4+wf*t*8)/(d*t+wbf*t+wf*t) #Location of Neutral Axis in inches
I=d*t*y_bar**2+t*d**3*12**-1+d*t*(d*t-y_bar)**2+wf*t*(8-y_bar)**2 #Moment of Inertia in in^4
#Top Flange
q1=V*t*t*wf*(8-y_bar)*I**-1 #Shear flow in lb/in
#Bottom Flange
q2=V*t*t*d*y_bar*I**-1 #Shear Flow in lb/in
#Web
qB=2*q1 #Shear Flow in lb/in
qF=2*q2 #Shear Flow in lb/in
#Max Shear Flow
qMAX=qB+V*t*(8-y_bar)**2*0.5*I**-1 #Maximum Shear Flow in lb/in
#Result
print "The Maximum Shear Flow is",round(qMAX),"lb/in"
import math
#Variable Decleration
V=1000 #Shear Force in lb
#Rest ALL DATA is similar to previous problem
#Calcualtions
I=t*wf**3*12**-1+t*d**3*12**-1 #Moment of Inertia
#Part 1
q1=V*t*t*wf*3*I**-1 #Shear Flow in lb/in
q2=V*t*t*d*2*I**-1 #Shear FLow in lb/in
V1=2*3**-1*q1*wf #Shear force carried in lb
V2=2*3**-1*q2*d #Shear force carried in lb
#Part 2
e=8*V2*V**-1 #Eccentricity in inches
#Result
print "The Shear Force carried by Flanges is"
print "Top Flange=",round(V1,1),"lb Bottom Flange=",round(V2,1),"lb"
print "The eccentricity is",round(e,3),"in"
import math
import numpy as np
#Variable Decleration
M=32 #Moment in kN.m
Iy=4.73*10**6 #Moment of inertia in y-axis in mm^4
Iz=48.9*10**6 #Moment of inertia in z-axis in mm^4
Sy=64.7*10**3 #Sectional Modulus in y-axis in mm^3
Sz=379*10**3 #Sectional Modulus in z-axis in mm^3
theta=16.2 #Angle between moment and z-axis in degrees
#Calculations
#Part 1
alpha=np.arctan((Iz*Iy**-1)*tan(theta*pi*180**-1))*180*pi**-1 #Angle between NA and z-axis in degrees
#Part 2
My=-M*np.sin(theta*pi*180**-1) #Bending Moment in y in kN.m
Mz=-M*np.cos(theta*pi*180**-1) #Bending Moment in z in kN.m
sigma_max=My*Sy**-1+Mz*Sz**-1 #Largest Bedning Stress in MPa
#Result
print "The angle between the Neutral Axis and Z-Axis is",round(alpha,1),"degrees"
print "The maximum Bending Moment is",abs(round(sigma_max*10**6)),"MPa"
import math
#Variable Decleration
A=4.75 #Area in inches^2
Iy_dash=6.27 #Moment of inertia in in^4
Iz_dash=17.4 #Moment of inertia in in^4
ry=0.87 #Radius of Gyration in inches
tan_theta=0.44
P=1 #Force in kips
L=48 #Length in inches
y_dash_B=-4.01 #Y coordinate of point B in inches
z_dash_B=-0.487 #Z coordinate of point B in inches
#Calcualtions
theta=np.arctan(tan_theta) #Angle in radians
Iy=A*ry**2 #Moment of inertia in y in in^4
Iz=Iy_dash+Iz_dash-Iy #Moment of inertia in y in in^4
#Part 1
alpha=arctan(Iz*Iy**-1*tan_theta)*180*pi**-1 #Angle in radians
beta=alpha-(theta*180*pi**-1) #Angle in degrees
#Part 2
M=P*L*4**-1 #Moment in kip.in
My=M*np.sin(theta) #Moment in y in kip.in
Mz=M*np.cos(theta) #Moment in z in kip.in
y_B=y_dash_B*np.cos(theta)+z_dash_B*np.sin(theta) #Y coordinate in inches
z_B=z_dash_B*np.cos(theta)-y_dash_B*np.sin(theta) #Z coordinate in inches
#Maximum Bending Stress
sigma_max=My*z_B*Iy**-1-Mz*y_B*Iz**-1 #Maximum Bedning Stress in ksi
#Result
print "The angle of inclination of the Neutral axis to the z-axis is",round(beta,1),"degrees"
print "The maximum Bedning Stress is",round(sigma_max,2),"ksi"
import math
#Variable Decleration
A1=4 #Area in in^2
A2=6 #Area in in^2
r1=7.8 #Radius in inches
r2=14.8 #Radius in inches
t=0.5 #Thickness in inches
d=4 #Depth in inches
sigma_w=18 #Maximum allowable stress in kips
#Calculations
A=A1+A2 #Area in in^2
r_bar=(A1*(r1+t)+A2*(r2+d))*(A1+A2)**-1 #Centroidal Axis in inches
#Simplfying the computation
a=(r1+2*t)/r1
b=r2/(r1+t*2)
integral=d*math.log(a)+2*t*math.log(b) #
R=A/integral #Radius of neutral Surface in inches
#Maximum Stress
#Answers are in variable terms hence not computable
P=sigma_w/0.7847 #Maximum Allowable load in kips
#Result
print "The maximum allowable load is",round(P,1),"kips"