SetDirectory["FileName"/.NotebookInformation[EvaluationNotebook[]]/.FrontEnd`FileName[d_List,nam_,___]:>ToFileName[d]];

cisilka={M->1,Icl->1,W->0,RH->60};
Off[FindRoot::"nlnum",Union::"heads",ReplaceAll::"reps"];
PMV1=(0.303*Exp[-2.1*M]+0.028)*(58.15*(M-W)-3.05*(10^(-3))*(5733-406.7*(M-W)-pa)-24.42*((M-W)-1)-(10^(-3))*M*(5867-pa)-0.0814*M*(34-1.0*ta)-3.96*(10^(-8))*fcl*((((tcl+273))^4)-(((tr+273))^4))-fcl*hc*(tcl-1.0*ta));
dosazeni1={hc->2.38*(((tcl-1.0*ta))^0.25),fcl->1.05+0.1*Icl,pa->((RH/100))*Exp[((1500.3+23.5*ta)/(234+ta))]}/.cisilka;
PMV2=PMV1/.dosazeni1/.cisilka;
pravastrana=35.7-1.6282*(M-W)-0.155*Icl*(3.96*(10^(-8))*fcl*((((tcl+273))^4)-(((tr+273))^4))+fcl*hc*(tcl-ta))-tcl;
prav[ta_,tr_]=pravastrana/.dosazeni1/.cisilka;
dosadzateploty[taa_,trr_]:=Union[{ta->taa,tr->trr},FindRoot[prav[taa,trr]==0,{tcl,taa,35}]];
PeEmVe[taa_,trr_]:=PMV2/.dosadzateploty[taa,trr];
najditrr[ta_,pmvvv_]:=trr/.FindRoot[Evaluate[PeEmVe[ta,trr]]==pmvvv,{trr,15,30}]

Plot[najditrr[ta,0],{ta,16,27},AxesLabel->{"ta[°C]","tr[°C]"}]

datapohoda=Table[{ta,najditrr[ta,0]},{ta,16,26,0.5}];
datapohoda>>datpohoda

nasaepmv=PeEmVe[16.2,15.5]

f[pmv_]:=100-95*Exp[-0.03353*(pmv^4)-0.2179*(pmv^2)];
Plot[f[pmv],{pmv,-3,3}];

ClearAll["Global`*"];

rin=10.;
dConcrete=0.1;
dIsol=0.15;
λConcrete=1;
λIsol=0.04;
Rth[λ_,r1_,r2_]=(((1/r1)-(1/r2))/(4 π λ));
αin=5;
αout=15;
RthConvInside=(1/(αin*4*Pi*(rin^2)));
RthConcrete=Rth[λConcrete,rin,rin+dConcrete];
RthIsol=Rth[λIsol,rin+dConcrete,rin+dConcrete+dIsol];
RthConvOutside=(1/(αin*4*Pi*(((rin+dConcrete+dIsol))^2)));
RthTotal=RthConcrete+RthConvInside+RthConvOutside+RthIsol;
(*(1/RthTotal){RthConcrete,RthConvInside,RthConvOutside,RthIsol}*)
cp=1020;
(*Tin=25;*)
density=(349./(Tin+273));
Tout=-10;
timeOfAirExchange=3600*3;
Volume=(4/3)*Pi*(rin^3);
Vdot=(Volume/timeOfAirExchange);
powerForVentilation=Vdot*density*cp*(Tin-Tout);
P1=((Ts-Tout)/(RthConvOutside+RthIsol+RthConcrete));
P2=((Tin-Ts)/RthConvInside);
eqn1=P1==P2+Prad;
eqn2=Pconv+Vdot*density*cp*Tout==P2+Vdot*density*cp*Tin;
totalPower[Tin_,Ts_]=Simplify[Prad+Pconv/.Solve[{eqn1,eqn2},{Prad,Pconv}][[1]]];