Photonics – Chinese

Photonics – Chinese

Topics related to Lumerical and more, in Chinese language

老师关于lumerical脚本问题

TAGGED: 

    • guohongjie
      Subscriber

      老师在lumerical中我想实现类似库函数的功能,lumerical中有导入别的脚本文件中的函数功能吗?

    • Guilin Sun
      Ansys Employee
      有函数功能,就是你先写一个函数,然后在主程序代入参数即可调用。function - Script command - Create your own functions
      比如这个例子: https://support.lumerical.com/hc/en-us/articles/1500007398122-Using-the-EME-solver-to-simulate-and-optimize-waveguide-bends
      其实也不一定用函数功能,用子程序也可以。方法与函数类似,只是不需要传递变量,因为变量在工作空间是共享的,只需要指令子程序运行,就可以提取结果。子程序就是另外的脚本文件,在主程序中直接调用,就是子程序名字就可以。比如你写一个专用程序计算
      sub_1.lsf #程序名
      y1=x*sqrt(x)+cos(x);
      在主程序中有x变量的数值,比如
      x=5;
      sub_1;
      ?y1
      都可以的。


    • guohongjie
      Subscriber
      好的 ! 谢谢老师回复!
Viewing 2 reply threads
  • You must be logged in to reply to this topic.