Please enable JavaScript to view this site.

Knowledge Base

Sets a property in a parameter sweep/optimization/Monte Carlo/S-parameter sweep item.






setsweep("name", "property_name", property_value);

Sets a property in a sweep/optimization/Monte Carlo/S-parameter item.


"name" is the absolute name of an analysis item.


"property_name" is the property showed in the edit window.


For a sweep analysis:



property_name = "name"

Sets the name of the sweep.

property_name = "type"

Sets the type of the sweep. The value of "type" could be "Ranges" or "Values"

property_name = "number of points"

Sets the number of points of the sweep. The default number of points is 10.

property_name = "resave files after analysis"

Defines whether or not to re-save the file after analysis.


For an optimization analysis:



property_name = "name"

Sets the name of the optimization.

property_name = "Type"

"Type" = "Maximum", "Minimum"

property_name = "algorithm"

"algorithm" = "Particle Swarm", "User Defined"

property_name = "maximum generations"

Sets the maximum generation number.

property_name = "reset random generator"

Checks the box of "Reset random generation".

property_name = "tolerance"

Sets the tolerance value.

property_name = "first generation script"

Sets the "first generation script" in the "Advanced" tab.

property_name = "next generation script"

Sets the "next generation script" in the "Advanced" tab.

property_name = "use figure of merit script"

Checks the box of "use figure of merit" in the "Figure of merit script" tab.

property_name = "figure of merit script"

Sets the "figure of merit script" in the "Figure of merit script" tab.


For a Monte Carlo analysis:



property_name = "name"

Sets the name of the Monte Carlo.

property_name = "number of trials"

Sets the number of trials for the Monte Carlo. The default number of trials is 10.

property_name = "variation"

Sets the variation for "Process" or "Mismatch" or "Both". The default variation is "Both".

property_name = "seed"

Sets the seed.

property_name = "enable seed"

Sets whether or not to enable the seed.

property_name = "individual trial"

Sets the individual trial number.

property_name = "enable individual trail"

Sets whether or not to enable individual trials.


For an S-parameter matrix sweep analysis:



property_name = "name"

Sets the name of the S-parameter matrix sweep.

property_name = "Excite all ports"

If property_value = "true", the sweep will run as many simulations as there are defined rows in the S-Matrix Setup table. If property_value = "false", simulations will be run only for the selected rows in the S-Matrix Setup table. The default is "true". For more information see S-parameter matrix sweep.

property_name = "auto symmetry"

If property_value = "true", auto symmetry is calculated and applied when possible (see S-parameter matrix sweep). If property_value = "false", no changes are applied to the S-parameter sweep. The default is "false".

Note: The changes made to the S-parameter sweep cannot be undone by setting property_value = "false". When property_value = "false", nothing changes in the current settings of the sweep.



Editing added sweep parameters:

In addition to the listed default properties of the sweep/optimization/Monte Carlo/S-parameter, any added sweep parameters can be edited by the setsweep command by setting the "property_name" to the parameter name.



This examples show how to set a sweep/optimization/Monte Carlo/S-parameter's properties respectively. Please refer to the application example page Sweep scripting commands for detailed information.




setsweep("sweep", "name", "thickness_sweep_script");

setsweep("thickness_sweep_script", "type", "Ranges");

setsweep("thickness_sweep_script", "number of points", 10); 




setsweep("optimization", "name", "thickness_optimization_script");

setsweep("thickness_optimization_script", "Type", "Minimize");

setsweep("thickness_optimization_script", "algorithm", "Particle Swarm");

setsweep("thickness_optimization_script", "maximum generations", 20);

setsweep("thickness_optimization_script", "generation size", 10);

setsweep("thickness_optimization_script", "tolerance", 0);


Monte Carlo:


MC_name = "MC_script";

setsweep("Monte Carlo analysis", "name", MC_name);

setsweep(MC_name, "number of trials", 50);

setsweep(MC_name, "enable seed", 1);

setsweep(MC_name, "seed", 1);

setsweep(MC_name, "Variation", "Both");


S-parameter sweep:


setsweep("s-parameter sweep", "name", "S sweep");

setsweep("s-parameter sweep", "Excite all ports", 0);

setsweep("S sweep", "auto symmetry", true);


See Also

Measurements, deletesweep, copysweep, pastesweep, addsweep, insertsweep, getsweep, addsweepparameter, addsweepresult, removesweepparameter, removesweepresult, Sweep scripting commands, Optimization scripting commands, Monte Carlo scripting commands

Copyright Lumerical Inc. | Privacy | Site Map