This page uses an example to demonstrate how to create a lookup table for a directional coupler compact model. The text files in the dc_lookup_table.zip folder contain s-parameters for directional couplers with specific gaps and coupling length, and the values are extracted from FDTD simulations. Please download the zip file and extract it to the same location of the lookup_table_wrtie.lsf file.
In the lookup_table_write.lsf file, the following commands are used to generate the dc_map.xml file, the lookup table is named as "directional coupler" with design parameters coupling length and gap of the directional coupler. The extracted parameter is the name of the text file, which is stored in the dc_lookup_table.zip extracted file.
# define data export
xml_filename="dc_map.xml";
if (fileexists(xml_filename)) { rm(xml_filename);}
table = "directional_coupler";
lookupopen(xml_filename,table);
# prepare data structure
design = cell(1);
extracted = cell(1);
design{1}=struct;
design{1}.name = "Lc";
extracted{1} = struct;
extracted{1}.name = "s-param";
Lc = linspace(0,47.5e-6,20);
for (ll=1:length(Lc)) {
design{1}.value = Lc(ll);
gap=200e-9;
filename = "dc_gap=" + num2str(gap*1e9) + "nm_Lc=" +num2str(Lc(ll)*1e6) + "um";
file1=filename+".txt";
extracted{1}.value = file1;
lookupwrite( xml_filename, design, extracted );
}
lookupclose( filename );
The lookup table is partially shown below:
<?xml version="1.0" encoding="UTF-8"?>
<lumerical_lookup_table version="1.0" name = "directional_coupler">
<association>
<design>
<value name="Lc" type="double">0</value>
</design>
<extracted>
<value name="s-param" type="string">dc_gap=200nm_Lc=0um.txt</value>
</extracted>
</association>
<association>
<design>
<value name="Lc" type="double">2.5e-06</value>
</design>
<extracted>
<value name="s-param" type="string">dc_gap=200nm_Lc=2.5um.txt</value>
</extracted>
</association>
<association>
<design>
<value name="Lc" type="double">5e-06</value>
</design>
<extracted>
<value name="s-param" type="string">dc_gap=200nm_Lc=5um.txt</value>
</extracted>
</association>
...
The files can then be used to create the directional coupler compact model by populating them to the Optical N Port S Parameter element. From the Element Library, drag and drop an Optical N Port S Parameter element and create a compound out of it.
Then the lookup table can then be linked to the S Parameter element by using the following setup scripts in the compound.
filename=%local path%+"/dc_map.xml";
table = "directional_coupler";
design = cell(1);
design{1} = struct;
design{1}.name = "Lc";
design{1}.value = coupling_length;
setnamed('SPAR_1','load from file',0);
M = lookupreadnportsparameter( filename, table, design, "s-param" );
setvalue('SPAR_1','s parameters',M);
See also
lookupclose , lookupopen , lookupread , lookupwrite , lookupreadtable , lookupreadvalue , lookupreadnportsparameter , lookupappend , insert , Insert and append a lookup table , List of commands