# S parameter extraction from Device

#1

Hi I am trying to extract the s parameter data from Lumerical Mode and FDTD and import them into the Interconnect Module. Could someone please explain how to do so? I am not too sure whether it can be done through writing a script or there is a simpler way to do so. If it needs to be done through writing a script, can someone help how to do so?

#2

Please have a look at this post where a related application example link is provided. Indeed in general some short scripts are used to generate the s-parameter files. Let me know if you have any further problems

#3

Hi again,

Thanks for your response, but I always have problems grasping that example as it opens a script file in Mode and not FDTD- when I run it never works either. Can you help me regarding how to use the code for FDTD?

Also I asked earlier that I am trying to extract information from the Device module. Is that possible? If not, am I supposed to send everything to the Mode Module in order to be able to extract information?

Please help
Thanks, Hani

some question about the grating coupler on your website
#4

The method to extract s-parameter from FDTD Solutions is more or less the same as from MODE Solutions. There is a sample script in the example I linked in the previous reply, which extracts s-parameters to a text file from a FDTD simulation. In the example file grating_coupler_2D.fsp (500.7 KB), the result ‘S’ matrix is defined in the ‘model’ analysis tab, using the following script commands:

T = getresult("waveguide","expansion for T");
?T;
Tfund = -T.getattribute("T_backward");
lambda = T.lambda;
?T_avg = integrate(Tfund,1,lambda)/integrate(matrix(length(lambda))+1,1,lambda);

if(!%fiber analysis%) {
break;
}

if(havedata("fiber::top")) { # fiber turned on
fiber = getresult("fiber::fiber modes","expansion for top");
}

S = matrixdataset;
S.addparameter("lambda",T.lambda,"f",T.f);

if(output) {
S22 = T.b/T.a;
S12 = fiber.a*sqrt(fiber.N)/(T.a*sqrt(T.N));
S.addattribute("S22",S22);
S.addattribute("S12",S12);
} else {
S11 = fiber.a/fiber.b;
S21 = (T.b*sqrt(T.N))/(fiber.b*sqrt(fiber.N));
S.addattribute("S11",S11);
S.addattribute("S21",S21);
}


Then after run the simulation, the result ‘S’ can be read out by using the following commands:

S = getresult("::model","S");
S22 = S.S22;
S12 = S.S12;


You can also extract the admittance and impedance s-parameter/matrix from DEVICE, but this has to be done by using script. After the simulation runs, you can get the current and voltage from the simulation result and then calculate for the admittance and impedance. For a small signal analysis, you then can get the transfer function of the admittance and impedance. The following script can be used to convert the admittance transfer function to s-matrix:

S11 = ((1-Z0*Y11)*(1+Z0*Y22) + Z0^2*Y12*Y21) / D;
S12 = -2*Z0*Y12 / D;
S21 = -2*Z0*Y21 / D;
S22 = ((1+Z0*Y11)*(1+Z0*Y22) - Z0^2*Y12*Y21) / D;


where Y is the transfer function and S is the s-matrix.

I hope this could help, let me know if you have any difficulties reading these

#5

an you please explain the code in general to me?
2) Why do you have two sections: 1) fiber analysis 2) output (I assume this is solely for the purpose of extracting the s parameters?
3) I cannot seem to be able interpret the s parameter graphs that I get? Their values seem to be way larger than 1 which it doesn’t make sense to me.

• Note that I get two different s parameter graphs depending on what I set as the value for the fiber and output variables:
When output and fiber analysis are both 1 I get the following graph:

“Sparameters_GRATINGCOUPLER.jpg”

And when fiber analysis = 1 and output = 0 I get:

“SparameterSecondGraph.jpg”

1. Could you please explain the above graphs to me?

2. You also use some variables that are nowhere defined in your design, i.e. T_backward or T.f? Could you explain these for me please?

T = getresult(“waveguide”,“expansion for T”);
?T;
Tfund = -T.getattribute(“T_backward”);
lambda = T.lambda;
?T_avg = integrate(Tfund,1,lambda)/integrate(matrix(length(lambda))+1,1,lambda);

if(!%fiber analysis%) {
break;
}

if(havedata(“fiber::top”)) { # fiber turned on
fiber = getresult(“fiber::fiber modes”,“expansion for top”);
}

S = matrixdataset;
S.addparameter(“lambda”,T.lambda,“f”,T.f);

if(output) {
S22 = T.b/T.a;
S12 = fiber.asqrt(fiber.N)/(T.asqrt(T.N));
S.addattribute(“S22”,S22);
S.addattribute(“S12”,S12);
} else {
S11 = fiber.a/fiber.b;
S21 = (T.bsqrt(T.N))/(fiber.bsqrt(fiber.N));
S.addattribute(“S11”,S11);
S.addattribute(“S21”,S21);
}

1. Where am I supposed to be using the following? After I ran the code above I did put this in the script section and no results:
S = getresult("::model",“S”);
S22 = S.S22;
S12 = S.S12;

#6

The code I attached is not universally usable, it is only for the corresponding attached example file. You have to tweak the script a bit to suit your own design. For the ‘T.f’ part, ‘T’ is a dataset and ‘f’ is a parameter inside the dataset, you can access the parameters and attributes inside the dataset by using the dot ‘.’ option.

I hope this could help. Please attach your file so that I can help you to draft the script.

#7

Attached please find for example one design that I’m trying to find its s parameters. Can you help me get started?

Also you didn’t answer me about the graphs I attached in my above inquiry. Why are the values not less than 1 and somewhere around 500 or so?

Let me know please
Thanks, Haninew snake ring_before Run.fsp (428.2 KB)

#8

I modified your file new snake ring_modified.fsp (332.3 KB) a bit, please check it out.

I added a new result ‘S’ in the ‘analysis’ tab and after run the analysis, a text file named ‘spara.txt’ will be generated to the current working directory. Please note that, only for the purpose of running faster, I changed the ‘mesh accuracy’ to 1, which gives very rough results. Please change this setting according to your own design requirement.

The following figure plots S11 & S21, for 30 frequency points. The transmission on the through port (S21) seems to be really small (nearly all 0), and that matches the result measured by the Mode Expansion monitor and Field and Power monitor.

I don’t know how you calculate for the S-parameters to get the transmission as 500, please attach the script and I will have a look at it.

I hope this could help Let me know if you have any difficulties reading this.