TAGGED: electric-field, frequency-sweep, monitor, profile, sweep
-
-
May 24, 2022 at 6:37 pm
dylanve
SubscriberI would like to run 60 simulations in which I am changing the size of a particular feature and attempting to determine the resonant mode of the resulting structure. I have already ran a sweep which changes the feature size and records the eigenfrequency of the resonant mode. Now I would like to expand that sweep to include a frequency domain profile monitor to record the spatial profile of the E-field of the resonant mode. I already know the feature size and corresponding frequencies from the original sweep, and I have those readily available as a table/list. What is the easiest way to change the frequency center of the monitor (see picture) without manually editing it each run? Is what I am describing possible? I have searched the documentation and I have not found a script command or object property corresponding to frequency center. I considered just using multiple frequency points, but the frequencies I obtained from the original sweep are not linearly spaced, so this will not work. Thanks!
-
May 24, 2022 at 9:56 pm
Guilin Sun
Ansys EmployeeSo you want to assign a specific frequency/wavelength to a monitor to record after you get the sweep result of the resonance? if so you can try
setnamed("monitor","override global monitor settings",1);
setnamed("monitor","frequency points",1);
setnamed("monitor","wavelength center",c/fr);
setnamed("monitor","wavelength span",0);
here fr is the resonant frequency you found from the sweep.
You can find all the parameters you can assign for a monitor by
?setnamed("monitor") where the monitor name is "monitor".
Please try.
The monitor can record two different points at the exact frequencies or wavelengths if you set the frequency points to 2.
A more direct way is to use "custom" frequencies:
setnamed("monitor","sample spacing","custom");
setnamed("monitor","custom frequency samples",[200;300;500]*1e12); #set 3 frequency points .
So as long as you know the frequency or frequencies to record, you can use script to do it easily. Please try based on your need.
-
May 26, 2022 at 6:05 pm
dylanve
SubscriberThank you for the reply, this helped quite a bit. I am now able to change the center frequency of the monitor directly using the script commands. Is it possible to assign multiple values to a sweep parameter without setting the individual points manually? The example syntax given is:
addsweep;
setsweep("sweep", "name", "sweepName");
setsweep("sweepName", "type", "Values");
param.Value_1 = val1;
param.Value_2 = val2;
param.Value_3 = val3;
...
param.Value_63 = val63;
param.Value_64 = val64;
addsweepparameter("sweepName", param);
Is it possible to add the values from an array in a loop, instead of manually assigning each point? for example, adding 60 points like this:
addsweep;
setsweep("sweep", "name", "sweepName");
setsweep("sweepName", "type", "Values");
nValues = 60;
for (i = 1; i <= nValues; i = i + 1) {
param.Value_i = values(i);
}
where valuesis some array of length nValues containing all of the sweep points.
-
May 26, 2022 at 6:32 pm
Guilin Sun
Ansys EmployeeThis is a different question. Please write a new post later since the forum is targeting one-question one-solution.
A quick answer might be no, since param.Value_i cannot be changed by the loop "i". eg, the variables have to be defined before assigning values, except you find a way to change the variable name first.
-
- You must be logged in to reply to this topic.

Boost 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.
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Transmission results greater than one
- Ansys Insight: Diverging Simulations
- Ansys Insight: About override mesh in FDTD: its use and settings
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- Ansys Insight: Convergence issues in CHARGE
-
3744
-
2570
-
1787
-
1236
-
594
© 2023 Copyright ANSYS, Inc. All rights reserved.