Structure diagram base on TE-mode? Convert/export the graph result from script (lsf.file) to excel.

fdtd

#1

Hi,

From the example Exciting a TE surface plasmon (LUMERICAL). I designed a structure which is similar to an example design. I followed the same steps to design & write script. The different only in term of parameters, materials and geometry size. But the outcome not perfect. I attached the pdf.file(combination of example & my result). I really need some guidance from your side. Kindly have look on attachment.
Result_Outcome_FDTD.pdf (209.6 KB)

*How to convert/export the graph result from script (lsf.file) to excel? Is it possible?

Thank You,
Kalai


#2

@kalaivani.tarumaraja:

The tool used for the analytical results in the TE surface plasmon example is the stackrt script command, which requires four input arrays:

  1. the refractive index of each layer;
  2. the thickness of each layer;
  3. the frequencies of interest;
  4. the angles of incidence.

It is necessary to make sure that you provide the correct arrays. A simpler example is shown here.

Regarding the plot of field intensity as a function of x and source angle, it is harder to say what adjustments need to be made. The reason why there is a peak in the field intensity is the presence of a surface plasmon. Do you expect a surface plasmon to be excited in your structure? From your reflection and transmission spectra it does not seem like there is such an excitation. If you want to share your simulation file I can take a look and provide more feedback.

Regarding your question about Excel, it is not possible to export to Excel files (.xlxs) directly. However, you can export your data to a text file, which can then be imported into Excel.


#3

Hi,

I attached the fsp. & lsf file of my design. Kindly a have look on it. Besides that, I attached pdf. file. In pdf.file, there are few questions regarding this TE surface plasmon design.

Hope can provide more feedback base on my design.Graphene_TE_TK.lsf (3.3 KB)
Graphene_TE_TK.fsp (280.6 KB)Questions_QnA.pdf (121.6 KB)


#4

@kalaivani.tarumaraja:

Hi Kalaivani,

I checked your simulation and script files and I found a couple of issues.

FDTD simulation:
Your setup was correct except for the periodic boundary conditions in the y direction. They were set to PML but they should be set to Bloch. I modified this in the attached file Graphene_TE_TK_modified.fsp (249.8 KB).

Analytical calculation:
When you use the stackrt script command, it is necessary to construct two arrays: one with the indices of every layer and one with the thickness values of every layer. Please take a look at the modified script file Graphene_TE_TK_modified.lsf (2.6 KB) where you can see how the arrays should be set for your configuration. One important point is that the index of gold must include its imaginary part, not only the real part.

After the changes, the numerical and analytical results are much closer:

Note that there are no features that show the excitation of a surface plasmon. Most power is reflected and there is no dip associated with power absorbed by graphene. One important difference of your structure with respect to the one in the graphene example is that you are using a metal as part of the multilayer structure. You might need to consider more carefully if this excitation setup is the correct one for your structure. As explained in the graphene example, you can use MODE to check the properties of the surface plasmon modes that can be supported by your structure.

Hope this helps.


#5

Hi Fgomez,

Really thanks for guideline. But, I can’t run lsf.file. Kindly check it. I attached the screen-shot of an error.

Thank You.

Best Regards,
Kalai


#6

Hi Kalaivani,

You are welcome! The reason why your script is not working is probably because you are using an old version of FDTD where the command getsurfaceconductivity was not introduced. If you upgrade to the latest version (v. 8.15.758), the problem should be fixed; otherwise you can use the old way to extract the conductivity:

Replace “graph_cond =getsurfaceconductivity(graph_name,fsim);” by:

graph_freq = getmaterial(graph_name,“frequency”);
graph_cond = getmaterial(graph_name,“conductivity”);
graph_cond = interp(graph_cond,graph_freq,fsim);

However, I strongly recommend updating to the latest version to get all the latest features.


#7

Hi fgomez,

Oh. Noted. Thanks for your feedback. Soon will upgrade with the latest version. I have one more question. How to export the lsf.file (graph) to text file?? I mean, the command to export the graph result (reflected & transmission spectra of Analytical & Numerical). I only able to export the source angle information as below command.

leg=cell(length(src_theta));
for (I=1:length(src_theta))
{
leg{I}=num2str(src_theta(I))+“deg”;
str=num2str(src_theta(I)+“deg”;
write(“Graphene_TE_TK_modified.txt”,str);
}

Please guide how to write correct command if I want to export the graph result (reflected & transmission spectra of Analytical & Numerical) base on TE surface plasmon example.

Best Regards,
Kalai


#8

Hi Kalai,

You can also use the write script command to save arrays in a text file. In your case, you can add the following lines to your script:

data_write = [src_theta,R_num,transpose(RT.Rs),T_num,transpose(RT.Ts)]; #combine all data in one big matrix
filename = “RT.txt”;
if(fileexists(filename)){ rm(filename);} #Check if file exists already; if it does delete old version
write(filename, num2str(data_write)); #write new file

See attached modified script: Graphene_TE_TK_modified_v2.lsf (3.1 KB).

Hope this helps!

Federico


#9

Hi Fgomez,

Noted. Thanks, fgomez. Will try it.

Is it installation FDTD and upgrade the latest version follow the same procedure(steps)?? I’m going to upgrade to latest version of FDTD (8.15.758).

Is there any example or video regarding upgrade software to latest version in LUMERICAL website?? I don’t know how to upgrade the latest version.

Thank You.

Best Regards,
Kalai


#10

Hi Fgomez,

Base on explanation given by you for design (Graphene_TE_TK_modified.fsp)

Fgomez: Note that there are no features that show the excitation of a surface plasmon. Most power is reflected and there is no dip associated with power absorbed by graphene.

Kalai: On your viewpoint, is possible this design (Graphene_TE_TK_modified.fsp) to show the excitation of surface plasmon & has dip??? I would like to set gold reflective index base on wavelength.
*wavelength and reflective index (http://refractiveindex.info/)

Fgomez: You might need to consider more carefully if this excitation setup is the correct one for your structure.

Kalai: Can I know what do you mean with excitation setup??

Hope to receive your feedback.

Best Regards,
Kalai


#11

Hi Kalai,

For upgrading to the latest version of the software you simply have to go to the Customer download page, download the software and install it as usual.

Regarding my comments about the excitation setup and the dip in reflection:

What I meant by excitation setup is the structure (multilayer array with graphene on top) and the plane wave source incident from below, which is used to excite the surface plasmon in graphene.

In the original example, the setup was designed to detect the surface plasmon excitation in graphene, signaled by a dip in the reflection spectrum; in other words, the dip in the reflection was a signature of the excitation of the surface plasmon. Note that in the original example all the materials are dielectrics, no metal is present in the array; therefore, any significant loss comes from graphene, and that is precisely what leads to the dip in the reflection. In your case, you have gold so that makes the configuration quite different.

Also, the analytical results from stackrt from 0 to 90 degrees do not show any particular feature that can be easily associated with a surface plasmon in graphene:

Therefore, your structure behaves quite different from the original example.


#12

Hi fgomez,

Noted & really thanks for explanation. When I try to modify previous design slightly, the script can’t run because the error at “calculation refractive index of graphene”. This error not related to upgrade version. It’s error. I attached the fsp. & lsf file. Please a look on it.

*what is the function of index monitor? How to define or determine geometry information??

Hope to receive your feedback.

Graphene_TE_TK_K5.lsf (3.1 KB)
Graphene_TE_TK_K5.fsp (426.5 KB)

Best Regards,
Kalai


#13

Hi Federico,

Please a have look on screen-shot as below. Besides that, I attached the fsp & lsf file after modified my design. Where I can get the reflected analytical & numerical spectra (curve) similar/close to each together. But, the reflected numerical spectra shows slightly different compare to analytical. It’s not smooth spectra as analytical. Which part need to be modify to get the exactly close spectra between analytical & numerical (reflected). One more, how to define diagram structure on my design (as TE surface plasmon example). Currently, I still using the old version on FDTD. Will update it soon.

Graphene_SP_Al.lsf (3.2 KB)
Graphene_SP_Al.fsp (631.0 KB)

Hope to receive your feedback.

Best Regards,
Kalai


#14

Hi Kalai,

  1. The reason why you are getting an error in the image below is because you are missing a semicolon at the end of line 59.
  2. The purpose of the index monitor is to visualize the real and imaginary part of the refractive index as a function of frequency/wavelength and position. It is always a good idea to use this type of monitor to check that you are simulating the correct structure, especially if you have elements that overlap.

I am working on the other questions and I will get back to you as soon as possible.


#15

Hi Kalai,

Regarding your other questions:

(3) Comparison with analytical results:

The reason why you find some discrepancy between the numerical (FDTD) and analytical (stackrt) results is due to unstable simulations for the steep injection angles. For those angles the autoshutoff level before the simulation stops goes down to ~0.1, which is not small enough to get good results in the frequency domain. If you increase the simulation time you will actually find that the simulations are unstable.

The reason for the instability is that the pulses used in the simulations have some frequencies injected at very steep angles ~90 degrees. Even though you are looking at one frequency, FDTD always injects a pulse with some width in the frequency domain, and for angled injection using Bloch boundary conditions there is a dependence between wavelength and the actual injection angle. For example, if you want the injection angle to be 70 degrees, only the center frequency of the pulse will be injected at this angle; if the pulse is broad in frequency domain you can end up injecting frequencies at 90 degrees. The solution is to make the pulse longer in time domain so that it is narrower in frequency. This is explained in more detail here. You can see how the angle vs. wavelength changes after making the pulse longer in time:

The results from the attached files Graphene_SP_Al_modified.fsp (249.3 KB) and Graphene_SP_Al_modified.lsf (3.2 KB) show much better agreement between numerical and analytical calculations after adjusting the pulse duration:

One additional improvement I made was using “steep angle” settings for the PML, as explained here.

(4) Plot the electric field intensity as a function of angle and position:

I marked the sections of the original script in the TE surface plasmon example necessary to plot the field intensity. You can use similar script lines in your case:


#16

Hi Federico,

Noted. Really thanks for your feedback. Your explanation are good and easy to understand.

Best Regards,
Kalai


#17

Federico,

I can’t run the script (Graphene_SP_AL_modified.lsf).** There is an error on line 64**. I attach the screen-shot. Please check it.

Hope to receive your feedback.

Best Regards,
Kalai


#18

Hi Kalai,

You are welcome, I am happy to help. I am not sure what is causing the error but the simplest way to get rid of it is to upgrade to the latest version of FDTD, where you can get graphene’s conductivity in one script line using

graph_cond =getsurfaceconductivity(graph_name,fsim);

instead of

graph_freq = getmaterial(graph_name,“frequency”);
graph_cond = getmaterial(graph_name,“conductivity”);
graph_cond = interp(graph_cond,graph_freq,fsim);

As I mentioned before, upgrading to the latest version should be easy and it is very convenient since you will have access to the latest features and bug fixes.


#19

Hi Federico,

Yes. I already upgrade to the latest version. The script can run and result of graph appear. I attached the screen-shot.

But, I having problem with plotting the electric field intensity. I attached the screen-shot and lsf.file too. Please check it. This it wrong command??


#20

Oops. Sorry forget to attached the lsf. file.

Graphene_SP_Al_modified.lsf (3.3 KB)

Hope to receive your feedback.

Best Regards,
Kalai