We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Photonics

Photonics

Topics related to Lumerical and more.

Small-Scale Metalens – Field Propagation will not open

    • cgutie22
      Subscriber

      I have been working on the small-scale metalens-field propagation app using 2022 R1.1 version 8.27.2963 and having a few issues.

      First, I noticed that the file "unit_cell.fsp" will not open, giving me an error stating "Error reading file". Why is this the case, and what is the significance of this file?

      Second, I noticed that the "unit_cell_fdtd.fsp" file has optimization/sweep variables called "height" and "radius". When I try to edit these sweep variables and try to run "unit_cell_fdtd.lsf", the sweep variables will reset to what they were before. Where can I edit this so that I can change the height and radii of the sweep?

       

      Lastly, where does the index of refraction for the pillars come from? I have a set index of refraction I would like to use for my material, but it looks like the code references a Matlab data file for the index of refraction of the material. Why is this?

    • Guilin Sun
      Ansys Employee

      Sorry to reply you late as this post was missed previously.

      1: Please install the latest version and test. I tested with R2024R1 and it works fine.

      2: "When I try to edit these sweep variables and try to run "unit_cell_fdtd.lsf", the sweep variables will reset to what they were before"

      Did you click "ok" or better "apply"?  I modified and clicked "ok", it works fine:

      Please install the latest version and see if it works.

    • cgutie22
      Subscriber

      Thank you for your reply and your patience. It took a while to implement your advice, as I had some license issues. After following your question, I found that I can edit the parameters in unit_cell_fdtd, but still have a couple of issues.

      In "unit_cell_fdtd", I noticed in the sweep that E would get the information from s_params. After changing the wavelength in s_params and clicking "ok", I noticed that the matlab file "EH_and_phase_vs_radius_fdtd" would print the wavelength as 6.6e-7. I also changed the source and reran the simulation, but the wavelength remains 6.6e-7. I will delete all the matlab files and run "unit_cell_fdtd", but I noticed the newly generated matlab file would have wavelength = 6.6e-7. Is there something else I am supposed to change so the wavelength in this file is also changed? I would just edit line 49, but I'm worried I may be incorrectly editing some parameters.

      My next question regards "unit_cell". I will not run "unit_cell.lsf" without editing it, and I notice "unit_cell" will only run up to 83, giving an error "... in 3D interp, if the first argument has a size of NxMxP, the fourth argument must have length P". Did you also get this error? As this is an example, shouldn't I just be able to run this code?

      Thank you so much for your response.

    • Guilin Sun
      Ansys Employee

      As long as you change the start/stop wavelength in "s_params" it should change the source wavelength (single wavelength in this case)

      Please check the script and find which line has the issue, and then check the dimension of the matrix.

      I checked and found that Ex has dimension of 

       ?size(Ex);
      result: 
      50  50  11  

      eg, 11 points for radius sweep.

      however the radius is changed to 51 points:

      ?size(grating_characterization.radius);
      result: 
      1  51  

      I would suggest you to modify the sweep points for radius from 51 to 11.

      I guess the uploaded file was modified after the script file uploaded.

       

       

Viewing 3 reply threads
  • The topic ‘Small-Scale Metalens – Field Propagation will not open’ is closed to new replies.