tidy3d.CustomHeatPerturbation#
- class CustomHeatPerturbation[source]#
Bases:
HeatPerturbation
Specifies parameter’s perturbation due to thermal effects as a custom function of temperature defined as an array of perturbation values at sample temperature points.
- Parameters:
attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.temperature_range (Optional[Tuple[NonNegativeFloat, NonNegativeFloat]] = None) – [units = K]. Temperature range in which perturbation model is valid. For
CustomHeatPerturbation
this field is computed automatically based on temperature sample points provided inperturbation_values
.perturbation_values (HeatDataArray) – Sampled perturbation values.
interp_method (Literal['nearest', 'linear'] = linear) –
Interpolation method to obtain perturbation values between sample points.
Notes
The linear
interpolation is used to calculate perturbation values between sample temperature points. For temperature values outside of the provided sample region the perturbation value is extrapolated as a constant. The temperature range,
temperature_range
, in which the perturbation model is assumed to be accurate is calculated automatically as the minimal and maximal sample temperature points. Wherever is applied, Tidy3D will check that the parameter’s value does not go out of its physical bounds withintemperature_range
due to perturbations and raise a warning if this check fails. A warning is also issued if the perturbation model is evaluated outside oftemperature_range
.
Example
>>> from tidy3d import HeatDataArray >>> perturbation_data = HeatDataArray([0.001, 0.002, 0.004], coords=dict(T=[250, 300, 350])) >>> heat_perturb = CustomHeatPerturbation( ... perturbation_values=perturbation_data ... )
Attributes
Whether perturbation is complex valued.
Range of possible parameter perturbation values.
Methods
compute_temperature_range
(values)Compute and set temperature range based on provided
perturbation_values
.sample
(temperature)Sample perturbation at provided temperature points.
Inherited Common Usage
- perturbation_values#
- temperature_range#
- interp_method#
- property perturbation_range#
Range of possible parameter perturbation values.
- classmethod compute_temperature_range(values)[source]#
Compute and set temperature range based on provided
perturbation_values
.
- sample(temperature)[source]#
Sample perturbation at provided temperature points.
- Parameters:
temperature (Union[) –
- ArrayLike[float],
SpatialDataArray
,TriangularGridDataset
,TetrahedralGridDataset
,
] Temperature sample point(s).
- Returns:
Union[ – ArrayLike[float], ArrayLike[complex],
SpatialDataArray
,TriangularGridDataset
,TetrahedralGridDataset
,] – Sampled perturbation value(s).
- property is_complex#
Whether perturbation is complex valued.
- __hash__()#
Hash method.