3.1.6 Value Specifications for Independent Sources
Independent sources may require multiple value specifications for different analysis modes. For example, a supply voltage source may have a value of V for DC and transient analysis and an AC value of V (e.g. for PSRR calculation). Multiple source values for both numerical and symbolic values can be specified in a netlist entry using a special form of the extended value field syntax (see Section 3.1.3).
Mode specific source value specifications.
A mode specification (modespec) is a Mathematica pattern which is compared against the value of the option AnalysisMode given to CircuitEquations during equation setup. Mode specifications are evaluated from left to right. The first matching pattern yields the element value that will be used.
The value specification in the following netlist entry will yield the source value for the option settings AnalysisMode -> DC and AnalysisMode -> Transient. For AC analysis the value will be used.
{VSUP, {VCC, 0}, Value -> {DC | Transient -> 12, AC -> 1}}
The value specification in the following netlist entry sets both the numeric and symbolic AC values of V1 to zero whereas the values Vin and 12 are used for all other analysis modes (DC and Transient).
{V1, {1, 0}, Symbolic -> {AC -> 0, _ -> Vin},
Value -> {AC -> 0, _ -> 12}}
Note that the above approach allows you to keep symbols that represent pure DC values out of AC equations (see example in Section 3.1.2):
Examples
Load Analog Insydes.
In[1]:= <<AnalogInsydes`
Define filter circuit.
In[2]:= filter = Netlist[ {V0, {1, 0}, Value -> {DC|Transient -> 5, AC -> 0}, Symbolic -> {AC -> 0, _ -> V0}}, {V1, {1, 2}, Value -> {AC -> 1, DC -> 0, Transient -> SinWave[Time, 0.8, 0.01, 1000]}, Symbolic -> V1}, {R1, {2, 3}, Value -> 1000., Symbolic -> R1}, {C1, {3, 0}, Value -> 1.*^-6, Symbolic -> C} ]
Out[2]=
Set up AC equation system. Note that symbol V0 does not appear in the AC equations.
In[3]:= CircuitEquations[ filter, AnalysisMode -> AC, ElementValues -> Symbolic] // DisplayForm
Out[3]//DisplayForm=
|