This looks wrong to me, because your stoz() works only on S21 instead of the full S matrix.
If you want to calculate Z21, you need to do
Z=stoz(S)
and then use Z21 or Z(2,1).
This was definitely a mistake on my part. Thank you for pointing that out. Initially I had found that my issue was not resolved, but my results seem to be agreeing between theory and simulation fairly well at the moment. For anyone that may stumble across this thread in the future, I will detail my process and the source of error below (most of this was being written as I was still having issues and becoming increasingly frustrated, but I've gone back and tried to write in the past tense such that it may serve as a solution :smile
:
I have taken the simple coaxial case of two (practically) filamentary loops and separated them by a distance. I've started with a single coil and determined it's self inductance based on theory and simulation, and the results are in agreement with one another. The equation for the inductance of a circular loop can be found in any basic electromagnetic theory book.
I then extended the problem to two coils and have carried out the same FEM simulation, generated S Parameters, converted to Z as required (this time using stoz on S and not simply S(2,1)), utilized the appropriate Z Parameter equations (the difference between using Y and Z Parameters is negligible, so the Keysight Tech Support approach works as well, but isn't necessary) to determine the self inductance and mutual inductance of the pair. Again, using the Z11 and Z22 parameters gave me the expected self inductances, however the value of M that the simulation was giving me was off from the theoretical value I had obtained, in most cases I was finding it was off by a factor of 10 and some. The theoretical value of the mutual inductance was calculated using equation (2) from the attached paper.
The following is the MATLAB script which I am running in order to compute the theoretical mutual inductance values:
mu0 = 4*pi*10e-7;
a = 500e-3;
b = a;
d = 75e-3;
k = sqrt((4*a*b)/((a+b)^2 + d^2));
[K_k,E_k] = ellipke(k^2);
M = mu0*sqrt(a*b)*( (2/k - k)*K_k - (2/k) * E_k)
Note that the ellipke function utilizes k^2 in the argument as that's the way MATLAB defines the function and a user in the following link pointed that out as the main source of his error. At the same time, I am using a similar approach in another MATLAB script and have verified several results of a paper, so the script itself does not seem to be an issue.
https://www.eevblog.com/forum/beginners/mutual-inductance-of-two-disk-coils-(matlab)/
Upon first glance you may or may not see the problem, however if you take a closer look you'll see through fatigue I've written mu0 = 4*pi*10e-7 which explains the additional factor of 10 I was finding to be interfering with my results. At this point in time, the results for the filamentary coils are agreeing between theory and simulation. As such, I will move to the more complicated problem that I was working on for my research.
Your help was greatly appreciated. :thumbsup: