Mode expansion monitor problem


Hello all

I have problem using mode monitor. I set the mode inside it to something, viewed the profile and make sure it is what I want. Then, I run the program. I checked again the mode profiles and I found that the mode has changed !!

For example, I select the first-order mode in the mode monitor. I dispalyed the mode profile to be sure it is correct. After running the program, I viewed the profile again and found that it is the fundamental mode. Why does it happened?

I uploaded the mode profiles to make it clear


Hi, @omnia.nawwar !

I can’t find your simulation file uploaded. Could you please attach it?


please attach your files and maybe some screenshots.

I’ve had similar problems so I might be able to help you.


Sorry for that. Here are the files.

two_GC_draw.lsf (1.5 KB)
two_GC_setup_fibre.lsf (3.5 KB)
two_GC_init.lsf (1.4 KB)
two_RunGC_fdtd.lsf (397 Bytes)

You can start by running the ‘two_RunGC_fdtd.lst’ .

Some initial values are defined in ‘two_GC_init.lsf’. The simulation region is added in ‘two_GC_setup_fiber.lsf’.

It is a simulation of grating coupler. I am just defining the input waveguide and I have problem with it.
This is my structure in FDTD.

This is the mode profile from mode monitor before executing the run command. You can see the mode profiles for mode ‘3’

And this is the mode profile after executing the run command. The profile plotted is for mode ‘1’ !!!

My question is why the mode changed?! and what does the ‘index’, plotted in the figure with red, mean?



Please, upload the simulation file with parameters defined and structures drawn.
I haven’t got the “Si (Silicon) - Dispersive & Lossless” defined in my environment.
It seems that you defined it through GUI rather than by script.


I’ve checked the simulation with the built-in materials for Si and SiO2.
Running the simulation did not the mode profile.
I’m waiting for the replica of your file.

By the way, don’t you forget to click the “Save mode” button after the modes has been calculated ?


this is the material file with all materials definedmaterials.lsf (1.2 KB)


I did not understand !!


I checked the simulation once more. It was going all right.
You can try the attached file that your scripts yield.

GC_fibre_.fsp (2.1 MB)

Could you explain in more detail how do you change the input mode? Did you do it in the object tree and then pressing the run button in the program interface or by changing the script accordingly?


@msaygin which mode did you get from the mode profile in mode monitor?

I am changing the input mode via script with the command
after putting the mode source.

I ran the script once more and it stills not good. Let me explain in more detail. I updated the mode expansion monitor with the command
updatemodes(wg_mode_number); with wg_input_mode=3;
Then I visualize the mode profiles in the mode expansion monitor from the object tree (BEFORE executing the run command, execute only the first 18 lines of the file ‘two_RunGC_fdtd.lsf’) to find that it is E3 and H3 as in the figure below. This is the correct mode I want to investigate.

After executing the run command and visualize the mode profiles in the mode expansion monitor from the tree once again I got it for E1 and H1 which are not the desired modes (E3 and H3) !!

So the mode order just changed by itself. Why this happens??


I solve the problem

Thank you very much for your help



It would be instructive for others to know what was the problem in your case.
Was it the script that changed the mode back when you run it?


Sorry for the late reply.

Actually all settings were correct. I was reading wrong. That is all. I think if you tried the file again, all things will be right. Right?

I did not change anything, I changed where I look


your file was all right with it.


Do you know the meaning of index with red curve now? Why it’s not 1 and 3.45?


Hi @makeqi

There is a bug in software that treats index as a vector. As a workaround, you can visualize, say, only the x component i.e. index_x. Below is the result that you should obtain:

Hope this answers your inquiry.