pom=pom;
Remove["Global`*"];
$HistoryLength=2;
SetDirectory[NotebookDirectory[]];

RBezNas=1200.;
RSNami=153000;
resab=Solve[{a-b==RBezNas,a+b==RSNami}][[1]];
L=5.;
τBezNas=(L/RBezNas);
Print["caskonstanta bez nas= ",τBezNas*(10^3),"  ms"];
τSNami=(L/RSNami);
Print["caskonstanta s nami= ",τSNami*(10^3),"  ms"];
tmax=5*(τBezNas+τSNami)+τBezNas;
tSkok=5*τBezNas;
resab=Solve[{a-b==RBezNas,a+b==RSNami}][[1]];
strmost=(10^9);

restau=Solve[Chop[strmost==D[a+b*Tanh[((t-tSkok)/tau)],t]/.t->tSkok/.resab]][[1]];
odpor=a+b*Tanh[((t-tSkok)/tau)]/.Union[resab,restau];
Plot[odpor,{t,0,tmax}];
Uz=12.;
rce={u1[t]==Uz,iz[t]==iL[t],iL[t]==iR[t],u2[t]==odpor*iR[t],u1[t]-u2[t]==L*iL'[t],iL[0]==0};
nezname=Union@Cases[rce,a_Symbol[t]:>a,{0,∞}];
res=NDSolve[rce,nezname,{t,0,tmax},MaxStepSize->0.001*tau/.restau,MaxSteps->(10^6)][[1]];
(*menit parametry NDSolve a Plot a ukazovat grafy*)
Plot[odpor*iR[t]/.res,{t,0,tmax},PlotRange->All,PlotPoints->1300]