%% Use Behavioral Model to Calculate S-Parameters of Mitered Bend Microstrip
% Create mitered bend microstrip.

m = design(microstripLine,6e9,"Z0",75);
layer2d = bendMitered('Length',[m.Length/2 m.Length/2],...
"Width",[m.Width m.Width],'MiterDiagonal',sqrt(2)*m.Width);
robj = pcbComponent(layer2d);
robj.BoardThickness = m.Substrate.Thickness;
robj.Layers{2} = m.Substrate;
show(robj)

%
% Compute and plot s-parameters.

freq = (1:2:60)*100e6;
Sckt = sparameters(robj,freq,'Behavioral',true);
Sem = sparameters(robj,freq);
rfplot(Sckt,1,1,'db','-s')
hold on
rfplot(Sem,1,1,'db','-x')

% Reference:
% M. Kirschning, R. H. Jansen and N. H. L. Koster, "Measurement and Computer-Aided Modeling of Microstrip Discontinuities by an Improved Resonator Method," 1983 IEEE MTT-S International Microwave Symposium Digest, Boston, MA, USA, 1983, pp. 495-497, doi: 10.1109/MWSYM.1983.1130959.
%
% Copyright 2020 The MathWorks, Inc.