how to plot graph for U wrt L_lime from 0.001 to 0.003 with differance 0.001? getting error using / matrix dimension must agree. the value of L_lime changes U value
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
SHARVARI
am 5 Jun. 2023
Kommentiert: SHARVARI
am 9 Jun. 2023
di=0.01;
do=0.025;
hi=5000;
m_dot = 0.3;
k= 0.598;
rho=998;
knew=1.004*10^-6;
pr=7.01;
dh=do-di
Ac = pi*((do^2)-(di^2))/4
vel=m_dot/(rho*Ac)
Re=(vel*dh)/knew
if Re>4000
Nu=0.023*(Re^0.8)*(pr^0.4)
end
ho= (k*Nu)/dh
k_lime=1.3;
L_lime = [0.001:0.003:0.0001];
U=(1/((1/hi)+(L_lime/k_lime)+(1/ho)))
0 Kommentare
Akzeptierte Antwort
Diwakar Diwakar
am 5 Jun. 2023
To perform the division between L_lime and k_lime, you need to ensure that their dimensions match. If you want to divide each element of L_lime by k_lime, you can use element-wise division by adding a dot before the slash operator.
Try this code:
di = 0.01;
do = 0.025;
hi = 5000;
m_dot = 0.3;
k = 0.598;
rho = 998;
knew = 1.004 * 10^-6;
pr = 7.01;
dh = do - di;
Ac = pi * ((do^2) - (di^2)) / 4;
vel = m_dot / (rho * Ac);
Re = (vel * dh) / knew;
if Re > 4000
Nu = 0.023 * (Re^0.8) * (pr^0.4);
else
Nu = 0; % Set Nu to zero if Re is not greater than 4000
end
ho = (k * Nu) / dh;
k_lime = 1.3;
L_lime = 0.001:0.003:0.0001;
U = (1 ./ ((1 ./ hi) + (L_lime ./ k_lime) + (1 ./ ho)));
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots 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!