 %modelling the autotransformer helical resonator
clear all
close all
Zo = 50;

%Nvals... the number of frequency points
Nvals = 1000;

%Specify the number of nodes
N = 5;

%initialise all ys
y = zeros(N-1,N,Nvals);
frequency = logspace(7,8,Nvals);
omega = 2*pi*frequency;

fc = 40.e6;
omc = 2*pi*fc;

Q = 8;

%Predict Cc
Cc = 1.5e-12

R = Zo*(1 + Q^2);
LT = Zo*Q/omc;
CT = Q/omc/R - 2*Cc/(1 + (omc*2*Cc*R)^2); 

%Frequency scaling
OMRAT = .5
omc/2/pi
omc/2/pi/OMRAT
LT = OMRAT*LT
CT = OMRAT*CT
Cc = OMRAT*Cc

RLOSS = 3

%Define the frequncies around the resonant frequency

y(1,5,:) = 1/Zo;
y(5,1,:) = 1/Zo;

y(3,2,:) = j*omega*Cc;
y(2,3,:) = j*omega*Cc;

y(5,2,:) = j*omega*CT;
y(2,5,:) = j*omega*CT;

y(5,3,:) = j*omega*CT;
y(3,5,:) = j*omega*CT;

y(1,2,:) = 1./(RLOSS + j*omega*LT);
y(2,1,:) = 1./(RLOSS + j*omega*LT);

y(3,4,:) = 1./(RLOSS + j*omega*LT);
y(4,3,:) = 1./(RLOSS + j*omega*LT);

y(4,5,:) = 1/Zo;
y(5,4,:) = 1/Zo;



