Photonics

Photonics

Laguerre Gauss beam

    • luhuimin
      Subscriber

      hello,now i have writeen the script of Laguerre Gauss beam with Matlab.i used txt to convert it into mat format,which cannot be

      run in FDTD software.Please help me to convert it into mat format,which can be imported into FDTD?

    • Kyle
      Ansys Employee

      The simplest way to create a source based on a script would be to write the script as a Lumercial LSF script file instead of Matlab (the syntax for writing the equations should be almost identical to Matlab script, so converting the script shouldn't be a problem). This page has an example script that you can use as a starting point:
      You could also import the EM field data from the TXT file ( for example using the "readdata" script command: https://support.lumerical.com/hc/en-us/articles/360034411234-readdata) and save it in a rectilinear dataset. This page describes the format for doing that:
      However I think the first option would be easier.
    • luhuimin
      Subscriber
      I have seen the rxample you give me.the format is .fsp,which is imported into fdtd software.there are only two formats,.mat and .fld.i want to ask how can i convert to matlab data file(*mat)?

    • Kyle
      Ansys Employee

      The first page I linked has an LSF (Lumerical script file) that can be run from the Script Prompt in the FDTD GUI that creates the MAT file using the matlabsave script command. This script command takes the EM field data in a rectilinear dataset and converts it into the correct MAT file format for the import source in FDTD. I would recommend that you try changing the equations in that LSF script to create the MAT file for your beam profile. Importing the data from the TXT file, converting it into a rectilinear dataset and saving it as a MAT file would be possible but I think it would be more complicated.
    • luhuimin
      Subscriber
      the problem has been solved,thank you,teacher.
    • Kyle
      Ansys Employee
      You're welcome !
    • yqcally
      Subscriber
      Can you help the script? I have the same question
Viewing 6 reply threads
  • You must be logged in to reply to this topic.