# How to import data into the import generation object?

The import generation object allows users to import optical generation data into DEVICE. The data should be defined in a rectangular coordinate. The coordinate vectors should be named x, y, and z, and the generation matrix should be named G with a dimension (A x B x C) where A, B, and C are the lengths of the vectors x, y, and z. The data can be saved in a Matlab data file (.mat) and loaded into DEVICE. There are two ways in which this data can be loaded into the import generation object in DEVICE.

Using the GUI: The easiest way to load the data is through the property editor of the import generation object in the GUI. To do this, simply open the property editor for the import generation object, click ‘Browse’ and select the .mat file with the generation data.

Using script: Often we want to create our simulation file using script commands. In such a case, we need to create a rectilinear dataset that can be loaded into the generation object. We need to first load the data into the script workspace using the matlabload command and then create the dataset using the rectilineardataset command. Finally we can attach the dataset to the import generation object using the importdataset command. A sample script is shown below:

matlabload(‘GenRate.mat’); # read the data

Gen = rectilineardataset(x,y,z); # create the dataset
Gen.addattribute(‘G’,G);

addimportgen; # create the import generation object

importdataset(Gen); # attach the data to the import generation object

set(“selected attribute”,“G”); # select the data in the dataset created by the object

1 Like

Hi I am trying implement this with results from MODE. My script looks is similar to yours and the object is created. I can visualize the generation profile in the object and it is correct; however, after meshing and trying to visualize the generation on the grid, Goptext is 0 everywhere. Could provide some guidance as to what might be causing this? I have tried many things, and the only thing that has resulted in a Goptext is using the script found here, https://kb.lumerical.com/en/photodetectors_inp_uni_travelling_carrier_pd.html But I cannot seem to make it work with an imported dataset. My script is here:

matlabload(“Generation_AbsorberSweep_1”);
Gen = rectilineardataset(“Gen”,x,y,z);
Gen.addparameter(‘v’,0); # dummy parameter (this was added since it was in the UTC-PD example)
Gen.addattribute(“G”,G);

addimportgen;
set(“name”,“OpticalGenerationRate”);
importdataset(Gen);

The mat-file has a G,x,y,z. G is 2x201x11 double, x = 2x1 double, y = 201x1 double, and z = 1x11 double

Thanks

Hi I’m trying to do this with a script very similar to yours using data from MODE. I get a generation object and I can even use the visualizer to see the generation profile and it matches what I expect. However, after meshing, looking at the grid, Goptext is zero everywhere. I have copied my script below. The generation file basically has doubles: G,x,y,z with the dimensions 2x201x11,2x1,1x201,11x1. x,y, and z are all symmetric about 0, so that the location of the box is object is the location of the generation.

The only way I have been able to get it to show up in the grid is by following the script in https://kb.lumerical.com/en/photodetectors_inp_uni_travelling_carrier_pd.html, almost exactly without any import.
Here is my script:

matlabload(“Generation_AbsorberSweep_1.mat”);

Gen = rectilineardataset(“Gen”,x,y,z);
Gen.addparameter(‘v’,0); # dummy parameter
Gen.addattribute(“G”,G);

addimportgen;
set(“name”,“OpticalGenerationRate”);
importdataset(Gen);

Any input as to what I should check would be appreciated.

Brandon

Hi,

The import generation object has changed recently and it now requires the user to select the attribute that should be used within the dataset. You can either manually select the “G” attribute from the property editor of the import gen object or you can use the following script command to do that,

set("selected attribute","G");

Hi,

I’m trying to model a solar cell with a cylindrical pillar of silicon geometry.
After running the FDTD simulation, I import the generation data to my DEVICE simulation. The importation seems to work as I can visualize the right data (with a right clic on the generation region -> visualize -> data).
But when I run the electrical simulation, my results (current-voltage characteristics) are exactly the same when the generation region is enabled or disabled.

Could you help me to solve this problem?

Thanks

There are two things to check.

1. Make sure that the scale factor is set to 1 in the import generation object.

2. Manually integrate the optical generation profile and calculate the photogenerated current and check if you should expect to see the photocurrent or whether is too small.

I’ve already checked the scale factor, but indeed i will try to calculate the photocurrent.
Thank you for your reply

1 Like