SetDirectory[NotebookDirectory[]]

dataImp=Import["dataRCcircuit.xls"][[1]];

dataImp[[1]]

imp[f_]=((((1/R)+(1/(1/(I*2Pi*f*Cx)))))^(-1))//ComplexExpand

err[{f_,Rmes_,Xmes_}]:=(((Rmes-Re[imp[f]]))^2)+(((Xmes-Im[imp[f]]))^2)

obj=Total[err/@dataImp];

sol=FindMinimum[obj,{R,1000},{Cx,(10^(-8))}]

forplot=imp[f]/.sol[[2]];
fmin=dataImp[[1,1]];
fmax=dataImp[[-1,1]];
pltModel=ParametricPlot[{Re[forplot],Im[forplot]},{f,fmin,fmax},AspectRatio->1/2,PlotRange->All];

pltdata=ListPlot[dataImp[[;;,{2,3}]],PlotStyle->Red]
Show[pltModel,pltdata]

ClearAll["Global`*"]

Rv1=Rv2=0.5;
Xv1=Xv2=1.5;
Rv3=0.5*Rv1;
Xv3=0.5*Xv1;
Rz1=Rz2=50;
Xz1=Xz2=100;
Uz=230;
ω=314.;

ser=Total;
par:=((Total[((#)^(-1))])^(-1))&;

zv1=ser[{Rv1,I*Xv1}];
zv2=ser[{Rv2,I*Xv2}];
zCx=ser[{Rv3,I*Xv3,(1/(I*ω *Cx))}];
zz1=par[{Rz1,I*Xz1}];
zz2=par[{Rz2,I*Xz2}];
eqs={i1==i2+i3,
i3==i4+i5,
i1==((Uz-u1)/zv1),
i2==(u1/zz1),
i3==((u1-u2)/zz2),
i4==(u2/zz2),
i5==(u2/zCx)
};
res=Solve[eqs,{i1,i3,i5},{u1,u2,i2,i4}]
losses=Rv1*Abs[i1^2]+Rv2*Abs[i3^3]+Rv3*Abs[i5^2]/.res[[1]];
FindMinimum[losses,{Cx,(10^(-8))}]

Plot[losses,{Cx,(10^(-4)),(10^(-6))}]