Photonics

Photonics

[Interconnect] Script element: is it possible to use “ports” as variables?

    • Badrul
      Subscriber

      Dear all,

      I have been a fervent user of scripts in Lumerical FDTD, and recently I have started using Interconnect.

      With Interconnect, I am very attracted by the "scripted element" object, which has many potentialities. In the examples ("https://support.lumerical.com/hc/en-us/articles/360036620253-Scripted-Element-Element-Library" ), the signal in the ports follow commands such as:


      setsparameter("port 1", "port 2", "s coefficients", trans, frequency );


      Where "port 1", "port 2", … are the ports to the scripted element.

      I would like to make some complex operations with the port signals, such as an equation involving the sum of the two optical ports' signal or selecting some curves depending on the electrical port's signal.


      Example 1:

      Y=G0*exp(port_1_input+port_2_input);


      Example 2:

      If 1

      { G0=k1; }


      With the commands seen so far, those operations do not seem possible directly, and for my purposes it would be useful to use the ports' signals as variables inside the "scripted elements". There are other ways to approach my problem (such as employing the external script in the overall simulation, instead of "scripted element"), but doing it inside seems to me the most spontaneous action (and mentally scalable).


      Can you tell me if there is a way to process my operation inside the script? I am sorry if I misunderstood the concept of the "scripted element", but it seems to me a very powerful tool.


      Thank you in advance for your attention,

      Badrul

    • Badrul
      Subscriber
      Sorry for the complicated formulation of the question. In practice, while in the tutorials some fixed values for "trans" are given as a relation between ports, I would like to use a transfer function that depends on the signals themselves, as shown in example1.
      I am not sure if "scripted" elements are capable of this, but it would be very useful to address many scenarios involving saturation.
    • Guanhui Wang
      Ansys Employee
      Hi Badrul
      Thank you for the post. To do this, you will need to use the Scripted Element in time domain. Here are some examples on this page to demo how to define this model in time domain: https://support.lumerical.com/hc/en-us/articles/360036620253-Scripted-Element-Element-Library.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.