ClearAll["Global`*"];

(*Zadani vstupnich parametru - vstupy, soucastky a podminky*)

soucastky={R1->(10^3),R2->(10^3),R3->(10^3),R4->(10^3),R5->(10^3),C1->4.7*(10^(-6)),L1-> 0.05,L2-> 0.05};
vstupU={uZ[t]-> 10*Tanh[10*Sin[1000*t]]};
vstupI={iZ[t]-> 0.01*Tanh[10*Sin[π*1000*t]]};
pocatecniP1=iL1[0]==0;
pocatecniP2=iL2[0]==0;
pocatecniP3=u3[0]==0;


(*Popis obvodu*)
(*Uzly*)
uzel1=iL2[t]==iR5[t]+iZ[t];
uzel2=0==iL2[t]+iR1[t]+iL1[t]+iuZ[t];
uzel3=iuZ[t]+iR3[t]==iR2[t]+iC1[t];
uzel4=iR5[t]==iR3[t]+iR4[t];
(*Rovnice soucastek*)
zdrojU=uZ[t]==u3[t]-u2[t];
kondenzatorC1=iC1[t]==C1*u3'[t];
civkaL1=u2[t]==L1*iL1'[t];
civkaL2=u2[t]-u1[t]==L2*iL2'[t];
rezistorR1=u2[t]==R1*iR1[t];
rezistorR2=u3[t]==R2*iR2[t];
rezistorR3=u4[t]-u3[t]==R3*iR3[t];
rezistorR4=u4[t]==R4*iR4[t];
rezistorR5=u1[t]-u4[t]==R5*iR5[t];
(*Rovnice*)
rovnice={pocatecniP1,pocatecniP2,pocatecniP3,uzel1,uzel2,uzel3,uzel4,zdrojU,
kondenzatorC1,civkaL1,civkaL2,rezistorR1,rezistorR2,rezistorR3,rezistorR4,rezistorR5};
(*Dosazeni do rovnice*)
rovniceDosazeni=((rovnice/.soucastky)/.vstupU)/.vstupI;
(*Reseni*)
nezname={iZ[t],iuZ[t],iL1[t],iL2[t],iR1[t],iR2[t],iR3[t],iR4[t],iR5[t],
uZ[t],u1[t],u2[t],u3[t],u4[t],uC1[t]};

tmax=0.01;    (*10*perioda = 10ms ze zadani*)
reseni=NDSolve[rovniceDosazeni,nezname,{t,0,tmax}, StartingStepSize->(10^(-9))];
Plot[u4[t]/.reseni,{t,0,tmax},AxesLabel->{t,u4[t]},PlotRange->All]