Photonics

Photonics

Topics related to Lumerical and more.

How to convert energy in terms of wavelength

TAGGED: 

    • AMaity
      Subscriber

      Hello,
      I was wondering if someone can lead me to get all these spectra wrt wavelengths. https://optics.ansys.com/hc/en-us/articles/360042160993

       

      ######################################################

      ## Script: plasmon_mode_excitation_scattering_linear.lsf

      ## this script will plot the results from the parameter

      ## sweep.

      ##

      ## Variables:

      ## run_sim: 0, do not run any simulation (load results from file)

      ## 1, run simulations (parameter sweep)

      ##

      ## Copyright 2019 Lumerical Inc.

      #######################################################

      clear;

      sweep_name = "sweep_polarization";

       

      run_sim = 1; # 0, do not run any simulation

      # 1, run sweep

       

      if (run_sim) {

      runsweep(sweep_name);

      }

       

      scat = getsweepresult(sweep_name, "scat");

      total = getsweepresult(sweep_name, "total");

       

      energy = scat.energy;

      scat = scat.sigma;

      total = -total.sigma;

      ext = scat + total;

       

      #######################################################

      # Linear x

      plot(energy, pinch(scat, 2, 1), pinch(total, 2, 1), pinch(ext, 2, 1),

      "energy (eV)", "cross section (m^2)", "Linear x polarization");

      setplot("x min", 2);

      setplot("x max", 3.2);

      legend("Scattering", "Absorption", "Extinction");

       

      #######################################################

      # Linear y

      plot(energy, pinch(scat, 2, 2), pinch(total, 2, 2), pinch(ext, 2, 2),

      "energy (eV)", "cross section (m^2)", "Linear y polarization");

      setplot("x min", 2);

      setplot("x max", 3.2);

      legend("Scattering", "Absorption", "Extinction");

    • Guilin Sun
      Ansys Employee

      You want to know how to convert wavelength to energy? it is inside the analysis group:

      sigma.addparameter("lambda",c/f,"f",f, "energy", h*f/e);

      where e and h are reserved constants in Lumerical:

      e is the charge;

      h is the Plank constant.

       

      energy=f*h/e=(c/lambda)*h/e

       

    • AMaity
      Subscriber

      Hi Guilin,
      Thanks for your prompt reply. So far I got the impression that if I make the following changes, it will work:

      plot(lambda, pinch(scat, 2, 1), pinch(total, 2, 1), pinch(ext, 2, 1),

      "lambda(nm)", "cross section (m^2)", "Linear x polarization");

      setplot("x min", 500);

      setplot("x max", 650);

      legend("Scattering", "Absorption", "Extinction");

      Let me know what you think.

      Regards

      Achyut

    • Guilin Sun
      Ansys Employee

      It is roughly ok. What the unit you use for the wavelength? it seems in nanometer, which is ok.

      setplot("x min", 500);

      setplot("x max", 650);

       

      This indicates they are in nanometers.

    • AMaity
      Subscriber

      The following errors are coming up:

      Error: C:/Users/3055376/Downloads/Plasmon mode excitation/plasmon_mode_excitation_linear.lsf line 32: lambda is not a valid function or variable name
      Error: C:/Users/3055376/Downloads/Plasmon mode excitation/plasmon_mode_excitation_linear.lsf line 32: could not create a figure window

       

      It does not seem to be working

    • Guilin Sun
      Ansys Employee

      Please modify the analysis script in the group, as the origingal dataset does not have "lambda". Instead, it uses "energy". Please modify it.General description about dataset can be found here: https://optics.ansys.com/hc/en-us/articles/360034409554-Introduction-to-Lumerical-datasets

Viewing 5 reply threads
  • The topic ‘How to convert energy in terms of wavelength’ is closed to new replies.