Plotting graph with for-end loop in
Show older comments
How do i plot a graph of the data in the for-end loop.
Looking to plot a varying Vf against Ex,Ey,Gxy,vxy.
>> %Setting all original variables
Em=2.4e9;
Ef=76e9;
vm=0.34;
vf=0.22;
theta=30;
for Vf=0:0.1:1
Vm=1-Vf;
%Finding shear and bulk modulus'
Gm=Em/(2*(1+vm));
Gf=Ef/(2*(1+vf));
Km=Em/(3*(1-2*vm));
Kf=Ef/(3*(1-2*vf));
%Find k*,E1,v12,G12
k=(Km*(Kf+Gm)*Vm+Kf*(Km+Gm)*Vf)/((Kf+Gm)*Vm+(Km+Gm)*Vf);
E1=Em*Vm+Ef*Vf;
v12=vm*Vm+vf*Vf+((vf-vm)*((1/Km)-(1/Kf))*Vm*Vf)/((Vm/Kf)+(Vf/Km)+(1/Gm));
G12=Gm+(Vf/((1/(Gf-Gm))+(Vm/(2*Gm))));
%Beta's, gamma's, alphas and roe
betam=1/(3-4*vm);
betaf=1/(3-4*vf);
gamma=Gf/Gm;
alpha=(betam-gamma*betaf)/(1+gamma*betaf);
roe=(gamma+betam)/(gamma-1);
%G23, E2 and v23
G23=Gm*(1+((1+betam)*Vf)/(roe-(1+(3*betam^2*Vm^2)/(alpha*Vf^3+1))*Vf));
E2=4/((1/G23)+(1/k)+(4*v12^2/E1));
v23=(E2/2*G23)-1;
%Creating reduced lamina stiffness matrix
Z=(E1-v12^2*E2)/E1;
Q11=E1/Z;
Q22=E2/Z;
Q12=v12*E2/Z;
Q66=G12;
Q=[Q11,Q12,0;Q12,Q22,0;0,0,Q66];
%Transformation matrices
n=sind(theta);
m=cosd(theta);
q11=Q11*m^4+Q22*n^4+2*m^2*n^2*(Q12+2*Q66);
q12=m^2*n^2*(Q11+Q22-4*Q66)+(m^4+n^4)*Q12;
q16=(Q11*m^2-Q22*n^2-(Q12+2*Q66)*(m^2-n^2))*m*n;
q22=Q11*n^4+Q22*m^4+2*m^2*n^2*(Q12+2*Q66);
q26=(Q11*n^2-Q22*m^2+(Q12+2*Q66)*(m^2-n^2))*m*n;
q66=(Q11+Q22+Q12*2)*m^2*n^2+Q66*((m^2-n^2)^2);
q=[q11,q12,q16;q12,q22,q26;q16,q26,q66];
%Finally calculating the laminate properties
Ex=q11-q12^2/q22
Ey=q22-q12^2/q11
Gxy=q66
vxy=q12/q22
end
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!