Filter löschen
Filter löschen

Adjust the output parameters based on different inputs (Obtain the optimum values)

2 Ansichten (letzte 30 Tage)
Hi All,
The main aim of this code was to optimise both the angles (named as angle in the code) and the thicknesses (named as t in the code)of the layers in a structure.
how to make the code repeat all the steps? until reaching to the optimum values which should be as written in step five bigger than 10 and not less then 8 ??
FINALLY I WOULD LIKE TO GET the correct angles sequence (angle )and correct thickness (t) ??
the flow chart of the program should be:
I understand the code seems long but I wanna get the idea how to do the same ??
how to implement them in my code ??
clearvars;
close all;
clc;
% STEP ONE
mat(1,:)=[1.4e3 1.4e3 .53e3 .35 .5385];
angle=0; % the angles should be between [0 +45 -45 90]
t=.125; % the thickness should be between [0.125 .15 .2 ]
L=zeros(length(angle),7);
for i=1:length(angle);
L(i,:)=[mat(1,:) angle(i) t(i)]; % FLIP LAMINATE STRUCTURE % flipud(L )
end
% STEP TWO
S=zeros(3,3,length(angle));
Q=zeros(3,3,length(angle));
for i=1:length(angle);
S(1,1,i)=1/L(i,1);
S(1,2,i)=-L(i,4)/L(i,1);
S(2,1,i)=S(1,2,i);
S(2,2,i)=1/L(i,2);
S(3,3,i)=1/L(i,3);
S(:,:,i);
Q(:,:,i)=inv(S(:,:,i)); %% REDUCED STIFFNESS MATRIX
end
% STEP THREE
sigma1_c=1500;
sigma2_c=246;
sigma1_t=1500;
sigma2_t=40;
tau_12=68;
H1=(1/sigma1_t) - (1/sigma1_c);
H11= 1/(sigma1_t*sigma1_c);
H2=(1/sigma2_t) - (1/sigma2_c);
H22=1/(sigma2_t*sigma2_c);
H6=0;
H66=1/(tau_12)^2;
H12=-1/2*sqrt(1/(sigma1_t*sigma1_c*sigma2_t*sigma2_c));
% STEP FOUR
for i=1:length(angle);
theta=L(i,6);
m=cos(theta);
n=sin(theta);
T_z_(1,1,i)=m^2;
T_z_(1,2,i)=n^2;
T_z_(1,3,i)=2*m*n;
T_z_(2,1,i)=n^2;
T_z_(2,2,i)=m^2;
T_z_(2,3,i)=-2*m*n;
T_z_(3,1,i)=-m*n;
T_z_(3,2,i)=m*n;
T_z_(3,3,i)=m^2-n^2;
T_zinv(:,:,i)=(inv(T_z_(:,:,i)))';
S_tran(:,:,i)=inv(T_zinv(:,:,i))*S(:,:,i)*T_z_(:,:,i);
Q_tran(:,:,i)=inv(S_tran(:,:,i)); %% REDUCED STIFFNESS MATRIX
end;
t_k=0;
for i=1:length(angle)
t_k=t_k+t(i);
end
Z=zeros(length(angle)+1,1);
mid_s=t_k/2;
Z(1)=-mid_s;
t_k=0;
for i=1:length(angle)
t_k=t_k+t(i);
Z(i+1)=t_k-mid_s;
end
for i=1:length(angle)
Z_e=[Z(1:length(angle))';Z(1:length(angle))'+(t(i)/2)]; %% location in each lamina including TOP, middle , and bottom
end
if length(angle)==1
Z_an=[Z_e(:)',Z(length(angle)+1:end)]; %% location for all laminate
else
Z_a=[Z_e(:)',Z(length(angle)+1:end)];
indices=ones(size(Z_a));
indices(3:2:length(indices)-1)=2;
Z_an=repelem(Z_a,indices);
end
A=zeros(3,3);
for j=1:3
for v=1:3
for i=1:length(angle)
za=Z(i+1)-Z(i);
A(j,v)=A(j,v)+Q_tran(j,v,i)*za;
end
end
end
B=zeros(3,3);
for j=1:3
for v=1:3
for i=1:length(angle);
B(j,v)=B(j,v)+Q_tran(j,v,i)*(Z(i+1)^2-Z(i)^2)*(1/2);
end
end
end
D=zeros(3,3);
for j=1:3
for v=1:3
for i=1:length(angle);
zd=Z(i+1)^3-Z(i)^3;
D(j,v)=D(j,v)+Q_tran(j,v,i)*zd*1/3;
end
end
end
M=[A B;B D];
F=[0;0;0;0;0;10]; % ADD APPLIED FORCES HERE
%F=[N_x;N_y;N_xy;M_x;M_y;M_xy;]
E=inv(M)*F; % STRAIN
e=E(1:3);
k(1:3)=E(4:end); % curvature
str_sigma_1=1000;
str_sigma_2=100;
str_t_12=150;
% STEPFIVE
tsai_wu=H1*str_sigma_1+H2*str_sigma_2+H6*str_t_12+H11*(str_sigma_1)^2+...
H22*(str_sigma_2)^2+H66*(str_t_12^2)+2*H12*str_sigma_1*str_sigma_2;
if tsai_wu>10
disp('output')
else
disp('NO')
end %% THEN HOW TO MAKE IT REPEAT IT SELF UNTIL REACHING TO THE CORRECT ANGLES AND THICKNESS ??

Antworten (0)

Kategorien

Mehr zu Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by