-
-
February 28, 2022 at 11:40 amBadrulSubscriber
I have often used FDTD module in the past, and scripting seems to be one of the best features of Lumerical.
In Interconnect, it seems similar, although with some differences.
I would like to import some data into the "Scripted" element in Interconnect, which I would like to use with the script inside.
If I understand correctly, we need to create a new property (inside "Property Editor" of that element), and use it as the mediation. I did something like this:
addproperty("SCRIPTED_1","new_property","scripted","FileOpen",0,100,"Dimensionless");
And subsequently I loaded a file.
Unfortunately, I have not been able to import the data stored inside, as the command " ?new_property " outputs me the just the name of the parameter, while I would like to read the content.
I have also tried to import the data by creating a matrix with 3 columns, and then creating the property:
addproperty("SCRIPTED_1","imported_Pin_vs_PGain","general","Matrix",0,100,"NonQuantity");
Thus, I would like a suggestion about the best way to approach this issue about importing data inside Scripted elements. I am pretty sure that there are many ways to approach it, but I guess I am missing something.
Also, what may be the best practice? Ideally, just like I used to do in FDTD, I would like to create fully automated scripts, where no clicking is involved for the simulations.
Thanks in advance for your answers
March 1, 2022 at 11:03 pmGWANGAnsys EmployeeHi Badrul
The "addproperty" command adds the property into the Scripted element, but not setting this property. You can use the "setnamed" or "set" command to set the property once you add it to the correspongding value. In your case, once you add the file open property, you can set the property to the path of the file, then the file will be loaded.
March 3, 2022 at 1:36 pmBadrulSubscriberOk, thank you very much. This helped a lot.
Can I ask you another thing? I am not sure if it is better to create a new discussion.
About the script inside "scripted element", I would like to access to the signals in the ports and use them as variables (e.g. take the electrical signal and transform it into charges, to influence the output from optical ports).
In the tutorials of scripted elements (https://support.lumerical.com/hc/en-us/articles/360036620253-Scripted-Element-Element-Library) the example scripts contain only output commands such as:
setsparameter("port 2", "port 1", "coefficients", trans, frequency );
But it is not possible to load it as a variable. There are ways to access to the ports' signal indirectly from the general script, but I would prefer to use it directly, if it is possible.
Thank you again for the previous answer,
Best regards.
May 4, 2022 at 5:01 pmGWANGAnsys EmployeeHi Badrul
Sorry for the late reply on this. In that case you would need to set the Scripted Element in time domain. Here are some examples of doing it at the end of this page: https://support.lumerical.com/hc/en-us/articles/360036620253-Scripted-Element-Element-Library
Viewing 3 reply threads- The topic ‘Importing data from files into scripted element [Interconnect]’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- INTERCONNECT – No results unless rerun simulation until it gives any
- Errors Running Ring Modulator Example on Cluster
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Import material .txt file with script
- Calculation of correlation values in laser modulation bandwidth simulation
- Trapezoidal ring
- Help for qINTERCONNECT
- Issues with getting result from interconnent analysis script
- Topology Optimization Error
- Edge Coupler EME Example Issue
Top Contributors-
1131
-
468
-
455
-
225
-
201
Top Rated Tags© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-