-
-
February 28, 2022 at 11:40 am
Badrul
SubscriberI 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 pmGuanhui Wang
Ansys 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 pmBadrul
SubscriberOk, 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 pmGuanhui Wang
Ansys 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- You must be logged in to reply to this topic.
Ansys Innovation SpaceBoost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.Â
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
Trending discussions- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Using a license file on a new license server
- Ansys Insight: Diverging Simulations
- Error: addfdtd is not a valid function or a variable name
- Questions about the calculation of the cross-polarization conversion efficiency of metasurface
- Finding your Ansys (or Lumerical) account number
- Error on Lumerical device
- Ansys Insight: About override mesh in FDTD: its use and settings
- Lumerical – error message when trying to open from Linux terminal
Top Contributors-
8786
-
4658
-
3151
-
1678
-
1468
Top Rated Tags© 2023 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.
-