add_subrange#

SweepHFSS.add_subrange(range_type, start, end=None, count=None, unit='GHz', save_single_fields=False, clear=False)[source]#

Add a range to the sweep.

Parameters:
range_typestr

Type of the range. Options are "LinearCount", "LinearStep", "LogScale", and "SinglePoints".

startfloat

Starting frequency.

endfloat, optional

Stopping frequency. The default value is None. A value is required for range_type="LinearCount"|"LinearStep"|"LogScale".

countint or float, optional

Frequency count or frequency step. The default is None. A value is required for range_type="LinearCount"|"LinearStep"|"LogScale".

unitstr, optional

Unit of the frequency. For example, "MHz or "GHz". The default is "GHz".

save_single_fieldsbool, optional

Whether to save the fields of the single point. The default is False. This parameter is used only for range_type="SinglePoints".

clearbool, optional

Whether to suppress all other subranges except the current one under creation. The default value is False.

Returns:
bool

True when successful, False when failed.

Examples

Create a setup in an HFSS design and add multiple sweep ranges.

>>> setup = hfss.create_setup(name="MySetup")
>>> sweep = setup.add_sweep()
>>> sweep.change_type("Interpolating")
>>> sweep.change_range("LinearStep", 1.1, 2.1, 0.4, "GHz")
>>> sweep.add_subrange("LinearCount",1,1.5,5,"MHz")
>>> sweep.add_subrange("LogScale",1,3,10,"GHz")