from __future__ import division
import math
#variable declaration
Ee=5000 #youngs modulus of epoxy (N/mm^2)
Ec=200000 #youngs modulus of carbon (N/mm^2)
# E1=Ef*Af/A+Em+Am/A equation 25.4
A=50*80 #total area (mm^2)
Ae=40*80 #area of epoxy (mm^2)
Ac=10*80 #area of carbon(mm^2)
L=500 #length of bar(mm)
vc=0.3 #poisson ratio
ve=0.2
#effective youngs modulus
E1=(Ee*Ae+Ec*Ac)/A
load=100*10**3
sigma1=load/A
epsilon1=sigma1/E1
delta1=epsilon1*L
v1t=(ve*Ae+vc*Ac)/A
epsilon_t=-v1t*epsilon1
thickness=L
delta_t=-epsilon_t*(thickness)
sigma_m=Ee*epsilon1
sigma_f=Ec*epsilon1
print "stresses in epoxy = %2.2f N/mm^2\n"%(sigma_m)
print "stresses in carbon = %2.2f N/mm^2\n"%(sigma_f)
from __future__ import division
import math
tau=40 #shear stress(N/mm^2)
G=5000 #shear modulus(N/mm^2)
v1t=0.3 #poisson ratio
Et=80000 #youngs modulus in transverse direction(N/mm^2)
E1=120000 #youngs modulus in longitudinal direction(N/mm^2)
sigma_x=50 #direction stress in x direciton
sigma_y=25 #in y direction
vt1=v1t*Et/E1 #minor poisson ratio
epsilon1=sigma_x/E1-vt1*sigma_y/Et
epsilont=sigma_y/Et-v1t*sigma_x/E1
print "direct strain in x direction = %2.2e \n"%(epsilon1)
print "direct strain in y direction = %2.2e \n"%(epsilont)
gama1t=tau/G
print "shear strain in the ply = %2.2e \n"%(gama1t)
from __future__ import division
import math
import numpy as np
El=150000 #youngs modulus(N/mm^2)
Et=90000 #youngs modulus(N/mm^2)
Glt=5000 #shear modulus(N/mm^2)
vlt=0.3 #poisson ratio
theta=45 #longitudinal plane inclination
s11=1/El
s22=1/Et
s12=-vlt/El
s33=1/Glt
a=np.array([[53.45,-46.55,1],[-46.55,53.45,0],[-2.2,-2.2,0]])
b=np.array([60,40,0])
x=np.dot(a,b)
print "strain in the x direction = %4.4e\n"%(x[0]*10**-6)
print "strain in the y direction = %4.4e\n"%(x[1]*10**-6)
print "shear strain in the xy plane = %4.4e\n"%(x[2]*10**-6)
from __future__ import division
import math
import numpy as np
l1=150
t1=1
l2=100 #dimensions shown in Fig 25.10 (mm)
t2=2
Ef=60000 #youngs modulus of flanges(N/mm^2)
Ew=20000 #youngs modulus of web(N/mm^2)
P=40*10**3 #axial load(N)
#sum of b*t*E
sum_btE=2*l2*t2*Ef+l1*t1*Ew
epsilon_z=P/sum_btE #equ 25.37
P_flange=epsilon_z*l2*t2*Ef
P_web=epsilon_z*l1*t1*Ew
print "axial load in flange = %2.2f kN\n"%(P_flange/1000)
print "axial load in web = %2.2f kN\n"%(P_web/1000)
from __future__ import division
import math
import numpy as np
l1=100
l2=50
t1=1 #dimension shown in Fig 25.11 (mm)
t2=2
Ef=50000 #youngs modulus of flange(N/mm^2)
Ew=15000 #youngs modulus of web(N/mm^2)
Mx=10**6 #bending moment (N.mm)
My=0
Ixx=2*Ef*l2*t2*l2**2+Ew*t1*l1**3/12
Iyy=Ef*t2*l1**3/12
Ixy=Ef*l2*t2*(50)*(50)+Ef*l2*t2*(-50)*(-50)
x=50
y=50 #point 1
Ez=50000
sigma_z=Ez*((My*Ixx-Mx*Ixy)/(Ixx*Iyy-Ixy**2)*x + (Mx*Iyy-My*Ixy)/(Ixx*Iyy-Ixy**2)*y)
print "direct stress at point 1 = %3.1f N/mm^2\n"%(sigma_z)
x=0
y=50
sigma_z=Ez*((My*Ixx-Mx*Ixy)/(Ixx*Iyy-Ixy**2)*x + (Mx*Iyy-My*Ixy)/(Ixx*Iyy-Ixy**2)*y)
print "direct stress at point 2 = %3.1f N/mm^2\n"%(sigma_z)
x=0
y=50
Ez=15000
sigma_z=Ez*((My*Ixx-Mx*Ixy)/(Ixx*Iyy-Ixy**2)*x + (Mx*Iyy-My*Ixy)/(Ixx*Iyy-Ixy**2)*y)
print "direct stress at point 2 in the web = %3.1f N/mm^2\n"%(sigma_z)
from __future__ import division
import math
import numpy as np
from sympy import symbols, integrate
s=symbols('s')
l12=250
l23=300
t31=t12=2 #dimensions shown in Fig 25.12 (mm)
t23=1.5
P=2*10**3 #shear load(N)
E12=E31=45000 #youngs modulus of sides given in name(N/mm^2)
E23=20000
Ixx=2*E12*t12*l12**3*(l23/2/l12)**2/12+E23*t23*l23**3/12
alpha=math.asin(l23/2/l12)
Sx=0
Sy=2*10**3
q12=-E12*Sy/Ixx*integrate(-2*s,(s,0,250))*math.sin(alpha)
print "shear flow at point 2 in the flange 12 = %2.2f N/mm\n"%(q12)
q23=-E23*Sy/Ixx*integrate(-225+1.5*s,(s,0,300))+22.2
print "shear flow at point 3 in the flange 23 = %2.2f N/mm\n"%(q23)
q0=14.2
q12=-E12*Sy/Ixx*integrate(-2*s,s)*math.sin(alpha)-q0
print "shear flow in the flange 12 and 31 "
print q12
q23=-E23*Sy/Ixx*integrate(-225+1.5*s,s,)+22.2-q0
print "\nshear flow in the web 23"
print q23
from __future__ import division
import math
import numpy as np
from sympy import symbols, integrate
l1=200
t1=2
l2=100 #dimensions shown in Fig 25.13 (mm)
t2=1
T=10*10**6 #torque applied (N.mm)
Gl=20000 #laminate shear modulus(N/mm^2)
Gw=35000 #web shear modulus(N/mm^2)
A=l1*l2
q=T/2/A
#from eqn 25.47
int_ds_by_Gt=2*l1/Gl/t1+2*l2/Gw/t2
#Let's say we want to calculate warping at point 1
#warping at mid of web is zero (W0=0) integrate eqn 25.47 from
#mid of web to point 1
W0=0
A0s=50*100
W1=W0+q*(l2/2/Gw/t2-int_ds_by_Gt/A*A0s)
print "warping at point 1 is = %2.2f mm\n"%(W1)
from __future__ import division
import math
import numpy as np
from sympy import symbols, integrate
l1=50
t1=2.5
l2=25 #dimension shown in Fig 18.12(mm)
t2=1.5
Gl=20000
Gw=15000 #shear modulus (N/mm^2)
T=10*10**3 #torque applied (N.mm)
AR=25*25/2
GJ=2*Gl*l2*t2**3/3+Gw*l1*t1**3/3
#eqn 25.49
dO_dz=T/GJ
t_max12=2*Gl*(t2/2)*dO_dz
t_max23=2*Gw*(t1/2)*dO_dz
print "maximum shear stress in the web = %2.2f N/mm^2\n"%(t_max12)
print "maximum shear stress in the laminate = %2.2f N/mm^2\n"%(t_max23)
W1=-2*AR*dO_dz
print "warping at point 1 = %2.2f mm\n"%(W1)