Off[General::"spell1"];

cp = 470;
cm = 0.01;
el = 3;
ro = 7850;
γFe = (0.000000245^(-1));
d = 0.3;
m = Pi*((d^2)/4)*el*ro;
minuta = 60;
cas = 40  minuta;
ΔT = 1000;
energie = 1.  ro*cp*ΔT;
vykon = (energie/cas);
Pt = 1.5*vykon;

<< Miscellaneous`PhysicalConstants`

μ = (VacuumPermeability // 
            N)[[1]]

ω = 100.  Pi;
γCu = 56*(10^6);
aFe = (Sqrt[(2/(ω*γFe*μ))]);
aCu = (Sqrt[(2/(ω*γCu*μ))]);

dingot = 0.3;
d2 = dingot - aFe;
R2 =  Pi*d2/(γFe*aFe*el)

mezera = 3  cm;
dinduktor = dingot + 2*mezera;
d1 = dinduktor + aCu;
R1 = (n1^2)* Pi*d1/(γCu*aCu*el)

\(\(Print[\*""\!\(d2\/el\)= "", 
        d2\/el];\)\)
α2 = 0.97;
L2 =  Pi*(((d2^2)*(1^2))/(4  el))*μ*α2;

\(\(Print[\*""\!\(d1\/el\)= "", 
        d1\/el];\)\)
α1 = 0.96;
L1 =  Pi*(((d1^2)*(n1^2))/(4  el))*μ*α1;

datF = {{0.2, 0.2, 1, 0.966}, {0.2, 
            0.2, 1.1, 0.880}, {0.3, 0.2, 1, 0.930}, {0.3, 0.3, 1, 
            0.931}};

    nahF = Fit[datF, {1, p1, p2, pl}, {p1, p2, pl}]

    naseF = 
      nahF /. {p1 -> 0.12, p2 -> 0.09, pl -> 1}

F = naseF
M =  Pi*(((d2^2)*1*n1)/(4  el))*μ*F

data = 
        Table[{x, Sin[x]}, {x, -Pi, Pi, 
            Pi/10. }];
intOrd = 2;
nahSin[
          x_] = Interpolation[data, InterpolationOrder -> intOrd][
          x];
Plot[nahSin''[x], {x, -Pi, Pi}]

datF = {{0.2, 0.2, 1, 0.966}, {0.2, 
            0.2, 1.1, 0.880}, {0.3, 0.2, 1, 0.930}, {0.3, 0.3, 1, 
            0.931}};

    nahF = Fit[datF, {1, p1, p2, pl}, {p1, p2, pl}]

    naseF = 
      nahF /. {p1 -> 0.12, p2 -> 0.09, pl -> 1}

U = 400;
rc1 = 
        U == 
          R1*i1 + L1*I*ω*i1 + 
            M*I*ω*i2;
rc2 = 
        0 == 
          R2*i2 + L2*I*ω*i2 + 
            M*I*ω*i1;
rc3 = R2*Abs[i2]^2 == Pt;
res = Solve[{rc1, rc2}, {i1, 
            i2}][[1]]
rcevykon = rc3 /. res

FindRoot[rcevykon, {n1, 10, 1000}]

(rcevykon /. Abs[tt_] -> (Sqrt[Re[tt]^2 + Im[tt]^2]) // Simplify) // 
      Solve

dosn1 = {n1 -> 50};
dosproudy = res /. dosn1

iim = Im[i1 /. dosproudy]

Solve[ω*cap*U == -iim]

tgδ = (10^(-3));
Pzkondy = -iim*U*tgδ;
Print["ztraty v kom. kondech= ", Pzkondy, " W"]

Pztraty = Abs[i1]^2 R1 /. dosn1 /. dosproudy

ucinnost = (Pt/(Pt + Pztraty + Pzkondy))

dizmax = ((dinduktor - dingot)/2)

σ = 5.67*(10^(-8));
λ = 0.2;
Qsal = 
        S1*(σ/((1/ϵ)1 + (S1/S2)*((1/ϵ)2 - 1)))*((((T1 + 273))^4) - (((T3 + 273))^4)) /. {ϵ1 -> 
              1, ϵ2 -> 1, 
            S1 -> Pi*dingot*el};
Rtheta = 
        (1/(2*Pi*el*λ))*Log[(r2/r1)] //. {r2 -> (dinduktor/2), 
            r1 -> r2 - diz};

ClearAll[diz];
rcT1 = Qsal == Qz;
rcT2 = ((T3 - T2)/Rtheta) == Qz;
naserce = {rcT1, rcT2} /. {T1 -> 1020, 
            T2 -> 80};
resTeplo = Solve[
            naserce, {T3, Qz}][[2]];
ztratyteplo[diz_] = Qz /. resTeplo;
Plot[ztratyteplo[diz], {diz, 0, dizmax}, 
        AxesLabel -> {"diz", "ztraty"}];

ztratyteplo[0.0001]
tepztraty = ztratyteplo[dizmax/2]

Pztraty + tepztraty
Pzind = (10^6);

el

Tvstup = 45;
Tvystup = 75;
cp = 4186. ;
Pzind == msteckou*cp*(Tvystup - Tvstup) // 
      Solve
dosm = %;

a = 4.2  cm;
b = 3  cm;
Sdira = a*b;
ro = 1000;
vesteckou = 
        (msteckou/ro) /. dosm[[1]];
v = (vesteckou/Sdira);
\(Print["v= ", v, \*"" m.\!\(s\^\(-1\)\)""]\)

Dchar = ((4*Sdira)/(2*(a + b)));
Print["Dchar= ", 100  Dchar, " cm"]

ν = 0.366*(10^(-6));
Rey = ((Dchar*v)/ν);
Pr = 2.23;
Nu = 0.023*(Rey^0.8)*(Pr^0.4);
Print["Nu= ", Nu, " -"];
λH2O = 0.580*1.16;
α = ((Nu*λH2O)/Dchar);
\(\(Print["α= ", α, \*"" W.m.(K^(-1))""];\)\)

Ssmena=Pi*(a)*(dinduktor + 2*1.2  cm)*n1/.dosn1;
Solve[α*
          Ssmena*ΔTvoda == Pzind]

<< Miscellaneous`ChemicalElements`

λCu = ThermalConductivity[Copper][[1]]

RthetaCu = (dodp/(λCu*S)) /. {dodp -> 3  cm, 
            S -> (0.8  cm*Pi*(dinduktor + 2*1.2  cm)*n1)} /. 
        dosn1

RthetaCu*Pzind/2

Series[p[x], {x, x0, 1}]

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

Grad[gz*z]

r0 = 1;
\(\(Plot[1 - \((r\/r0)\)\^6, {r, \(-1\), 1}, 
        AxesLabel -> {"r[m]", \*""v[m.\!\(s\^\(-1\)\)]""}, 
        PlotStyle -> {Thickness[0.008], Thickness[0.008]}, 
        PlotRange -> All];\)\)

ClearAll[T1, T2, T3, T4];
T4 = 75;
T3 = 45;
T1 = 40;
m2 = 10;
m1 = msteckou /. dosm[[1]];
rce1 = 
        m1*T4 + m2*T1 == m1*T3 + m2*T2;
Δ1 = T4 - T2;
Δ2 = T3 - T1;
rce2 = 
        cp*m1*(T4 - T3) == 
          kS*((Δ1 - Δ2)/Log)[Δ(1/Δ)2];
dos = FindRoot[{rce1, rce2}, {T2, 60}, {kS, 1000}] // Chop

V2steckou = (m2/1000.) ;
D2 = 5  cm;
v2 = (V2steckou/(Pi*((D2^2)/4)));
p2dyn = (1/2)*1000*(v2^2);
Rey = Rey = ((D2*v2)/ν);
Print["Re= ", Rey]
ξ = 0.0032 + (0.221/(Rey^0.237));
Print["ξ= ", ξ];
Δp1m = ξ*p2dyn*(1/D2);
Print["Δp1m= ", Δp1m, " Pa"]
Δp1m*V2steckou;
Print["P1m= ", %, " W"]

Ddira = 0.5  cm;
nder = 100;
Sdira = ((Pi*(Ddira^2))/4);
vdira = (V2steckou/(Sdira*nder));
pzdira1 = (1/2) 1000*(vdira^2)