Use the table function to store the data in table format. For more information, refer the documentation here.
Storing the Data in Table format
1 次查看(过去 30 天)
显示 更早的评论
% Calculating the stress and strain at each laminate
clc,clear all
% Input the data
E1=input(' The elastic modulus in the fiber direction in GPa : ');
E2=input(' The elastic modulus in the transverse direction in GPa : ');
G12=input(' The rigidity of the material in GPa : ');
nu12=input(' The poisson ratio of the materal : ');
t=input(' Enter the value of the thickness in milimeter : ');
n=input(' Total number of the laminae : ');
% Calculation of thickness
z=t*[-0.5*n:1:0.5*n];
% Calculation of the stacking sequence.
theta=zeros(n,1);
for i=1:n
theta(i,1)=input(' Enter the angle in degree for the stacking sequence : ');
end
disp(' The stacking sequence for the given problem is : ')
disp(theta)
% Calculating the transformation coeffficient
nu21=(E2/E1)*nu12;
x=1-(nu12*nu21);
Q11=E1/x;
Q22=E2/x;
Q12=(nu12*E2)/x;
Q66=G12;
% Representing the transformed coefficient in the matrix form
Q=[Q11,Q12,0;Q12,Q22,0;0,0,Q66];
% Representing the formation of the A matrix
A1=zeros(3,3);
A=zeros(3,3);
% Representing the formation of the B matrix
B1=zeros(3,3);
B=zeros(3,3);
% Representing the formation of the D matrix
D1=zeros(3,3);
D=zeros(3,3);
% Calculating the transformed reduce matrix for different orientation
% forming the transformation matrix
for i=1:n
format short
m=cos(theta(i,1)*0.0174533);
n=sin(theta(i,1)*0.0174533);
T1=[m^2 n^2 2*m*n ;n^2 m^2 -2*m*n ; -m*n m*n (m^2-n^2)];
T=inv(T1);
T2=[m^2 n^2 m*n ; n^2 m^2 -m*n ; -2*m*n 2*m*n (m^2-n^2)];
% Calculating the tranformed reduces matrix
Qbar=T*Q*T2;
disp(' The Transformed reduced matrix for the each angle according to the stacking sequence : ')
disp(Qbar)
% Calculation of the A matrix
A1=Qbar*(z(i+1)-z(i));
A=A+A1;
% Calculation of the B matrix
B1=0.5*Qbar*(z(i+1)^2-z(i)^2);
B=B+B1;
% Calculation of the D matrix
D1=(1/3)*Qbar*(z(i+1)^3-z(i)^3);
D=D+D1;
end
% Dispalying the A matrix
disp(' The A matrix of the given laminate in Gpa-mm : ')
disp(A)
% Dispalying the B matrix
disp(' The B matrix of the given laminate in GPa-mm^2 : ')
disp(B)
if B==0
disp(' Here the B matrix is zero because our given laminate is symmetric. ')
end
% Displaying the D matrix
disp(' The D matrix of the given laminate in Gpa-mm^3: ')
disp(D)
% Represeting the ABD matrix
disp(' The ABD Matrix is : ')
ABD=[A B ; B D]
% Calculation of the mid strain and curvature
type=input(' Enter 1 for calculation of the stress and strain : ');
if type==1
% Input the further details
Nx=input(' Enter the force acting in the x direction in MPa-mm : ');
Ny=input(' Enter the force acting in the y direction in MPa-mm : ');
Nxy=input(' Enter the force acting in the xy direction in MPa-mm : ');
Mx=input(' Enter the Moment acting in the y direction in MPa-mm^2 : ');
My=input(' Enter the Moment acting in the y direction in MPa-mm^2 : ');
Mxy=input(' Enter the Moment acting in the xy direction in MPa-mm^2 : ');
% The externally applied load matrix is
NM=[Nx ; Ny ; Nxy ; Mx ; My ; Mxy];
% Calculation for the mid strain and curvature
Ek=(ABD)\NM;
% Storing the and representing the value of the mid strain and
% curvature
disp(' The mid plain strain in the x direction : ')
eox=Ek(1,1)
disp(' The mid plain strain in the y direction : ')
eoy=Ek(2,1)
disp(' The mid plain strain in the xy direction : ')
eoxy=Ek(3,1)
disp(' The curvature in the x direction : ')
kox=Ek(4,1)
disp(' The curvature in the y direction : ')
koy=Ek(5,1)
disp(' The curvature in the xy direction : ')
koxy=Ek(6,1)
%Calculation of the strains at the each laminae
k=input(' Again write the number of the laminae : ');
% Storing the value of the strain in the x direction
ex=zeros(k+1,1);
% Stroring the value of the strain in the y direction
ey=zeros(k+1,1);
% Storing the value of the shear strain in the xy direction
exy=zeros(k+1,1);
% Positioning the strain value
for i=1:k+1
% Calculating the strain at the each laminae
ex(i,1)=eox+z(i)*kox;
ey(i,1)=eoy+z(i)*koy;
exy(i,1)=eoxy+z(i)*koxy;
end
else
disp(' Nothing ')
end
Inputs are
E1=138
E2=9
G12=6.9
nu12=0.3
t=0.25
n=4
% Stacking Seq in degrees.
-45
45
-45
45
% If 1 Selected then inputs
Nx=50
rest = 0
k=4
% My question is , I want to store the value of the ex, ey, exy like shown below.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stress and Strain 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!