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

    • Badrul

      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 ("" ), 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:


      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
      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:
Viewing 2 reply threads
  • You must be logged in to reply to this topic.