Photonics

Photonics

Script command to select all modes in FDE frequency sweep simulation

    • matteo
      Subscriber
      Hi Using the Frequency Sweep tab in the FDE solver in MODE solution, I would like to simulataneously calculate the dispersion of several modes. I was able to do it by shift selecting with my mouse all the modes of interest, but I would like to make this automatic using script commands. I found the selectmode(); command, but I am able to select only a single mode with it.
      Is it possible to programmatically select multiple modes among the simulated ones?

    • Guilin Sun
      Ansys Employee
      selectmode can only be used to select ONE specified mode https://support.lumerical.com/hc/en-us/articles/360034405234-selectmode-Script-command

      If you need to sweep specially selected modes, you may need to use selectmode and do this in a loop. Please refer this script:
      run;
      findmodes;

      DD=getdata("frequencysweep","D");

      nn=[1;3;4]; #choose mode 1,mode3 and mode4
      setanalysis("number of points",9);
      setanalysis("stop wavelength",1.49e-6);
      setanalysis("number of test modes",5);
      setanalysis("track selected mode",1);
      setanalysis("detailed dispersion calculation",1);
      D=zeros(length(DD),length(nn));
      for(n=1:length(nn)){
      selectmode(n);
      frequencysweep;
      D(:,n)=getdata("frequencysweep","D");

      }
      f=getdata("frequencysweep","f_D");
      plot(f,D);


    • matteo
      Subscriber
      Hi, thanks!
      That is quite disappointing, I wanted to avoid a loop because it basically repeats N times the same simulation, and I'm trying to speed up the calculations I'm making.
    • Guilin Sun
      Ansys Employee
      The other viable way is not to select any mode so to sweep the default 8 modes.
      Since this command is designed to select only one mode, please file a feature request for multiple modes: Vote new features, and file your feature request

    • matteo
      Subscriber
      Hi, yeah, I tried that, but the issue is that I need to track the mode, since I have mode crossings, AND I wanted to select only two of the 10 modes found at the initial wavelength. I hoped that selectmodecould accept as an input a list of desired modes. I will file a feature request, thanks!
Viewing 4 reply threads
  • You must be logged in to reply to this topic.