import math
#calculate meter and sigma
Mz=11000. ##Nm
A1=0.13*0.02 ##m
A2=0.15*0.02 ##m
z1=0.01 ##m
z2=0.075 ##m
yA=0.043 ##m
zA=-0.106 ##m
yB=-0.063 ##m
zB=0.
##location of the centroid
z=(A1*z1+A2*z2)/(A1+A2)
print'%s %.2f %s'%("in meter is= ",z,"")
Iz=(0.02*(0.13)**3)/12.+ (0.13*0.02*(0.04)**2)+(0.15*(0.02)**3.)/12.+ (0.15*0.02*(0.035)**2.)
print'%s %.5f %s'%("Iz in meter^4 is= ",Iz,"")
Iy=(0.02*(0.13)**3)/12.+ (0.13*0.02*(0.04)**2)+(0.15*(0.02)**3)/.12+ (0.15*0.02*(0.035)**2.)
print'%s %.5f %s'%("Iy in meter^4 is= ",Iy,"")
Iyz=0+A1*0.04*(-0.035)+0+A2*(-0.035)*0.03
print'%s %.2f %s'%("Iyz in meter^4 is= ",Iyz,"")
##thetap=(atand((-2*Iyz)/(Iz-Iy)))/2
##print'%s %.2f %s'%(thetap)
I1=(Iz+math.sqrt(0.+(6.79*10**-6)**2.))
print'%s %.5f %s'%("I1 in meter^4 is= ",I1,"")
I2=(Iz-math.sqrt(0+(6.79*10**-6)**2))
print'%s %.6f %s'%("I2 in meter^4 is= ",I2,"")
My1=11000.*math.sin(45/57.3)
print'%s %.2f %s'%("My1 in Nm is",My1,"")
Mz1=11000*math.sin(45/57.3)
print'%s %.2f %s'%("Mz1 in Nm is",Mz1,"")
sigmaxA=((My1*(zA))/I1)-((Mz1*yA)/I2)
print'%s %.2f %s'%("sigmaxA in MPa is",sigmaxA,"")
sigmaxB=0-((My1*yB)/I2)
print'%s %.2f %s'%("sigmaxB in MPa is",sigmaxB,"")
My=0.
y=((Mz*Iyz)*z)/(Mz*Iy) ##.......equal to z=-1.71y
print'%s %.3f %s'%("y",y,"")
import math
#calculate the distance
import scipy
from scipy import integrate
t=1.25 ##mm
y=15.87 ##mm
z=5.28 ##mm
Iy=4765.62 ##mm**4
Iz=21054.69 ##mm**4
Iyz=3984.37 ##mm**4
thetap=13.05 ##degree
Iy1=3828.12 ##mm**4
Iz1=21953.12##mm**4
s=12.5
##tau=(Vy/Iz1*t)*s*t(19.55+s*asind(13.05)/2)....equation 1
##F1=integrate((tau*t)ds)
def fun(s):
y=(0)
return y
x=scipy.integrate.quad(fun,0,1)
x=x[0]
##F1=0.0912*Vy1 substituting the value of tau we get F1
##Vy1*ez1=37.5*F1 substituting the value of F1 we get ez1
ez1=37.5*0.0912
print'%s %.2f %s'%("the distance in mm is= ",ez1,"")
##tau=(Vz1/Iy1*t)*s*t(12.05-s*asind(13.05)/2)....equation 2
##F1=integrate((tau*t)ds)
def fun(s):
y=(0)
return y
x=scipy.integrate.quad(fun,0,1)
x=x[0]
##F1=0.204*Vz1 substituting the value of tau we get F1
##Vz1*ey1=37.5*F1 substituting the value of F1 we get ez1
ey1=37.5*0.204
print'%s %.2f %s'%("the distance in mm is= ",ey1,"")
import math
#calculate stress and meter
import scipy
from scipy import integrate
P=70. ##kN
c=0.05##m
c1=c
c2=c
R=0.1+0.05
A=0.005
##m=(-1/(2*c))*integrate((y/R+y)dy)
def fun(c):
y=(-c)
return y
x=scipy.integrate.quad(fun,0,1)
m=-1.+(R/2.*c)*math.log((R+c)/(R-c))
print'%s %.2f %s'%("m",m,"")
##m=(-1/(2*c))*integrate((y/R)-(y**2/R**2)+(y**3/R**3)-(y**4/R**4)+.....)dy)
m=-1+(3/2.)*math.log(2.)
print'%s %.3f %s'%("m",m,"")
M=P*R
print'%s %.2f %s'%("M",M,"")
sigmatheta1=(-P*c2)/(m*A*(R-c1))
print'%s %.2f %s'%("stress in Pa is= ",sigmatheta1,"")
sigmatheta2=(P*c2)/(m*A*(R+c2))
print'%s %.2f %s'%("stress in Pa is= ",sigmatheta2,"")