Solve multiple equations dependent on each other, knowing how one variable changes
Show older comments
This is what I had first but I'm stuck. An error pops up (Error using / Matrix dimensions must agree) in line 10 where I have s = (w+2)/N. So I tried the loop, I think I did something wrong with the loop because the answers are wrong compared to the actual. Final answers I'm trying to get are for q_c, q_f, T_b, T_tip, and volume of aluminum chip. I'm not sure how to resolve this. Thank you
w = 0.02; % with of aluminum chip
k = 180; % W/(m*K)
Lb = 0.003; % Base thickness, in meters
Lf = 0.012; % Fin length, in meters
T_infinity = 20; % degree C
T_chip = 85; % degree C
A_b = w^2; % Area of Base
Rt_cont = 0.00002/(A_b); % Contact Resistance (K/W)
N = [3,4,5,6,7,8,9,10]; % Number of fins from 3 to 10 intervals of 1
s = (w + 2)/N; % Spacing between Fins
t = s - 2; % Thickeness of Fins
P = 2*w + 2*t; % Perimeter of Fin, in meters
A_f = 2*w*Lf; % Area of Fin, in meters
A_t = N*A_f + (w^2) - (N*w*t); % Total Area
A_c = w*t; % Cross sectional Area
Rt_cond = Lb/(k*A_b); % Conduction Resistance (K/W)
m = sqrt((h*P)/(k*A_c))
n_f = tanh(m*Lf)/(m*Lf); % Fin Efficiency
n_o = 1-((N*A_f)*(1-n_f))/(A_t); % Overrall Efficiency
Rt_f = 1/(n_o*h*A_t); % Fin Resistance
Req = Rt_cont + Rt_cond + Rt_f; % Total Resistance
q_c = (T_chip - T_infinity)/Req; % Changes depending on Req because req depends on Rt_f which changes depending on N
T_b = T_infinity + (q_c*Rt_f);
T_tip = T_infinity + ((T_b - T_infinity)*(1/(cosh(m*Lf))));
M = sqrt(h*P*k*A_c)*(T_b*T_infinity)*tanh(m*Lf);
q_f = M*tanh(m*Lf);
1 Comment
Stephan
on 28 Feb 2019
h is not defined
Answers (1)
Stephan
on 28 Feb 2019
Hi,
due to N is a vector you have to use '.*' and './' to perform elementwise operations and avoid this error. Since h is not defined, i setted it equal to 1. It appears to work mow:
h = 1;
w = 0.02; % with of aluminum chip
k = 180; % W/(m*K)
Lb = 0.003; % Base thickness, in meters
Lf = 0.012; % Fin length, in meters
T_infinity = 20; % degree C
T_chip = 85; % degree C
A_b = w^2; % Area of Base
Rt_cont = 0.00002/(A_b); % Contact Resistance (K/W)
N = [3,4,5,6,7,8,9,10]; % Number of fins from 3 to 10 intervals of 1
s = (w + 2)./N; % Spacing between Fins
t = s - 2; % Thickeness of Fins
P = 2*w + 2*t; % Perimeter of Fin, in meters
A_f = 2*w*Lf; % Area of Fin, in meters
A_t = N.*A_f + (w^2) - (N.*w.*t); % Total Area
A_c = w*t; % Cross sectional Area
Rt_cond = Lb/(k*A_b); % Conduction Resistance (K/W)
m = sqrt((h*P)/(k*A_c));
n_f = tanh(m*Lf)/(m*Lf); % Fin Efficiency
n_o = 1-((N*A_f)*(1-n_f))/(A_t); % Overrall Efficiency
Rt_f = 1./(n_o.*h*A_t); % Fin Resistance
Req = Rt_cont + Rt_cond + Rt_f; % Total Resistance
q_c = (T_chip - T_infinity)./Req; % Changes depending on Req because req depends on Rt_f which changes depending on N
T_b = T_infinity + (q_c.*Rt_f);
T_tip = T_infinity + ((T_b - T_infinity)*(1/(cosh(m*Lf))));
M = sqrt(h.*P*k.*A_c).*(T_b*T_infinity)*tanh(m*Lf);
q_f = M*tanh(m*Lf);
Best regards
Stephan
Categories
Find more on Symbolic Math Toolbox 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!