% s11=0.72*exp(-i*116*pi/180);
% s21=2.60*exp(i*76*pi/180);
% s12=0.03*exp(i*57*pi/180);
% s22=0.73*exp(-i*54*pi/180);
% %input,take impedance Load 13.3648 +53.1389i
% s11=0.444*exp(-i*155*pi/180);
% s21=1.280*exp(i*64.915*pi/180);
% s12=0.14*exp(i*9.224*pi/180);
% s22=0.631*exp(-i*78.084*pi/180);
%output,take impedance Source 2.9943 +12.1942i
s11=0.769*exp(-i*155.8*pi/180);
s21=1.157*exp(i*33.3*pi/180);
s12=0.11*exp(i*-20.3*pi/180);
s22=0.419*exp(i*122.289*pi/180);
det=s11*s22-s12*s21
B1=1+abs(s11)^2-abs(s22)^2-abs(det)^2;
B2=1+abs(s22)^2-abs(s11)^2-abs(det)^2;
C1=s11-s22'*det;
C2=s22-s11'*det;
gammaS1=(B1+sqrt(B1^2-4*abs(C1)^2))/(2*C1)
% MgammaS1=abs(gammaS1)
% PmgammaS1=angle(gammaS1)*180/pi
impedanceS1=(1+gammaS1)/(1-gammaS1)*50
gammaS2=(B1-sqrt(B1^2-4*abs(C1)^2))/(2*C1)
% MgammaS2=abs(gammaS2)
% PmgammaS2=angle(gammaS2)*180/pi
impedanceS2=(1+gammaS2)/(1-gammaS2)*50
gammaL1=(B2+sqrt(B2^2-4*abs(C2)^2))/(2*C2)
% MgammaL1=abs(gammaL1)
% PmgammaL1=angle(gammaL1)*180/pi
impedanceL1=(1+gammaL1)/(1-gammaL1)*50
gammaL2=(B2-sqrt(B2^2-4*abs(C2)^2))/(2*C2)
% Mgammal2=abs(gammaS2)
% PmgammaL2=angle(gammaL2)*180/pi
impedanceL2=(1+gammaL2)/(1-gammaL2)*50
%----------
f=10^9*[15,35]
z=[2.153, 0.727]
c=1./(2*pi*(f.*z)*50)
%----
length=186*10^-6;
Lt=6.621106686656013e-7;
Ct=1.1302751243809054e-10;
c1=0.15*10^-12;
wBrag=1/(length*sqrt(Lt*(Ct+c1)/length))