tidy3d.DCVoltageSource#

class DCVoltageSource[source]#

Bases: Tidy3dBaseModel

DC voltage source in volts.

Parameters:
  • name (Optional[str] = None) – Unique name for the DC voltage source

  • voltage (ArrayLike[dtype=float, ndim=1]) – [units = V]. DC voltage usually used as source in VoltageBC boundary conditions.

  • units (Literal['V'] = V)

Notes

This voltage refers to potential above the equivalent simulation ground. Currently, electrical ports are not defined.

Examples

>>> import tidy3d as td
>>> voltages = [-0.5, 0, 1, 2, 3, 4]
>>> voltage_source = td.DCVoltageSource(voltage=voltages)

Attributes

Methods

check_repeated_voltage(val)

Warn if repeated voltage values are present, treating 0 and -0 as the same value.

check_voltage(val)

name#
voltage#
units#
classmethod check_voltage(val)[source]#
classmethod check_repeated_voltage(val)[source]#

Warn if repeated voltage values are present, treating 0 and -0 as the same value.

Uses tolerance-based comparison to handle floating-point representation differences (e.g., values from single vs double precision sources).