kΩ=1000;
μF=(10^(-6));
mH=0.001;
L=50mH;
R1=10kΩ;
R2=1000;
c=5μF;
tTry=(Sqrt[L*c]);
Print["time constant= ",tTry,"  s"]
tmax=8tTry;
Uz=UnitStep[t];

currentEqns={iU[t]==iR1[t],iR1[t]==iC[t]+iL[t],iL[t]==iR2[t]};
componentEqns={Uz==u1[t],u1[t]-u2[t]==R1*iR1[t],iC[t]==c*u2'[t],u2[t]-u3[t]==L*iL'[t],u3[t]==R2*iR2[t]};
initialConds={u2[0]==0,iL[0]==0};
eqnsTogether=Union[currentEqns,componentEqns,initialConds];
aux=Cases[eqnsTogether,_Symbol[t],{0,∞}];
unknowns=DeleteCases[aux,UnitStep[t]]//Union;
Length[Union[currentEqns,componentEqns]];
Length[unknowns];
sol=NDSolve[eqnsTogether,unknowns,{t,0,tmax}][[1]];
Plot[u2[t]/.sol,{t,0,tmax},PlotRange->All]

(*Thevenin*)
ClearAll["Global`*"]

eqns={0==iU+iR2+iR1,iU==iR3,iR2+iR3+iDC==iR4+Iout,u1==iR1*R1,u1-u3==R2*iR2,u2-u3==iR3*R3,u3==R4*iR4,u1-u2==uDC}

sol=Solve[eqns,u3,{iR1,iR2,iR3,iR4,u1,u2,iU}][[1]]

sol/.{R1->10,R2->10,R3->10,R4->10,uDC->10,iDC->0.01}
Simplify[%]

ClearAll["Global`*"]

D[Tanh[(10^4)*t-0.1],t]/.t->0.1

Plot[((((10^4)-10))/2)+((((10^4)-10))/2)*Tanh[(10^4)*(t-0.1)],{t,-1,1},PlotRange->{Automatic},PlotStyle->Thick,AxesLabel->{"t[s]","R[Ω]"}]

ClearAll[ResistorFunction]
ResistorFunction[t_]:=((((10^4)-10))/2)+((((10^4)-10))/2)*Tanh[(10^4)*(t-0.1)];

ClearAll[step,myR];
step[leftValue_,rightValue_,where_,slope_]:=Module[{a,b,τ,solab,solτ},
solab=Solve[{a-b==leftValue,a+b==rightValue}][[1]];
solτ=Solve[slope==(b*D[Tanh[(t/τ)],t]/.solab)/.t->0][[1]];
a+b*Tanh[((t-where)/τ)]/.Union[solab,solτ]
];
myR[t_]=step[10,(10^4),0.1,(10^4)]