0% found this document useful (0 votes)
134 views8 pages

CLT (.TXT File)

This MATLAB code performs classical lamination theory calculations to predict failure in composite laminates. It takes in user inputs for material properties, ply orientations, thicknesses and loads. It then calculates laminate stiffnesses and compliance, as well as stresses and strains in each ply. Failure indices are determined using maximum stress and Tsai-Hill criteria, with results presented in tables and figures.

Uploaded by

Shaun Kradolfer
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views8 pages

CLT (.TXT File)

This MATLAB code performs classical lamination theory calculations to predict failure in composite laminates. It takes in user inputs for material properties, ply orientations, thicknesses and loads. It then calculates laminate stiffnesses and compliance, as well as stresses and strains in each ply. Failure indices are determined using maximum stress and Tsai-Hill criteria, with results presented in tables and figures.

Uploaded by

Shaun Kradolfer
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

%Enme467

%Prediction of Laminate failure using Classical Lamination Theory


%Shaun Kradolfer-45901643
%________________README______________________%
%When this program is run multiple dialogue boxes will pop up informing the
%user on which inputs to type in. Ensure all boxes are filled in (e.g For a
%Nx value of zero, ensure there is a zero in the box or it will not run.
%This program also works for unsymmetrical and different ply thicknesses.
%The default values which are provided in the input dialogue boxes are for
%the example in the handout (Carbon-epoxy)
clc
close all
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Macromechanics-Constants %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prompt={'1. E1 [Pa]','2. E2 [Pa]','3. G12 [Pa]','4. v12'};
def={'132.7e9','8.83e9','4.76e9','0.36'};
TITLE='Define Composite Properties';
options.Resize='on';
ANSWER=inputdlg(prompt,TITLE,1,def,options);
convertc=char(ANSWER);
prec=str2num(convertc);
double(prec);
E1=prec(1);
E2=prec(2);
G12=prec(3);
v12=prec(4);
v21=(v12/E1)*E2;
%%%%%%%%%%%%%%%%%%%%%
% Fibre orientation %
%%%%%%%%%%%%%%%%%%%%%
prompt={'5. Input fiber orientation [deg]'};
def={'0,-45,45,90,90,45,-45,0'};
TITLE='Fibre Orientation';
ANSWER=inputdlg(prompt,TITLE,1,def,options);
convertc=char(ANSWER);
prec=str2num(convertc);
theta=prec;
%%%%Fibre orientation
if theta(1)==theta(length(theta))
symmetric=1;
else
symmetric=0;
end
%%%%%%%%%%%%%%%%%%%%%%%%%
% Thickness Coordinates %
%%%%%%%%%%%%%%%%%%%%%%%%%
prompt={'6. Input thickness coordinates [m]'};
def={'0.00076,0.00057,0.00038,0.00019,0,-0.00019,-0.00038,-0.00057,-0.00076'};
TITLE='Thickness coordinates';
ANSWER=inputdlg(prompt,TITLE,1,def,options);

convertc=char(ANSWER);
prec=str2num(convertc);
h=prec;
%%%%%%%%%%%%%%%%%%%%
%Compliance matrix %
%%%%%%%%%%%%%%%%%%%%
S=[1/E1, -v12/E1, 0 ; -v12/E1, 1/E2, 0 ; 0, 0, 1/G12];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Calculating the stiffness matrix %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q=inv(S);
theta_r=deg2rad(theta);
dh1=zeros(length(theta):1);
dh2=zeros(length(theta):1);
dh3=zeros(length(theta):1);
for H=2:length(h)
dh1(H-1)=h(H-1)-h(H);
dh2(H-1)=(h(H-1))^2-(h(H))^2;
dh3(H-1)=(h(H-1))^3-(h(H))^3;
end
%Thickness of laminate
thickness=abs(dh1);
thickness=sum(thickness);
%Stress and Strain Transformation matrices
for i=1:length(theta)
m=cos(theta_r(i));
n=sin(theta_r(i));
Ttheta{i}=[m^2, n^2, 2*m*n ; n^2, m^2, -2*m*n ; -m*n, m*n, ((m^2)-(n^2))];
Tepsilon{i}=[m^2, n^2, m*n ; n^2, m^2, -m*n ; -2*m*n, 2*m*n, ((m^2)-(n^2))];
end
%Overall stiffness and Compliance matrices
for j=1:length(theta)
Qtheta{j}=inv(Ttheta{j})*Q*Tepsilon{j};
Stheta{j}=inv(Qtheta{j});
end
%Laminate stiffness matrix
A=zeros(3,3);
B=zeros(3,3);
D=zeros(3,3);
for k=1:3
for l=1:3
for o=1:length(theta)
Adummy=Qtheta{o}(k,l)*dh1(o);
A(k,l)=A(k,l)+Adummy;
end
end
end
for k=1:3

for l=1:3
for o=1:length(theta)
Bdummy=Qtheta{o}(k,l)*dh2(o);
B(k,l)=B(k,l)+1/2*Bdummy;
end
end
end
for k=1:3
for l=1:3
for o=1:length(theta)
Ddummy=Qtheta{o}(k,l)*dh3(o);
D(k,l)=D(k,l)+1/3*Ddummy;
end
end
end
if symmetric==1
a=inv(A);
b=inv(B);
c=inv(B);
d=inv(D);
else
Bs=-((inv(A))*B);
Cs=B*(inv(A));
Ds=D-((B*(inv(A)))*B);
a=(inv(A))-(((Bs)*((inv(Ds))))*Cs)
b=-Bs*(inv(Ds))
c=(inv(Ds))*Cs
d=inv(Ds)
end
ABD_Matrix=[A,B;B,D];
abcd_Matrix=[a,b;c,d];
small_cri=10e-5;
small_cri2=10e-15;
large_cri=10e8;
if ~issparse(ABD_Matrix);
id=abs(ABD_Matrix)<=small_cri;
ABD_Matrix(id)=0;
end
if ~issparse(abcd_Matrix);
id=abs(abcd_Matrix)>=large_cri;
abcd_Matrix(id)=0;
end
if ~issparse(abcd_Matrix);
id=abs(abcd_Matrix)<=small_cri2;
abcd_Matrix(id)=0;
end
%Laminate properties in x-y axes in extension
Ex=1/(a(1,1)*thickness);
Ey=1/(a(2,2)*thickness);
Gxy=1/(a(3,3)*thickness);
vxy=-a(2,1)/a(1,1);
vyx=-a(1,2)/a(2,2);
n31=a(1,3)/a(3,3);
n23=a(3,2)/a(2,2);
f = figure('Position',[300 600 600 90]);
data=[Ex Ey Gxy vxy vyx n31 n23];

cnames = {'Ex [N/m^2]','Ey [N/m^2]','Gxy [N/m^2]','vxy','vyx','n31','n23'};


rnames={};
t = uitable('Parent',f,'Data',data,'ColumnName',cnames,'RowName',rnames,'Positio
n',[20 20 560 50]);
set(f,'Name','Laminate Properties in x-y axes in Extension');
f2 = figure('Position',[100 300 540 190]);
t = uitable('Parent',f2,'Position',[20 20 500 150]);
set(t,'data', ABD_Matrix);
set(f2,'Name','Laminate Stiffness Matrix [A B D]');
f3 = figure('Position',[700 300 540 190]);
t = uitable('Parent',f3,'Position',[20 20 500 150]);
set(t,'data', abcd_Matrix);
set(f3,'Name','Laminate Compliance Matrix [a b c d]');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prompt={'Nx [N/m]','Ny [N/m]','Nxy [N/m]','Mx [Nm/m]','My [Nm/m]','Mxy [Nm/m]'};
def={'100000','0','0','0','0','0'};
TITLE='Input Force and Moment Resultants';
ANSWER=inputdlg(prompt,TITLE,1,def,options);
convertc=char(ANSWER);
prec=str2num(convertc);
Nx=prec(1);
Ny=prec(2);
Nxy=prec(3);
Mx=prec(4);
My=prec(5);
Mxy=prec(6);
FMarray=[Nx;Ny;Nxy;Mx;My;Mxy];
RefStrains=abcd_Matrix*FMarray;
f4 = figure('Position',[50 600 450 170]);
data=RefStrains;
cnames = {};
rnames={'ex_0';'ey_0';'Yxy_0';'kx_0';'ky_0';'kxy_0'};
t = uitable('Parent',f4,'Data',data,'ColumnName',cnames,'RowName',rnames,'Positi
on',[20 20 160 130]);
set(f4,'Name','Strains at the Reference Surface or midplane');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Stresses for each ply in the (x-y)axes %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RefStrainN=[RefStrains(1);RefStrains(2);RefStrains(3)];
RefStrainM=[RefStrains(4);RefStrains(5);RefStrains(6)];
%Calculates 4 3x1 arrays for each layer. One at top and one at bottom
for i=1:length(h)-1
StressT{i}=Qtheta{i}*RefStrainN-h(i)*Qtheta{i}*RefStrainM;
StressB{i}=Qtheta{i}*RefStrainN-h(i+1)*Qtheta{i}*RefStrainM;
Stress1T{i}=Ttheta{i}*StressT{i};
Stress1B{i}=Ttheta{i}*StressB{i};
end
for i=1:length(h)-1

SigmaxT(i)=StressT{i}(1);
SigmaxB(i)=StressB{i}(1);
Sigma1T(i)=Stress1T{i}(1);
Sigma1B(i)=Stress1B{i}(1);
SigmayT(i)=StressT{i}(2);
SigmayB(i)=StressB{i}(2);
Sigma2T(i)=Stress1T{i}(2);
Sigma2B(i)=Stress1B{i}(2);
TauxyT(i)=StressT{i}(3);
TauxyB(i)=StressB{i}(3);
Tau12T(i)=Stress1T{i}(3);
Tau12B(i)=Stress1B{i}(3);
end
%Transposing the Sigma arrays
SigmaxT=SigmaxT';
SigmaxB=SigmaxB';
Sigma1T=Sigma1T';
Sigma1B=Sigma1B';
SigmayT=SigmayT';
SigmayB=SigmayB';
Sigma2T=Sigma2T';
Sigma2B=Sigma2B';
TauxyT=TauxyT';
TauxyB=TauxyB';
Tau12T=Tau12T';
Tau12B=Tau12B';
f5 = figure('Position',[400 400 1140 400]);
data=[SigmaxT SigmaxB SigmayT SigmayB TauxyT TauxyB Sigma1T Sigma1B Sigma2T Sigm
a2B Tau12T Tau12B];
cnames = {'Sigma x (Top)', 'Sigma x (Bottom)','Sigma y (Top)', 'Sigma y (Bottom)
','Tau xy (Top)','Tau xy (Bottom)','Sigma 1 (Top)', 'Sigma 1 (Bottom)','Sigma 2
(Top)', 'Sigma 2 (Bottom)','Tau 12 (Top)','Tau 12 (Bottom)'};
t = uitable('Parent',f5,'Data',data,'ColumnName',cnames,'RowName',theta,'Positio
n',[20 20 1100 360]);
set(f5,'Name','Stresses in each ply');
prompt={'Sigma 1T [N/m^2]','Sigma 2T [N/m^2]','Sigma 1C [N/m^2]','Sigma 2C [N/m^
2]','Tau 12 [N/m^2]'};
def={'2280e6','57e6','1440e6','228e6','71e6'};
TITLE='Ultimate Stress Values';
ANSWER=inputdlg(prompt,TITLE,1,def,options);
convertc=char(ANSWER);
prec=str2num(convertc);
US1T=prec(1);
US2T=prec(2);
US1C=prec(3);
US2C=prec(4);
US12=prec(5);
Failure=[Sigma1T, Sigma1B, Sigma2T, Sigma2B, Tau12T, Tau12B];
for i=1:2
for j=1:length(theta)
if abs(Failure(j,i))>=US1T | abs(Failure(j:i))>=US1C
Check{j,i}='Fail';

else
if Failure(j,i)>0
Percent=100*Failure(j,i)/US1T;
else
Percent=-100*Failure(j,i)/US1C;
end
Check{j,i}=Percent;
end
end
end
for i=3:4
for j=1:length(theta)
if abs(Failure(j,i))>=US2T | abs(Failure(j:i))>=US2C
Check{j,i}='Fail';
else
if Failure(j,i)>0
Percent=100*Failure(j,i)/US2T;
else
Percent=-100*Failure(j,i)/US2C;
end
Check{j,i}=Percent;
end
end
end
for i=5:6
for j=1:length(theta)
if abs(Failure(j,i))>=US12
Check{j,i}='Fail';
else
if Failure(j,i)>0
Percent=100*Failure(j,i)/US12;
else
Percent=-100*Failure(j,i)/US12;
end
Check{j,i}=Percent;
end
end
end
for i=1:2
for j=1:length(theta)
if abs(Failure(j,i))>=US1T | abs(Failure(j:i))>=US1C
Check{j,i}='Fail';
else
if Failure(j,i)>0
Percent=100*Failure(j,i)/US1T;
else
Percent=-100*Failure(j,i)/US1C;
end
Check{j,i}=Percent;
end
end
end
for i=3:4
for j=1:length(theta)
if abs(Failure(j,i))>=US2T | abs(Failure(j:i))>=US2C
Check{j,i}='Fail';
else
if Failure(j,i)>0

Percent=100*Failure(j,i)/US2T;
else
Percent=-100*Failure(j,i)/US2C;
end
Check{j,i}=Percent;
end
end
end
for i=5:6
for j=1:length(theta)
if abs(Failure(j,i))>=US12
Check{j,i}='Fail';
else
if Failure(j,i)>0
Percent=100*Failure(j,i)/US12;
else
Percent=-100*Failure(j,i)/US12;
end
Check{j,i}=Percent;
end
end
end
for j=1:length(theta)
if Sigma2T(j)<0
Tsai{j,1}=(Sigma1T(j)/US1C)^2 + (Sigma2T(j)/US2C)^2 + (Tau12T(j)/US12)^2
- (Sigma1T(j)/US1C)*(Sigma2T(j)/US1C);
else
Tsai{j,1}=(Sigma1T(j)/US1C)^2 + (Sigma2T(j)/US2T)^2 + (Tau12T(j)/US12)^2
- (Sigma1T(j)/US1C)*(Sigma2T(j)/US1C);
end
end
for j=1:length(theta)
if Sigma2T(j)<0
Tsai{j,2}=(Sigma1B(j)/US1C)^2 + (Sigma2B(j)/US2C)^2 + (Tau12B(j)/US12)^2
- (Sigma1B(j)/US1C)*(Sigma2B(j)/US1C);
else
Tsai{j,2}=(Sigma1B(j)/US1C)^2 + (Sigma2B(j)/US2T)^2 + (Tau12B(j)/US12)^2
- (Sigma1B(j)/US1C)*(Sigma2B(j)/US1C);
end
end
for i=1:length(theta)
if Tsai{i,1}>1 |Tsai{i,2}>1
Tsai{i,3}='Failed';
else
Tsai{i,3}='Pass';
end
end
f6 = figure('Position',[50 50 800 290]);
data=[Check];
cnames = {'Fibre Dir(% of UTS)','Fibre Dir(% of UTS)','Transverse Dir(% of UTS)'
,'Transverse Dir(% of UTS)','Shear (% of UTS)','Shear (% of UTS)'};
t = uitable('Parent',f6,'Data',data,'ColumnName',cnames,'RowName',theta,'Positio
n',[20 20 760 250]);
set(f6,'Name','Check for Failure using Maximum Stress Criterion (FPF located at
position of maximum stress)');
f7 = figure('Position',[870 50 380 290]);

data=Tsai;
cnames = {'Top of layer','Bottom of layer','Fail= >1'};
t = uitable('Parent',f7,'Data',data,'ColumnName',cnames,'RowName',theta,'Positio
n',[20 20 340 250]);
set(f7,'Name','Check for Failure using Tsai-Hill Theory');

You might also like