0
$\begingroup$

I am trying to solve a mathematical model of a heat transfer problem. As an intermediate step there is a characteristic equation in the form of a determinant, which needs to be solved for variable r to get three real roots. These roots feed the subsequent steps. However, the roots I get are really small and probably leads to Indeterminate errors later. I am attaching the entire script below:

Nuc = 5.33; Nuh = 6.49;
mc = 9.305 E - 08; mh = 1.1246 E - 07;
k = 16.27;
vc = (mc/1.138)/(0.5 2 10^-6); vh = (mh/1.225)/(0.25 2 10^-6);
cpc = 1039; cph = 1006.43;
Ac = 2 (0.5 + 2) 10^-6; Ah = 2 (0.25 + 2) 10^-6;

C1 = mc cpc; C2 = mh cph;

hc = Nuc 0.0242/(0.8 10^-3); hh = Nuh 0.0242/(0.444 10^-3);

b1 = hc Ac/C1; b2 = hh Ah/C2;
bc = k (25 1 10^-6)/(1 10^-3 C1);

λ = k (4.5 10^-6)/(25 10^-3 C1);
ν = C1/C2;

bstar = b1 + (b2/ν) + 4 bc;
γ1 = b1/bstar; γ2 = b2/(ν bstar);
γc1 = (2 b1 + 4 bc)/bstar;
γc2 = (2 b2 + 4 ν bc)/(ν bstar);

A = {
   {-r + b1 (1 - γ1), b1 γ2, -b1 γc2},
   {-b2 γ1, -r - b2 (1 - γ2), b2 γc1},
   {r, -r, λ r^2}
  };
sol = LinearSolve[Det[A] == 0,r] 

r1 = r /. sol[[1]]
r2 = r /. sol[[2]]
r3 = r /. sol[[3]]

G1 = (4 b1 b2 bc + 
     2 b1 ((b2/ν) + 
        2 bc) r1)/(4 b1 b2 bc + (((1/ν) - 1) b1 b2 + 
        4 bc (b1 - b2)) r1 - bstar r1^2);
G2 = (4 b1 b2 bc + 
     2 b1 ((b2/ν) + 
        2 bc) r2)/(4 b1 b2 bc + (((1/ν) - 1) b1 b2 + 
        4 bc (b1 - b2)) r2 - bstar r2^2);
G3 = (4 b1 b2 bc + 
     2 b1 ((b2/ν) + 
        2 bc) r3)/(4 b1 b2 bc + (((1/ν) - 1) b1 b2 + 
        4 bc (b1 - b2)) r3 - bstar r3^2);
H1 = (4 b1 b2 bc - 
     2 b2 (b1 + 2 bc) r1)/(4 b1 b2 bc + (((1/ν) - 1) b1 b2 + 
        4 bc (b1 - b2)) r1 - bstar r1^2);
H2 = (4 b1 b2 bc - 
     2 b2 (b1 + 2 bc) r2)/(4 b1 b2 bc + (((1/ν) - 1) b1 b2 + 
        4 bc (b1 - b2)) r2 - bstar r2^2);
H3 = (4 b1 b2 bc - 
     2 b2 (b1 + 2 bc) r3)/(4 b1 b2 bc + (((1/ν) - 1) b1 b2 + 
        4 bc (b1 - b2)) r3 - bstar r3^2);

Num = {
   {((H1 - G1)/r1) E^-r1, ((H2 - G2)/r2) E^-r2, ((H3 - G3)/r3) E^-r3},
   {E^-r1, E^-r2, E^-r3},
   {1, 1, 1}
  };
Den = {
   {(H1 E^-r1 - G1)/r1, (H2 E^-r2 - G2)/r2, (H3 E^-r3 - G3)/r3},
   {E^-r1, E^-r2, E^-r3},
   {1, 1, 1}
  };
eff = 1 - (Det[Num]/Det[Den])

Any help in pointing out my error will is appreciated. The objective is to evaluate eff.

$\endgroup$
7
  • $\begingroup$ Can't you formulate it as an eigenvalue problem? Look at Eigensystem $\endgroup$
    – yarchik
    Jul 2, 2021 at 8:01
  • 1
    $\begingroup$ Try mc = 9.305*10^-8 and mh = 1.1246*10^-7. Expressing exponentials as mc = 9.305 E - 08; mh = 1.1246 E - 07; does something very different. $\endgroup$
    – Roman
    Jul 2, 2021 at 8:17
  • $\begingroup$ Also, try sol = Solve[Det[A] == 0,r] instead of LinearSolve: the equation is not linear. $\endgroup$
    – Roman
    Jul 2, 2021 at 8:17
  • 1
    $\begingroup$ Since your Det[A] is -1.42109*10^-14 r - 3569.61 r^2 + 173.143 r^3 + 30.292 r^4 you get four real roots. One of them is zero, which causes Indeterminate in calculating "Num". $\endgroup$
    – Akku14
    Jul 2, 2021 at 9:54
  • $\begingroup$ Actually, two of the roots are zero; one is positive, and one is negative, for a total of four roots. $\endgroup$
    – Roman
    Jul 2, 2021 at 10:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.