You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This source represents a small-signal AC excitation defined by a list of bias voltages,
20
+
a set of small-signal analysis frequencies, and a small-signal amplitude (linear scale).
21
+
22
+
The bias ``voltage`` refers to the DC operating point above the simulation ground. Currently, full circuit simulation though electrical ports is not supported.
23
+
24
+
Examples
25
+
--------
26
+
>>> import tidy3d as td
27
+
>>> voltages = [-0.5, 0, 1, 2, 3, 4]
28
+
>>> frequency = [1e3, 1e4, 1e5]
29
+
>>> amplitude = 1e-3
30
+
>>> voltage_source = td.ACVoltageSource(
31
+
... voltage=voltages,
32
+
... freqs=frequency,
33
+
... amplitude=amplitude,
34
+
... )
35
+
"""
36
+
37
+
name: Optional[str] =pd.Field(
38
+
None,
39
+
title="Name",
40
+
description="Unique name for the AC voltage source",
41
+
min_length=1,
42
+
)
43
+
44
+
voltage: ArrayFloat1D=pd.Field(
45
+
...,
46
+
title="DC Bias Voltages",
47
+
description="List of DC operating point voltages (above ground) used with :class:`VoltageBC`.",
48
+
units=VOLT,
49
+
)
50
+
51
+
freqs: ArrayFloat1D=pd.Field(
52
+
...,
53
+
title="AC Analysis Frequencies",
54
+
description="List of small-signal analysis frequencies.",
55
+
units=HERTZ,
56
+
)
57
+
58
+
amplitude: pd.FiniteFloat=pd.Field(
59
+
...,
60
+
title="Small-Signal Amplitude",
61
+
description="Small-signal AC amplitude.",
62
+
units=VOLT,
63
+
)
64
+
65
+
@pd.validator("voltage")
66
+
defvalidate_voltage(cls, val):
67
+
forvinval:
68
+
ifv==td_inf:
69
+
raiseValueError(f"Voltages must be finite. Current voltage= {val}.")
70
+
returnval
71
+
72
+
@pd.validator("freqs")
73
+
defvalidate_frequency(cls, val):
74
+
forvinval:
75
+
ifv==td_inforv<=0:
76
+
raiseValueError(
77
+
f"Frequencies must be strictly positive and finite. Current frequency={val}."
78
+
)
79
+
returnval
80
+
81
+
@pd.validator("amplitude")
82
+
defvalidate_amplitude(cls, val):
83
+
ifval==td_inf:
84
+
raiseValueError(f"Small signal amplitude must be finite. Current amplitude={val}.")
0 commit comments