/* Put rfMaxima.mac in the same directory as this notebook, or add its
directory to file_search_maxima. */
load("rfMaxima.mac")$Constant-k Section Analysis
Generated from CONSTANT_K_SECTION.wxm with rfMaxima 0.2.5 on Maxima 5.46.0.
All results were computed by executing the notebook; none is transcribed.
(See "Microwave Engineering, 2nd Ed., by D. Pozar, Wiley, 1998, p. 433)
Without Assumptions for Z_1 and Z_2
ABCD-, G-, H-, S-, Y- and Z-Parameters
Solution:linsolve([v_in-v_1=Z_1/2*i_in,v_out-v_1=Z_1/2*i_out,v_1=Z_2*i_1,i_in+i_out=i_1],[i_in,i_out,i_1,v_1]);
TwoPortMatrices(Solution);ABCD(s) :=
G(s) :=
H(s) :=
InverseABCD(s) :=
S(s) :=
Y(s) :=
Z(s) :=
Characteristic Impedance, Z_0, and Propagation Constant, %gamma
solve(S(s)[1,1]=0,Z_0);
doallmxops:true$
solve(determinant(ABCD(s)-pow_e_gamma*ident(2))=0,pow_e_gamma);Assuming Z_1=s*L and Z_2=1/(s*C)
ABCD-, G-, H-, S-, Y- and Z-Parameters
declare(C,real)$
declare(L,real)$
assume(C>0)$
assume(L>0)$
assume(Z_0>0)$
Z_1:s*L$
Z_2:1/(s*C)$
TwoPortMatrices(Solution);ABCD(s) :=
G(s) :=
H(s) :=
InverseABCD(s) :=
S(s) :=
Y(s) :=
Z(s) :=
SParameters(S);Abs_S11(%omega) :=
Arg_S11(%omega) :=
Abs_S12(%omega) :=
Arg_S12(%omega) :=
Abs_S21(%omega) :=
Arg_S21(%omega) :=
tau_g(%omega) :=
Abs_S22(%omega) :=
Arg_S22(%omega) :=
Z_IN(s) :=
R_IN(%omega) :=
X_IN(%omega) :=
Z_OUT(s) :=
R_OUT(%omega) :=
X_OUT(%omega) :=
Stability(S);Delta(%omega) :=
MSG(%omega) :=
K(%omega) :=
mu(%omega) :=
muprime(%omega) :=
U(%omega) :=
Characteristic Impedance, Z_iT, and Propagation Constant, %gamma
solve(ev(S(s)[1,1])=0,Z_0);define(Z_iT(s),rhs(last(%)));doallmxops:true$
solve(determinant(ev(ABCD(%i*%omega))-pow_e_gamma*ident(2))=0,pow_e_gamma);define(pow_e_gamma(%omega),rhs(last(%)));A (Attenuation per Section), %phi (Phase Shift per Section) and tau_g (Group Delay per Section)
define(A(%omega),realpart(ev(log(pow_e_gamma(%omega)))));
define(%phi(%omega),imagpart(ev(log(pow_e_gamma(%omega)))));%omega_c:2/sqrt(L*C);
/* Exactly AT cutoff the argument of the logarithm is real and negative, so
atan2(0,0) is undefined and evaluating A/%phi there raises an error
(it did in 0.2.4 too). Evaluate inside the passband and inside the
stopband instead, which is the point being made anyway: A = 0 below
cutoff, A > 0 above it. */
A(%omega_c/2);
%phi(%omega_c/2);
A(2*%omega_c);
%phi(2*%omega_c);C:5e-15$
L:75e-12$
Z_0:50$PlotSmithChart([
parametric,
realpart(S(%i*2*%pi*f)[1,1]),
imagpart(S(%i*2*%pi*f)[1,1]),
[f,1e6,20e9],
[nticks,100]]);
/* S12 is a TRANSMISSION coefficient; a Smith chart maps REFLECTION
coefficient. Its magnitude is plotted against frequency further down. */
/* S21 is a TRANSMISSION coefficient; a Smith chart maps REFLECTION
coefficient. Its magnitude is plotted against frequency further down. */
PlotSmithChart([
parametric,
realpart(S(%i*2*%pi*f)[2,2]),
imagpart(S(%i*2*%pi*f)[2,2]),
[f,1e6,20e9],
[nticks,100]]);

wxplot2d(ev(20*log10(Abs_S11(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"dB20(|S11|)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(20*log10(Abs_S12(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"dB20(|S12|)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(20*log10(Abs_S21(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"dB20(|S21|)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(20*log10(Abs_S22(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"dB20(|S22|)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(Arg_S11(2*%pi*f*1e9)*180/%pi),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"S11 (°)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(Arg_S12(2*%pi*f*1e9)*180/%pi),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"S12 (°)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(Arg_S21(2*%pi*f*1e9)*180/%pi),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"S21 (°)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev(Arg_S22(2*%pi*f*1e9)*180/%pi),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"S22 (°)"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$







wxplot2d(ev((R_IN(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"R_IN [Ohm]"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev((X_IN(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"X_IN [Ohm]"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"]);
wxplot2d(ev((R_OUT(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"R_OUT [Ohm]"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev((X_OUT(2*%pi*f*1e9))),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"X_OUT [Ohm]"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$
wxplot2d(ev((tau_g(2*%pi*f*1e9))*1e12),
[f,0.1,20],
[legend,false],
[xlabel,"Frequency [GHz]"],
[ylabel,"Group Delay [pS]"],
[style,[lines,3,2]],
[gnuplot_preamble,"set grid"])$




load("coma.mac")$
step_response(1/ABCD(s)[1,1]);