Matrix Issue Line 33, 35, 37
1 view (last 30 days)
Show older comments
Hi. Line 33, 35, and 37 (v_a2, s1_a2, s2_a2) are supposed to create a matrix/array (not sure what the right term is) like Line 27 and Line 29 does.
Note that v_a2 uses K_a1 and Mu_a1 which are both matrix/array and then v_a2 is used for s1_a2 and s2_a2.
I am not sure how to accomplish this. Please help!
% Approach 1
E_m = 70000; % Elastic modulus of matrix, MPa
v_m = .33; % Poisson ratio of matrix
E_i = 250000; % Elastic modulus of inclusion, MPa
v_i = .2; % Poisson ratio of inclusion
% Fiber volume fraction
f_i = 0:0.01:1;
% 0 is 0% fiber and 1 is 100% fiber content
% points to be plotted
K_m = (E_m)/(3*(1-2*v_m));
K_i = (E_i)/(3*(1-2*v_i));
Mu_m = (E_m)/(2*(1+v_m));
Mu_i = (E_i)/(2*(1+v_i));
% Iteration 1
s1_a1 = (1+v_m)/(3*(1-v_m));
s2_a1 = (2*(4-5*v_m))/(15*(1-v_m));
K_a1 = K_m*((1+f_i*(K_m/(K_m-K_i)-s1_a1)^-1)).^-1;
Mu_a1 = Mu_m*((1+f_i*(Mu_m/(Mu_m-Mu_i)-s2_a1)^-1)).^-1;
% Iteration 2
v_a2 = (3*K_a1-2*Mu_a1)/(2*(3*K_a1+Mu_a1));
s1_a2 = (1+v_a2)/(3*(1-v_a2));
s2_a2 = (2*(4-5*v_a2))/(15*(1-v_a2));
K_a2 = K_m*(1+(f_i*((K_i/K_m)-1).*(1+((K_i./K_a1)-1)*s1_a2).^-1));
Mu_a2 = Mu_m*(1+(f_i*((Mu_i/Mu_m)-1).*(1+((Mu_i./Mu_a1)-1)*s2_a2).^-1));
% Plotting
figure(1)
plot(f_i,K_a1, 'Color', 'red', 'LineWidth', 2);
hold on;
plot(f_i,K_a2, 'Color', 'black', 'LineWidth', 2);
hold off;
%plot(f_i,K_a3, 'Color', 'blue', 'LineWidth', 2);
%hold on;
%plot(f_i,K_a4, 'Color', 'cyan', 'LineWidth', 2);
%hold on;
%plot(f_i,K_a5, 'Color', 'yellow', 'LineWidth', 2);
%hold on;
%plot(f_i,K_Reuss, 'Color', 'magenta', 'LineWidth', 2);
%hold on;
%plot(f_i,K_Voigt, 'Color', 'green', 'LineWidth', 2);
%hold off;
grid off;
legend('K_a_1', 'K_a_2','K_a_3', 'K_a_4', 'K_a_5', 'K_R_e_u_s_s',...
'K_V_o_i_g_t')
legend('Location','northwest','FontSize',12)
title('Approach 1: Bulk Modulus vs. Inclusion Volume Fraction')
xlabel('Inclusion Volume Fraction, f_i')
ylabel('Bulk Modulus, K [MPa]')
0 Comments
Accepted Answer
Voss
on 22 Mar 2022
Use element-wise division (./) in the calculations on those lines, and use element-wise multiplication (.*) in the subsequent calculations of K_a2 and Mu_a2, since they are using vectors now.
% Approach 1
E_m = 70000; % Elastic modulus of matrix, MPa
v_m = .33; % Poisson ratio of matrix
E_i = 250000; % Elastic modulus of inclusion, MPa
v_i = .2; % Poisson ratio of inclusion
% Fiber volume fraction
f_i = 0:0.01:1;
% 0 is 0% fiber and 1 is 100% fiber content
% points to be plotted
K_m = (E_m)/(3*(1-2*v_m));
K_i = (E_i)/(3*(1-2*v_i));
Mu_m = (E_m)/(2*(1+v_m));
Mu_i = (E_i)/(2*(1+v_i));
% Iteration 1
s1_a1 = (1+v_m)/(3*(1-v_m));
s2_a1 = (2*(4-5*v_m))/(15*(1-v_m));
K_a1 = K_m*((1+f_i*(K_m/(K_m-K_i)-s1_a1)^-1)).^-1;
Mu_a1 = Mu_m*((1+f_i*(Mu_m/(Mu_m-Mu_i)-s2_a1)^-1)).^-1;
% Iteration 2
% v_a2 = (3*K_a1-2*Mu_a1)/(2*(3*K_a1+Mu_a1));
% s1_a2 = (1+v_a2)/(3*(1-v_a2));
% s2_a2 = (2*(4-5*v_a2))/(15*(1-v_a2));
v_a2 = (3*K_a1-2*Mu_a1)./(2*(3*K_a1+Mu_a1))
s1_a2 = (1+v_a2)./(3*(1-v_a2))
s2_a2 = (2*(4-5*v_a2))./(15*(1-v_a2))
% K_a2 = K_m*(1+(f_i*((K_i/K_m)-1).*(1+((K_i./K_a1)-1)*s1_a2).^-1));
% Mu_a2 = Mu_m*(1+(f_i*((Mu_i/Mu_m)-1).*(1+((Mu_i./Mu_a1)-1)*s2_a2).^-1));
K_a2 = K_m*(1+(f_i.*((K_i/K_m)-1).*(1+((K_i./K_a1)-1).*s1_a2).^-1))
Mu_a2 = Mu_m*(1+(f_i.*((Mu_i/Mu_m)-1).*(1+((Mu_i./Mu_a1)-1).*s2_a2).^-1))
% Plotting
figure(1)
plot(f_i,K_a1, 'Color', 'red', 'LineWidth', 2);
hold on;
plot(f_i,K_a2, 'Color', 'black', 'LineWidth', 2);
hold off;
%plot(f_i,K_a3, 'Color', 'blue', 'LineWidth', 2);
%hold on;
%plot(f_i,K_a4, 'Color', 'cyan', 'LineWidth', 2);
%hold on;
%plot(f_i,K_a5, 'Color', 'yellow', 'LineWidth', 2);
%hold on;
%plot(f_i,K_Reuss, 'Color', 'magenta', 'LineWidth', 2);
%hold on;
%plot(f_i,K_Voigt, 'Color', 'green', 'LineWidth', 2);
%hold off;
grid off;
legend('K_a_1', 'K_a_2','K_a_3', 'K_a_4', 'K_a_5', 'K_R_e_u_s_s',...
'K_V_o_i_g_t')
legend('Location','northwest','FontSize',12)
title('Approach 1: Bulk Modulus vs. Inclusion Volume Fraction')
xlabel('Inclusion Volume Fraction, f_i')
ylabel('Bulk Modulus, K [MPa]')
0 Comments
More Answers (2)
Mathieu NOE
on 22 Mar 2022
hello
I put the dots so that the multiplication and division are performed element by element between arrays , but the result looks strange to me (a modulus that drop until it gets negative seems wrong)
also , but this is my preference , instead of writing A .* (B.^-1) I prefer the simpler A./B
It's late now for me so I'll have a look again tomorrow
i'm surprised for example so see this equation that mix a modulus and poisson ratio as physically equivalent terms ... like adding tomatoes with oranges ??
v_a2 = (3*K_a1-2*Mu_a1)./(2*(3*K_a1+Mu_a1));
code
clc
clearvars
% Approach 1
E_m = 70000; % Elastic modulus of matrix, MPa
v_m = .33; % Poisson ratio of matrix
E_i = 250000; % Elastic modulus of inclusion, MPa
v_i = .2; % Poisson ratio of inclusion
% Fiber volume fraction
f_i = 0:0.01:1;
% 0 is 0% fiber and 1 is 100% fiber content
% points to be plotted
K_m = (E_m)/(3*(1-2*v_m));
K_i = (E_i)/(3*(1-2*v_i));
Mu_m = (E_m)/(2*(1+v_m));
Mu_i = (E_i)/(2*(1+v_i));
% Iteration 1
s1_a1 = (1+v_m)/(3*(1-v_m));
s2_a1 = (2*(4-5*v_m))/(15*(1-v_m));
% K_a1 = K_m*((1+f_i*(K_m/(K_m-K_i)-s1_a1)^-1)).^-1;
K_a1 = K_m./((1+f_i*(K_m/(K_m-K_i)-s1_a1)^-1));
% Mu_a1 = Mu_m*((1+f_i*(Mu_m/(Mu_m-Mu_i)-s2_a1)^-1)).^-1;
Mu_a1 = Mu_m./((1+f_i*(Mu_m/(Mu_m-Mu_i)-s2_a1)^-1));
% Iteration 2
v_a2 = (3*K_a1-2*Mu_a1)./(2*(3*K_a1+Mu_a1));
s1_a2 = (1+v_a2)./(3*(1-v_a2));
s2_a2 = (2*(4-5*v_a2))./(15*(1-v_a2));
% K_a2 = K_m*(1+(f_i*((K_i/K_m)-1).*(1+((K_i./K_a1)-1).*s1_a2).^-1));
K_a2 = K_m*(1+(f_i*((K_i/K_m)-1)./(1+((K_i./K_a1)-1).*s1_a2)));
% Mu_a2 = Mu_m*(1+(f_i*((Mu_i/Mu_m)-1).*(1+((Mu_i./Mu_a1)-1).*s2_a2).^-1));
Mu_a2 = Mu_m*(1+(f_i*((Mu_i/Mu_m)-1)./(1+((Mu_i./Mu_a1)-1).*s2_a2)));
% Plotting
figure(1)
plot(f_i,K_a1, 'Color', 'red', 'LineWidth', 2);
hold on;
plot(f_i,K_a2, 'Color', 'black', 'LineWidth', 2);
% plot(f_i,K_a3, 'Color', 'blue', 'LineWidth', 2);
% plot(f_i,K_a4, 'Color', 'cyan', 'LineWidth', 2);
% plot(f_i,K_a5, 'Color', 'yellow', 'LineWidth', 2);
% plot(f_i,K_Reuss, 'Color', 'magenta', 'LineWidth', 2);
% plot(f_i,K_Voigt, 'Color', 'green', 'LineWidth', 2);
hold off;
grid off;
legend('K_a_1', 'K_a_2','K_a_3', 'K_a_4', 'K_a_5', 'K_R_e_u_s_s',...
'K_V_o_i_g_t')
legend('Location','northwest','FontSize',12)
title('Approach 1: Bulk Modulus vs. Inclusion Volume Fraction')
xlabel('Inclusion Volume Fraction, f_i')
ylabel('Bulk Modulus, K [MPa]')
See Also
Categories
Find more on Surface and Mesh Plots 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!