<< Calculus`VectorAnalysis`;
SetCoordinates[Cartesian[x, y, z]];

resT = DSolve[{T''[x] == 0, T[0] == T1, 
              T[d] == T2}, T[x], 
            x][[1]];
teplota = T[x] /. resT
qx = -λ*Grad[teplota][[1]] // Simplify

zed = {d -> 0.45, T1 -> 15, 
          T2 -> 0, λ -> 0.8};
\(Print["qx= ", 
      qx /. zed, \*"" W.\!\(m\^\(-2\)\)""]\)

dosabPha = Solve[{a*10 + b == (1/35), 
            a*50 + b == (1. /10)}][[1]]

dosabMB = Solve[{a*20 + b == (1/72), 
            a*75 + b == (1. /30)}][[1]]

ρ = 1000;
cp = 4186;
Ecko = (230/0.1);
rce = ρ*cp*T'[t] == (a*T[t] + b)*(Ecko^2) /. 
          dosabPha;
teplota = 
        T[t] /. DSolve[{rce, T[0] == 9}, T[t], 
              t][[1]];
t100 = 
        t /. FindRoot[
            teplota == 100, {t, 1000}];
Plot[teplota, {t, 0, t100}]
Print["cas= ", (t100/60), " min"]

T1 = 9;
T2 = 40;
msteckou = 1;
cp = 4186;
Q = msteckou*cp*(T2 - T1);
Print["vykon= ", (Q/1000.) , " kW"]

cm = 0.01;
mm = 0.1  cm;
d = 3  mm;
ρ = 1000;
Ecko = (230/d);
y = 15  cm;
Vsteckou = (msteckou/ρ);
vx = (Vsteckou/(d*y));
rce = ρ*cp*vx*T'[x] == (a*T[x] + b)*(Ecko^2) /. 
          dosabPha;
poc = T[0] == T1;
teplota = T[x] /. DSolve[{rce, poc}, T[x], x][[1]]; 
    delka = x /. 
        FindRoot[teplota == T2, {x, 0.5}]
Plot[teplota, {x, 0, delka}, 
      PlotStyle -> {Hue[0.63], Thickness[0.008]}, 
      AxesLabel -> {"x[m]", "T[°C]"}]

cm = 0.01;
mm = 0.1  cm;
d = 3  mm;
ρ = 1000;
Ecko = (230/d);
y = 15  cm;
Vsteckou = (msteckou/ρ);
vx = (Vsteckou/(d*y));
rce = ρ*cp*vx*T'[x] == (a*T[x] + b)*(Ecko^2) /. 
          dosabMB;
poc = T[0] == T1;
teplota = 
      T[x] /. DSolve[{rce, poc}, T[x], x][[1]];   
Plot[
      teplota, {x, 0, delka}, 
      PlotStyle -> {Hue[0.63], Thickness[0.008]}, 
      AxesLabel -> {"x[m]", "T[°C]"}]

Tin = 20;

    Texter = -18;

    λ = 0.8;

    d = 0.45;

    αin = 5;

    S = 1;

    αext = 23;

    Solve[{Q == αin*S*(Tin - T1), 
        Q == αext*S*(T2 - Texter), 
        Q == ((T1 - T2)/((d/(λ*S))))}]

λiz = 0.04;
R1 = (1/(αin*S));
R4 = (1/(αext*S));
R2 = (d/(λ*S));
R3 = (diz/(λiz*S));
Solve[{Q == ((Tin - 18)/R1), 
          Q == ((18 - Texter)/(R2 + R3 + R4))}][[1]]
(R3/R2) /. %

Plot[{10  Log[ξ], (ξ^2) - 1},{ξ, 1, 10},AxesLabel->{"(r2/r1)","odpor,cena"},PlotStyle -> {{Hue[0], Thickness[0.008]}, {Hue[0.63], 
              Thickness[0.008]}}]

λ =. ;
Rsum = 
      (1/(2*Pi*λ*delka))*Log[(r2/r1)] + 
        (1/(2*Pi*α*delka*r2))

D[Rsum, r2] == 0 // Solve[#, r2] &

dostepiz = {λ -> 0.04, α -> 
            15};
doseliz = {λ -> 0.4, α -> 
            50};
(λ/α) /. dostepiz
(λ/α) /. doseliz

mm = 0.001;
α = 10;
ϵ = 0.8;
Tok = 20;
Tor = 15;
Tmax = 60;
prurez = 1  (mm^2);
Solve[prurez == Pi*(r^2)];
polomer = r /. % [[2]];
Print["r= ", polomer, "  m"]
delka = 1;
povrch = 2*Pi*polomer*delka;
\(\(Print["S= ", 
        povrch, \*""  \!\(m\^2\)""];\)\)
Konvekce = α*
          povrch*(Tmax - Tok);
Print["Qk= ", Konvekce, "  W"];

<< Miscellaneous`PhysicalConstants`

σ = StefanConstant[[1]];

VykonSalanim = 
        povrch*ϵ*σ*((((Tmax + 273.15))^4) - (((Tor + 273.15))^4));

Print["Qr= ", VykonSalanim, "  W"];

γ = 57*(10^6);

odpor = (delka/(γ*prurez));

Print["odpor= ", 
        odpor, "  Ω"];
Solve[
        VykonSalanim + Konvekce == 
          odpor*(i^2)];
Print["I= ", i /. %[[2]], "  A"];

U = 400. ;
cosfi = 1;
tanfi = -((Sqrt[1 - (cosfi^2)])/cosfi);
kW = 1000;
P = 30  kW;
fi = -ArcCos[cosfi];
Y = (P/(U^2))*(1 - I*Tan[fi])
Y = 
      (P/(U^2))*(1 - 
            I*tanfi)

-93.8 - (187.3/(Sqrt[3])) + (62.5/(Sqrt[3]))

(125/(Sqrt[3])) - (62.5/(Sqrt[3]))

46.9 - (125/(Sqrt[3])) + (187.5/(Sqrt[3]))

a = 
        1;

    b = 1;

    c = 2;

    Tpec = 1200;

    cm = 0.01;

    d1 = 3  cm;

    Tpl = 50;

    ϵ = 0.9;

    α = 5;

datλPl = {{1100, 0.4}, {1000, 0.36}} // 
          Union;

      
λ1 = 
        Fit[datλPl, {1, T}, T] /. 
          T -> Tpec;
λ2 = 0.186;
\(Print["λ1= ", λ1, \*"" W.(m^(-1)).(K^(-1))""]\)
\(Print["λ2= ", λ2, \*"" W.(m^(-1)).(K^(-1))""]\)

S1 = 
        2*((a + d1)*(b + d1) + (a + d1)*(c + d1) + (c + 
                    d1)*(b + d1));
\(Print["S1= ", 
      S1, \*"" \!\(m\^2\)""]\)
Rt1 = (d1/(λ1*S1));

S2 = 
        2*((a + 2  d1 + d2)*(b + 2  d1 + d2) + (a + 2  d1 + 
                    d2)*(c + 2  d1 + d2) + (c + 2  d1 + d2)*(b + 
                    2  d1 + d2));
\(Print["S2= ", 
      S2, \*"" \!\(m\^2\)""]\)
Rt2 = (d2/(λ2*S2));

S3 = 
        2*((a + 2  d1 + 2  d2)*(b + 2  d1 + 2  d2) + (a + 2  d1 + 
                    2  d2)*(c + 2  d1 + 2  d2) + (c + 2  d1 + 
                    2  d2)*(b + 2  d1 + 
                    2  d2));
\(Print["S3= ", S3, \*"" \!\(m\^2\)""]\)

Tok = 25;
Tor = 15;
d = d2 /. resd2;
σ = 5.67*(10^(-8));
Qk = α*S3*(Tpl - Tok);
Qr = ϵ*σ*
          S3*((((Tpl + 273))^4) - (((Tor + 273))^4));
resd2 = 
        Solve[((Tpec - Tpl)/(Rt1 + Rt2)) == Qk + Qr] // 
          Last;
Print["d2= ", 
        d2 /. resd2, " m"];
ztraty = Qk + Qr /. resd2;
Print["Pz= ", ztraty, " W"];

nabeh = (t/(t + 1));
Plot[nabeh, {t, 0, 100}]

vyr[x_] = (-ArcTan[(x - 1200)*100] + (Pi/2))/
          Pi;
Plot[vyr[x], {x, -10 + 1200, 1200 + 10}];

qk = α*(T[d, t] - 
              Tok);
qr = ϵ*σ*((((T[d, t] + 273))^4) - (((Tor + 273))^4));
qd = 2000;
λ = 
        0.186;
ρ = 
        100;
cp = 
        969;
rce = ρ*cp*
            D[T[x, t], t] == λ*
            D[T[x, t], {x, 2}];
poc = 
        T[x, 0] == Tok;
okrLeft=qd*nabeh*vyr[T[x, t]]==-λ*D[T[x, t], x]/.x -> 0;
okrRight=(qk + qr)*nabeh==-λ*D[T[x, t], x]/.x -> d;
hodina = 
        3600;
tmax = 
        10*hodina;
resT=NDSolve[{rce, poc, okrLeft, okrRight},T[x, t],{x, 0, d},{t, 0, tmax},MaxStepSize->{d/100, tmax/10000},MaxSteps -> (10^6)][[1]];
teplota = 
        T[x, t] /. resT;
Plot3D[
        teplota, {x, 0, d}, {t, 0, tmax}, 
        AxesLabel -> {"x[m]", "    t[s]", "T[°C]   \
"}, PlotRange -> All];
teplotavlevo = 
        teplota /. x -> 0;
Plot[
        teplotavlevo, {t, 0, tmax}, 
        AxesLabel -> {"t[s]", "T[°C]"}, 
        PlotRange -> All];

Pzad = 5000;
U = 230. ;
R = 
        r /. Solve[
              Pzad == ((U^2)/r)][[1]];
Print["R= ", R, "  Ω"]
Tmax = 1350;
Tpec = 1200;
Solve[
          Pzad == ϵ*σ*
              S*((((Tmax + 273))^4) - (((Tpec + 273))^4))][[1]];
\(Print["S= ", \(10\^4\) 
          S /. %, \*"" \!\(cm\^2\)""]\)
\(Print["S/R= ", \(10\^4\) 
          S/R /. %%, \*"" \!\(cm\^2\/Ω\)""]\)

ohmnam = 0.9419;
delka = (R/ohmnam);
Print["l= ", delka, " m"]