The parameter sweep plugin assists the user in setting up a parameter sweep for an existing model in CADFEKO and combines the results in POSTFEKO.
The user selects the parameters to sweep from the variables contained in the CADFEKO model. For each selected variable, the sweep range and number of steps need to be defined. The script creates the necessary models and optionally runs the FEKO solver, after which the plugin can be used in POSTFEKO to combine the results from the sweep.
The plugin comes in two primary parts:
- parameter_sweep.lua: This CADFEKO macro generates all of the models and an XML file that stores all of the metadata about the sweep.
- combine_parameter_sweep_results.lua: This POSTFEKO macro takes the XML file stored by the CADFEKO macro as input, loads all of the simulated data and combines the results.
Installation and usage instructions
To install the plugin:
- Extract the ParameterSweep.zip folder to a central directory.
- Open “parameter_sweep.lua” in CADFEKO and add it to the application macro library.
- Open “combine_parameter_sweep_results.lua” in POSTFEKO and add it to the application macro library.
To use the plugin:
- Configure a parametric base model with the required geometry and the variables that need to be swept.
- Run the plugin to generate the models and (optionally) run the solver.
|The CADFEKO script prompts the user for the variables to sweep and the sweep ranges.
- Linearly spaced grid: This allows the user to perform a grid search. The design variables are interpolated with equal spacing with a specified number of samples per variable.
- Logarithmically spaced grid: This allows the user to perform a grid search where the samples are spaced logarithmically. For instance, a range of "0.1 to 10" with three samples will result in "0.1", "1" and "10".
- Variable grid: In certain situations, only a specific set of values are possible or of interest. The variable grid allows the user to specify how many samples are required in the grid, but gives the user the freedom to manually define each value point in a variable's range.
- List of permutations: A grid search has the potential to very quickly generate a lot of data. By controlling exactly what the values are for each permutation of the model, the user can choose arbitrary combinations of input variables. For instance, a workplane's position can be set to (0,0,0); (0,1,1) and (2,2,2) without having to go through every other combination on a grid. Note that the combinations in POSTFEKO result in a highly customised set of data.
- When the parameter sweep runs have completed, open a new POSTFEKO session (all previous results will be overwritten).
- Run the plugin to combine all of the simulated data.
The POSTFEKO script prompts the user for the XML file generated by the CADFEKO script. The number of sampling points to use for continuous frequency results can be specified.
About the plugin
- The combined data will be saved as “Stored data” in the POSTFEKO session. A new axis will become available for all results that could be merged for each variable that was swept.
- A “_RAW” instance of each merged result is generated in versions older than FEKO Suite 7.0.1 where some results (e.g. far/near fields) cannot be plotted as a function of the swept variable. The raw data allows you to do this, but may be more restricted in what quantities are available. The exact same information is present in the raw block, but some processing may be required.
- The only data that can be merged by the plugin are those that are exposed in the scripting environment. For instance, currents and charges are not supported in the FEKO Suite 7.0 API and cannot be merged.
- sources on
- edge ports
- far fields (discretely sampled)
- far fields (continuously sampled)
- near fields
- transmission/reflection coefficients
- characteristic modes
- receiving antennas (stored as power)
- sources on
- waveguide ports
- modal ports
- line ports
Download Archive Contents
The download archive contains seven files:
- parameter_sweep.lua - The first part of the plugin to be added to CADFEKO. Run this script from the script editor in CADFEKO or install it as an application macro in CADFEKO for regular use.
- combine_parameter_sweep_results.lua - The second part of the plugin to be added to POSTFEKO. Run this script from the script editor in POSTFEKO or install it as an application macro in POSTFEKO for regular use.
- parameter_sweep_helper.lua - A helper script that contains several sub-functions that are regularly used by the primary CADFEKO script.
- combine_parameter_sweep_results_helper.lua - A helper script that contains several sub-functions that are regularly used by the POSTFEKO primary script.
- shared_helper.lua - A helper script that is used by both primary scripts.
- split.png - An image file that may be used as icon for the script in the application macro library.
- merge.png - An image file that may be used as icon for the script in the application macro library.