User`s guide
6
-
24 Analo
g
Behavioral Modelin
g
Example 3
A device, EPWR, computes the instantaneous power by
multiplying the voltage across nets 5 and 4 by the current
through VSENSE. Sources are controlled by expressions which
may contain voltages or currents or both. The ABM2 part (two
inputs, current output) in Figure 6-11 could represent this.
This part is characterized by the following attributes:
EXP1 = V(%IN2,%IN1) *
EXP2 = I(VSENSE)
This produces a PSpice A/D netlist declaration like this:
EPWR 3 0 VALUE = {V(5,4)*I(VSENSE)}
Example 4
The output of a component, GRATIO, is a current whose value
(in amps) is equal to the ratio of the voltages at nets 13 and 2. If
V(2) = 0, the output depends upon V(13) as follows:
if V(13) = 0, output = 0
if V(13) > 0, output = MAXREAL
if V(13) < 0, output = -MAXREAL
where MAXREAL is a PSpice A/D internal constant
representing a very large number (on the order of 1e30). In
general, the result of evaluating an expression is limited to
MAXREAL. This is modeled with an ABM2/I (two input,
current output) part like this one in Figure 6-12.
This part is characterized by the following attributes:
EXP1 = V(%IN2)/V(%IN1)
Note that output of GRATIO can be used as part of the
controlling function. This produces a PSpice A/D netlist
declaration like this:
GRATIO 2 3 VALUE = {V(13)/V(2)}
Note
Lettin
g
a current approach
±
1e30 will almost
certainly cause conver
g
ence problems. To avoid
this, use the limit function on the ratio to keep the
current within reasonable limits.
Fi
g
ure 6-11
ABM Expression
Part Example 3
Fi
g
ure 6-12
ABM Expression
Part Example 4