Nonlinear SPICE models for physiologic systems

Nonlinear SPICE models for physiologic systems

Computer Methods and Programs in Biomedicine, 29 (1989) 161-172 161 Elsevier COMMET 01008 Section 1. Methodology Nonlinear SPICE models for physio...

629KB Sizes 0 Downloads 78 Views

Computer Methods and Programs in Biomedicine, 29 (1989) 161-172

161

Elsevier COMMET 01008

Section 1. Methodology

Nonlinear SPICE models for physiologic systems Lawrence J. Goldstein and Eric B. Rypins Department of Surgery, University of California, Irvine Medical Center, and the Surgical Service. Veteran's Administration Medical Center, Long Beach, CA, U.S.A.

Most biological systems are nonlinear but investigators interested in modeling them often make linear approximations to avoid performing tedious manual calculations. SPICE (Simulation Program with Integrated Circuit Emphasis, developed at the University of California, Berkeley, CA), an electrical circuit simulation program, is frequently used for creating and analyzing linear network models of physiologic and pathophysiologic processes. However, few investigators use the full capabilities of the program by modeling nonlinear elements. We developed six nonlinear SPICE elements, allowing simplified modeling of most commonly encountered physiologic processes. These are provided as subcircuits that can be easily incorporated into existing SPICE models. Included are voltage and current controlled nonlinear resistors, capacitors and inductors. In addition, we describe adders, multipliers, powers, inverse, and derivative functions. Nonlinear electrical model; Electrical analogy; Biological model; Computer model; Cardiovascular hemodynamics; Fluid flow

1. Introduction

toolbox of nonlinear functions for SPICE model

To gain insight into complex physiologic processes,

builders. T h e c o m p o n e n t s are:

investigators are i n c r e a s i n g l y using c o m p u t e r s i m u l a t i o n s for solutions. Then, if needed, t h e y p e r f o r m selective e x p e r i m e n t s to c o r r o b o r a t e cornp u t e r g e n e r a t e d results. F o r e x a m p l e , m a n y p h y s i ologic processes such as c a r d i o v a s c u l a r h e m o d y n a m i c s [1-6], c e r e b r o s p i n a l fluid d y n a m i c s [7] a n d o x y g e n t r a n s p o r t [8-10] have b e e n m o d e l e d with electrical elements. However, s i m p l e p a s s i v e electrical elements d o n o t a d e q u a t e l y d e s c r i b e m a n y b i o l o g i c systems [7,11-15]. Therefore, we h a v e d e v e l o p e d s o m e o f the c o m m o n l y r e q u i r e d n o n l i n e a r devices a n d have w r i t t e n t h e m as S P I C E

(Simulation Program with Integrated Circuit Emphasis, d e v e l o p e d at the U n i v e r s i t y o f California,

Berkeley, CA) subcircuits, providing, in essence, a

demonstrated

÷ I v ...... :: : -,31 , E1

......

Vout - F(V ........ )

.~ ~i~ -~,~ . . . . . . ~_~_ J --z-

÷ 1 v ...... ( ~

-

herein

[ 1

....... ~

/

L

.~:

100 Meg

Correspondence: Lawrence Goldstein, M.D., Department of

Surgery, University of California, Irvine Medical Center, 101 City Drive South, Orange, CA 92668, U.S.A.

Fig. 1. Example of a voltage multiplier (VM) where Vout =

0169-2607/89/$03.50 © 1989 Elsevier Science Publishers B.V. (Biomedical Division)

F(V).

162

1. 2. 3. 4.

Voltage Multiplier (VM); Inverse Voltage Controlled Resistor (IVCR); Inverse Voltage Converter (IV); Voltage Controlled Resistor (VCR);

5. Voltage Controlled Capacitor (VCC); 6. Voltage Controlled Inductor (VCL). In this paper, we describe the derivation of each device and demonstrate its features with cir-

* * * * * * * 10118188 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * EXANPLE OF DISPLAYING THE POWER DISSIPATED BY A RESISTOR **** CIRCUIT DESCRIPTION

10:45:03 * * * * * * *

w~w~t~w~t~t~tttt~t~ttttw~tt~tt~t~wwwtttwwtt~ttttttttt~w~twtt~ww~

VIN 1 0 i:~L (0 70 .20 130 .5 70 1 70 1.2 150 1.5 70) RL 1 2 16.67 RSENSE 2 0 1E-8 ROUT 3 0 1 E1 3 0 POLY(2) 2 0 1 0 0 0 0 0 1E8 .TRAN .05 .7 • PLOT TRAN V(3) V(1) .END * * * * * * * 10/18/88 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * 10:45:03 * * * * * * * EXANPLE OF DISPLAYING THE POWER DISSIPATED BY A RESISTOR **** TRANSIENT ANALYSIS TENPERATURE = 27.000 DEG C LEGEND: * : V(3) +: V(1) TINE (*) .......... (+) . . . . . . . . . .

V(3) O.O000E+O0 6.0000E+01

O.O00E+O0 2.939E+02 5.OOOE-02 4.336E+02 1.000E'Ol 6.000E+02 1.500E-01 T.936E+02 2.000E-01 1.014E+03 2.500E-01 8.639E+02 3.000E'01 7.200E+02 3.500E'01 6.000E+02 4.000E'01 4.860E+02 4.500E-01 3.840E+02 5.0DOE-01 2.939E+02 5.500E-01 2.939E+02 6.000E'01 2.939E+02 6.500E'01 2.939E+02 7.000E-01 2.93~E+02

5.0000E+02 8.0000E+01

1.0000E+03 1.0000E+02

1.5000E+03 1,2000E+02

÷t ÷ It

÷

~t /t

÷

t

+

w

t

t 4.

+ ÷

÷/r ÷/t +* ÷t

IIN

(~

P (mmHg) + -

1 OPV,,y.+ ~RpNs,,*

10 -e

-

t (sec) .2 .5

Fig. 2. Displaying power using the VM function.

~

2.0000E+03 1.4000E+02

163 cuit diagrams, SPICE test programs and graphic output. In some cases, examples of how selected subcircuits can be used in clinical medicine are also given.

2. Materials and methods

We developed all of the subcircuits and examples in this report on an I B M - X T using a microcomputer version of the mainframe program SPICE [16-18] (PSPICE Version 3.08 [19]). This program is available for the IBM-PC and compatibles, Macintosh and Sun microcomputers and the VAX minicomputer. PSPICE requires 512 kbytes of RAM, and a math coprocessor. All the subcircuits are compatible with the mainframe program SPICE versions 2G.6 to 3A.6. The following derivations assume a basic knowledge of SPICE functions.

2.1. Theory The nonlinear elements presented in this article make use of a function not well documented in the SPICE manual and unfamiliar to m a n y SPICE users; that is, the P O L Y ( n ) function incorporated into a dependent source to produce a multidimensional controlled source. The ' n ' in P O L Y ( n ) is the number of controlling sources. For purposes of illustration, the output voltage of a voltage controlled voltage source with n = 3 is described by the following polynomial:

You1= eo + ely1

+ e:v2 + t' y 3 + P4Vl: + esvlv2

shown above. They are placed after the nodes or the names of the controlling sources are specified. Coefficients can be omitted but not if they are between two specified coefficients and P0 must always be specified. Spaces or commas can be used as delimiters. The default value for n is 1 and for P0 is zero to simplify the input of one-dimensional dependent sources. A weighted voltage adder is obtained by specifying values for Pa through P3" An offset can be added by including a non-zero Po. For an ideal adder, P1 through P3 are equated to one. A sum of the squares of voltages is obtained by specifying the coefficients P4, P7 and P9 equal to one, and setting all other coefficients to zero. Similarly, the sum of the cubes of voltages is resulted by choosing the appropriate coefficients for cubed voltages, P~0, P16, and PI9- To multiply two or three voltages together, values for P5 or P14 are specified respectively. By using this simple construct, nonlinear behavior can be modeled.

3. Results

3.1. Subcircuit 1." Voltage Multiplier (VM) Fig. 1 illustrates the use of a voltage controlled voltage source with a P O L Y ( n ) polynomial speci-

in +

Vcontr

,

Vn

+ e t v , v3 + e7v:: + P8V:V3 + P.V¢ + P.,V?

+ ~',.vlv:v~ + P . V y ~ ~ +

-

100 M e g ,

+ PnV12V2 + P, zV?V3 + P13V1V2

e16v?

100 Meg

io, I

r

': I PYooo,V,o i 1

2:

+ P17V?V 3 -Jr P18V2V32 + P19 V3 +P20VI4 + . . .

(1)

The coefficients of this polynomial are specified in the dependent source card in the order

Fig. 3. Example of an IVCR where: gin

]'in

P4VcoNTR Vin

-- - -

VCONq~R

* * * * * * * 10117/88 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * NCOELING VARIABLE RESISTANCE RESPONSIVE TO 8P PULSATILITY **** CIRCUIT DESCRIPTION

11:26:29 * * * * * * *

VIM 1 0 Pt/L(O 70 2 130) VCORR I 3 70 VRL 4 0 V ,. RDLX4NY 3 0 1E8 RL 1 5 16.67 VRL2 5 0 GRES 1 4 POLY(2) 2 0 1 0 0 0 0 0 .059988 EO 2 0 POLY(1) 3 0 1 2.817E-3 RO 2 0 1E8 .TRAM .1 2 .PLOT TRAM I(VRL) I(VRL2) .END * * * * * * * 10/17188 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * 11:26:29 * * * * * * * MODELING VARIABLE RESISTANCE RESPONSIVE TO BP PULSATILITY **** TRANSIENT ANALYSIS TEMPERATURE : 2 7 . 0 0 0 DEG C

,iit

I,.

V m*

-

®

R,

a

(V-70)2.817x10" -1

t (eec)

TIME V(1) V(2) I(VRL) I(VRL2) O.O00E+O0 7.000E+01 1.000E+O0 4.199E÷00 4.199E+00 1.000E'01 7.300E+01 1.008E+00 4.416E+00 4.379E+00 2.000E'01 7.600E+01 1.01TE+O0 4.63~E+00 4.559E+00 3.000E'01 7.900E+01 1.025E+00 4.BS9E+O0 4.T39E+O0 4.000E-01 8.200E+01 1.034E+00 5.085E+00 4.919E+00 5.000E'01 8.500E+01 1.042E+00 5.314E+00 5.O~E+O0 6.000E'01 8.800E+01 1.051E+00 5.547E*00 5.279E+00 7.000E'01 9.100E+01 1.059E+00 5.782E÷00 5.459E+00 B.OOOE'01 9.400E+01 1.0~E+O0 6.020E÷00 5.039E+00 9. O00E" 01 9. 700£+01 1. 076E+00 6.261E÷00 5.819E+00 1. O00E+O0 1. O00E+02 1. 085E+00 6. 506E÷00 5...'+"~ +O0 1. IOOE+O0 1. 030E+02 1. 093E+00 6. 753E÷00 6.179E÷00 1.200E+00 1.060E+02 1.101E+00 7.006E÷00 6.35qE+00 * * * * * * * 10117188 * * * * * * * PSpice ] . 0 8 b - August 1988 * * * * * * * 11:26:29 * * * * * * * M(])ELING VARIABLE RESISTANCE RESPONSIVE TO BP PULSATILITY **** TRANSIENT ANALYSIS TEMPERATURE = 2 7 . 0 0 0 DEG C t~tetetetttttettetet~t~ette~eteteeteeeeetetee~tte~tteeet~e~w~t~tte~e~

LEGEND: * : ! (VRL) +: I (VRL2) TIME (*) .......... (+) . . . . . . . . . . O.O00E+O0 1.000E'01 2. O00E-01 3. O00E'01 4. O00E- 01 5. O00E-01 6. O00E-01 7. O00E-01 8. O00E-01 9.000E-01 1. O00E+O0 1. IOOE+O0 1. 200E+O0

i (VRL) 4.0000E+O0 4.0000E+O0

4. I~)E+O0 4.41bE+00 4 .&3~+O0 4.859E+00 5.08SE+O0 5.314E÷00 5.547E+00 5.782E+00 6.020E+00 6.201E+00 6.506E+00 6.75]E*00 7. O06E+O0 1.300E+O0 7.257E÷00 1.400E+O0 7.514E+00 1.500E+00 7. TF3E+O0 1.600E+O0 8.036E+00 1.700E+O0 8.301E+00 1.800E+O0 8.570E+00 1.900E+O0 8.842E÷00 2. O00E+O0 9.117E+00

t

6. O000E+O0 5 • O000E+O0

8. O000E+O0 6. O000E+O0

1. O000E÷01 7. O000E+O0

1.2000E+01 8. O000E+O0

4. 'e 4" Q

4" t

4" t

4'. t

.4" t



4"



4' t

4' ÷ Q

+ •

4-

t

4" 4, t

+

t

.4" 4. t'

4" •

+ e

+

Fig. 4. An improved Windkessel model taking into account the decreased resistance in response to increasing intramural pressure.

165 (;:

4 +

[---

Motor

I

i

-3 'l

1A

100 Meg

l, i .,

I

100 Meg

I

ro • [q.__ '1

>

Vo

vo.... m

Fig. 5. Example of producing the inverse of a voltage V,CONTR where: v0= VCONTR

fying the relationship between the o u t p u t and two controlling voltages. This circuit can simulate several mathematical functions. First, a simple adder is m a d e by setting coefficients P1 and P2 equal to one for the addition of voltages VCONTm and VCONT~ . More source voltages can be a d d e d by increasing ' n ' and correctly specifying the corresponding coefficients *. A weighted sum can be obtained by specifying coefficients other than unity. A n offset voltage can be added as well by including a non-zero P0The sum of squares, cubes, and powers as well as the multiplication of two, three or more voltages can be obtained by specifying the appropriate coefficients in Equation (1). F o r current controlled sources the current must first be converted to a voltage before the voltage controlled subcircuit can be used. T w o strategies to accomplish this are: (1) use a current controlled voltage source for the conversion or (2) place a low-resistance shunt in series with the limb in which the current is to be measured and then use a voltage-controlled voltage source with a gain equal to the c o n d u c t a n c e of the resistor.

* Unfortunately there is no formula for determining the POLY(n) polynomial for different 'n's. For 'n' less than 3, equation (1) can be used by setting the expressions that are beyond the dimension that is being modeled to zero and consecutively reordering the coefficients. For 'n' greater than 3, one must refer to the SPICE manual. Unless you are making a simple adder, there is no a priori method for determining all the coefficient values,

As all S P I C E modelers know, S P I C E has a limited array of o u t p u t variables that it will display, namely voltage and current. By using the voltage multiplier subcircuit, however, S P I C E can o u t p u t more interesting quantities. Voltages and currents can be multiplied together by first converting the current source into a voltage source (as outlined above) and then using the voltage multiprier circuit as usual. Fig. 2 illustrates a circuit that generates an o u t p u t voltage that represents the power across a resistor. The power represents that which the heart delivers across the total systemic vascular resistance of 16.67 ohms [22,23] given a b l o o d pressure and wave-form shown and a heart rate of 60. The u p p e r curve (denoted by ' + ' signs) represents the pressure formed by the heart and the lower wave-form represents the power delivered to the load of the total systemic vascular resistance.

3.2. Subcircuit 2: Inverse Voltage Controlled Resistor (IVCR) In this subcircuit, we formulated an inverse voltage controlled resistor with an impedance inversely p r o p o r t i o n a l to a controlling input voltage, VcONTR- The circuit is shown in Fig. 3 and is derived as follows. W o r k i n g from the o u t p u t to the input, the i m p e d a n c e looking into node 1 is Vin/lin. By letting l/in be the voltage across the resultant nonlinear resistor as shown, and by specifying the polynomial coefficient P4 (n = 2) equal l / g m *, then: Zin = Vin/lin = Vin/( P4VinVCONTR) = grn/VCONTR (2) the desired result. By choosing P8 = 1 and all other coefficients equal to zero, /in

=

VinV(.~ONTR

(3)

making: Zin

~--" g m / (

VCONTR)2.

(4)

* gm is the baseline conductance of the nonlinear resistor.

166 * * * * * * * 10117188 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * 09:14:50 * * * * * * * VOLTAGE CONTROLLEDRESISTOR **** CIRCUIT DESCRIPTION w~tt~twwgtt~teeertQttwtt~wt~tttete~ttt~ttwt~t~etee~e~t~t~t~ttt~etwt~e~w .OPTIONS NOPAGE VIN 6 0 DC 10 VSENSE 3 2 0 ECONTR 5 0 4 0 1 VCONTR 5 6 0 R1601 RIN 4 1 1OK ROUImY 2 0 1E-8 HOUT 1 3 POLY(2) VSENSE VCONTR 0 0 0 0 1OK .DC VIN 1 10 1 .PLOT DC V(1) .PRINT DC V(1) V(2) V(3) V(4) V(5) • END TENPERATURE : 27.000 DEG C **** OC TRANSFER CURVES VIN V(1) (*) ........... 5. O000E+O0 0. O000E+O0 5. O000E*O0 1. O000E÷01 1. 5000E+O1 1.000E+O0

5.000E-01

2.000E+O0 3. O00E+O0 4. O00E+O0 5.O00E+O0 6.000E+O0 7.000E+O0 8. O00E+O0 9.000E+O0 1.000E+01

1.333E+00 2.2SOE+O0 3. 200E+O0 4.167E÷00 5.143E÷00 6.125E+00 7.111E+00 8. IOOE+O0 9.091E+00

*

t

/, 11

t

~N

÷v..,._

.

~

1 vstNse;(~® v,~ _

E .... . ~

~ R 1"

® -

ROUMMY~ (10"a

®

v~Ni~) l--:

Fig. 6. A voltagecontrolled resistor where: Zin

Vin

VCONTR

P4Vin/ VCONTR

/04

Zin in Equation (4) is an impedance inversely

proportional to the square of the controlling voltage, VCONTR. Choosing a three-dimensional voltage controlled current source, Zin = g m / (VcoNTR1 * VCONTR2) can be generated by including the coefficient that specifies the 1/'1112113 term.

Other variable resistors can be simulated by appropriately choosing polynomial coefficients. The following example shows how a nonlinear inverse voltage controlled resistor improves vascular modeling. The human artery dilates approximately _+2%

167

R IN I

Letting ro = 1,

+ I

__L

°Voo,

v v ..... v~v~ ~>~]7" c°

VIN

- I

(6)

Vou t = 1 / V C O N T R ,

{~--)VSENSE"O

the desired result. +

Vo.,,i

[7

:

aouuuY

3. 4. Subcircuit 4." Voltage Controlled Resistor (VCR)

Fig. 7. Example of a VCC when used with a constant controlling voltage or a derivative generator where:

d(VS) /VSENSE = - -

dt

of its quiescent diameter in response to normal blood pressure pulsatility. The traditional Windkessel model is a passive lumped resistor that does not take this fact into account and thus overestimates the pressure drop across and underestimates the flow through this element. We used an inverse voltage controlled resistor to improve the linear Windkessel model by adding the dependency of pressure in the element's value. Fig. 4 shows the same situation as in Fig. 2, that is, the heart driving the total systemic vascular resistance of 16.67 ohms. The SPICE output shown below shows the cardiac output as modeled with linear (the top trace) and nonlinear resistors (the lower trace) illustrating the errors introduced by neglecting the pressure effects on vascular resistance.

3.3. Subcircuit 3: Inverse Voltage Function (IV) We derived the inverse voltage function here for stand-alone use and as a building block for generating voltage controlled elements that are inversely proportional to a controlling voltage. Fig. 5 illustrates a circuit that generates the inverse of a voltage. An independent current source delivers 1 amp to an inverse voltage controlled resistor (the one derived in Fig. 3) producing the output voltage of: gout =

ro/VCONTR"

(5)

A voltage controlled resistor can be synthesized either by producing the inverse of a voltage by the method outlined in Fig. 5 above and connecting it in an analogous manner as in Fig. 3, or, more efficiently by using SPICE's ' H ' function * In Fig. 6, we used a current controlled voltage source to develop a voltage proportional to the current that flows through it and the controlling voltage VCONTR, providing: Vi'~ Zin

P4IinlvcosvR

/in

/in

P 4 I v ' °yTR = P 4 E c o N T R

=P4Vin

(7)

The same variations as described for Fig. 2 can be used to produce g i n = P4(V('ckNTR) 2 or P4VcoNTmVcoNTR2. In the figure, note how the test circuit correctly outputs the voltage across the nonlinear resistor of value 10k * Vm.

3.5. Subcircuit 5." Voltage Controlled Capacitors (VCC) The derivation of a voltage controlled capacitor is not as straightforward as the previous elements either in design or implementation. Fig. 7 illustrates the derivation process. First the input is isolated from the capacitive element C0. Then the input voltage is multiplied by a controlling voltage (using techniques described under Subcircuit 1) and placed in parallel with the capacitor. The current flowing through the capacitor is given below:

I¢ = c° d

~t¢

)

Co

d(VVc°NTR) dt

* "H' specifies a current controlled current source.

(8)

168

* * * * * * * 10117188 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * VCC-Uith no r e s t r i c t i o n on V c o n t r o t **** CIRCUIT DESCRIPTION t wit

tttttttttttttttttttt

tttttt

tt

ttttttttttt~tttttt

tt

08:58:34 * * * * * * *

ttetttttttttttttttttttt

t

VIN 3 2 AC 1 RXN 3 1 101( RDUNMY 2 0 1E8 VCONTR 4 0 DC 10 R1401 VSENSE 6 0 0 CO 5 6 .01UF FO 2 1 POLY(2) VSENSE VCONTR 0 0 0 0 1 E050121 .AC DEC 5 1 1OK .PLOT AC VM(1,2) VP(1,2) .END * * * * * * * 10/17/88 * * * t * * * PSpice 3 . 0 8 b - AuGust 1988 * * * * * * * 08:58:3~ * * * * * * * VCC-With no r e s t r i c t i o n on V e o n t r o t **** AC ANALYSIS TEMPERATURE : 27.000 DEG C tttttt*ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttflttttttttt

LEGEND: * : VM(1,2) +: VP(1,2) FREQ (*) .......... (+) . . . . . . . . . . .

VIq(1,2) 1.0000E-02 1.5000E+02

1. 0000E- 01

1. 0000E+00

1. 0000E+01

"1.0000E+02

-5.0000E÷01

-7.1054E'15

I . 000E÷00 1.585E+00 2.512E+00 3.981E+00 6.310E+00 1.000E+01

1. 000E+00 1.000E+00 9...~'Y'~.~-01 9.997E-01 9.992E-01

t

4.

t

÷

t

+

t

4..

9.980E-01

t

4..

1.585E+01

9.951E-01 9.878E- 01 9.701E-01 9. 296E-01 8.467E-01 ?.08~'01 5.352E'01 3.712E'01 2.446E- 01 1.572E'01 9.992E- 02 6.323E-02 3.995E- 02 2,522E'02 1.591E-02

t

2.512E+01 3.981E+01 6.310E+01 1.000E+02 1.585E+02 2.512£+02 3.981E+02 6.310E+02 1.000E+03

1. 585E+03 2.512E+03 3.981E+03 6.310E+03 1.000£÷04

R

+

t

4+

t.÷ t÷

X x '4+

fr

t

4" +

t

oN

+

®

®

v

(9

÷

t

v,,,_

I

÷.

t

t

1. 0000E+02 5.0000E+01

© V

i.,

t~oM¢, ° -

Fig. 8. Example of a VCC where C = C o V c o N - r R with no restrictions on VCONTR. The SPICE r u n shows a 3 dB cutoff point on tenth the value that would have been expected with a capacitor of 0.01 ~F. This was accomplished by multiplying the capacitance by VcosT R which was 10 in this example.

169

,CB) R,N

If VCONTR is constant, it can be taken out of the derivative, making: V,~

I~ = CoVcoNT R

d(V,°) dt

c~

' ' VL (vovo,

(s: VL i L °

(8)

. . . . i! ]1 =:,N'co.T. +

i" RDUMM-yI 0 B

But this is the same current that would flow through a capacitor with capacitance of: C = CoVcoNTR

L

(9)

Next, the current flowing through the capacitor is sensed by placing a voltage source of zero voltage in series with the capacitor. This sensed current is then coupled to the input via a current controlled current source. This, in essence makes the output connected between nodes 1 and 2 a capacitor with capacitance = CoVcoNTR. To make a capacitor that is a function of 1/VcoNT R, V 2, VxV2, and so forth, a controlling input voltage equivalent to the desired function must be created and reflected in the output at node 5. Additionally, current or power controlled capacitors as well complex function controlled capacitors can be synthesized by incorporating current to voltage conversion(s) in the voltage function. Although this circuit can be used to model a variable capacitor, it probably should not be because of the restriction that the controlling voltage must be constant. Instead it is better used for producing derivatives of mathematical functions. For example, this circuit can calculate the derivative of an input voltage, a product of two or more voltages or voltages raised to a power by requesting SPICE to display the current through VSENSE with respect to Vm. For example, an investigator can use this circuit if he is interested in obtaining the rate of contractility of the heart by displaying the derivative of the stroke work. In Fig. 8, we removed the restriction on the controlling input voltage by using the current developed through a capacitor that is across a replica of the input voltage. We accomplished this by substituting a one-dimensional voltage controlled voltage source across Co for the two-dimensional source in Fig. 7, thereby producing a one-dimensional function of Vm. We then used a currrent

Fig. 9. Example of a V C L where L = LoVcoNT R when is constant.

VCONT R

controlled current source to multiply I c by VCONT R and reflected this current, 18 to the input. The SPICE deck and output listed below demonstrates the variable capacitor of Fig. 8. The circuit is a simple series RC circuit driven by a sinusoidal input Vin. With Rin and CO equal to 10k and 0.01 # F respectively, one would expect 3 dB cutoff frequency of 1.58 kHz. However, in this variable capacitance example, we multiplied C o by 10 by m a k i n g VCONTR = 10 V, thereby reducing the - 3 dB point to 158 Hz. The magnitude and phase of the output across the variable capacitor is shown in the diagram. 3.6. Subcircuit 6: Voltage Controlled Inductor Subcircuit ( V C L )

The voltage controlled inductor illustrated in Fig. 9 is essentially a Thrvenin equivalent of Subcircuit 5 for the voltage controlled capacitor. As with the voltage controlled capacitor, it requires a constant controlling voltage to avoid possible unwanted terms in the effective inductance. In an analogous derivation as described above, Fig. 10 shows a circuit that allows a variable input voltage by using the voltage multiplier subcircuit. The SPICE file and output below show the magnitude and phase across a voltage controlled inductor in a series RL circuit. As in Fig. 8, we multiplied the

170

* * * * * * * 10117/88 * * * * * * * PSpice ] . 0 8 b - August 1988 * * * * * * * VOLTAGE CONTROLLED INDUCTOR **** CIRCUIT DESCRIPTION

05:33:07 *******

VIN 6 2 AC 10 VCONTR 4 3 DC 10 RIN 6 1 1OK R1 3 0 1E8 R2 4 0 1E8 LO 5 0 10 RDUI~Y 2 0 1E8 FO 0 5 VIN 1 EO 2 1 POLY(2) 4 ] 5 0 0 O 0 0 1 .AC DEC 5 1 IOK .PLOT AC V14(1,2) VP(1,2) .END * * * * * * * 10117188 * * * * * * * PSpice 3.08b - August 1988 * * * * * * * 0 5 : 3 3 : 0 7 * * * * * * * VOLTAGE COOITROLLED INOUCTOR **** AC ANALYSIS TENPERATURE • 27.000 DEG C LEGEND: * : VM(1,2) +: VP(1,2) FREQ ( * ) .......... (+) . . . . . . . . . . . 1.000E+O0 1.585E+00 2.512E+00 3.981E+00 6.310E+00 1.000E+01 1.585E+01 2.512E+01 ~.981E+01 6"r 310E*01 1.000E+02 1. 585E+02 2.512E+02 3.981E÷02 6.310E÷02 1.000E+03 1.585E+03 2.512E+03 3.981E+03 6.310E+03 1.000E+04

VM(1,2) 1. O000E - 01 5. O000E+O1 6.271E-01 9.909E-01 1.559£+00 2.427E+00 3.685E+00 5.320E+00 7.056E÷00 8.447E+00 9.285E+00

1. O000E+O0 0. O000E+O0 *

1. O000E+O 1 5. O000E+O1

1. O000E+02 1. O000E+02

,

1. O000E+03 1. 5000E+02

4-

*

4*

+ *

+ *

4. *

÷

X. +

*

+

9.696E+00 9.876E+00

*

* +

9.950E+00 9.980E+00 9. 992E+00 9.997E+00 9.,%~-'~,,+00 1.000E+01 1.000E+01 1.000E+01 1.000E+01 1.000E*01

dr

.+ .+ .+

dr

+ + + + +

t

+

it

+

® VL

~

®



I -/,.

02 R

, , - 10 °

.-:

Fig. 10. Example of a VCL where L = LOVCONT R with no restrictions o n VCONTR. The s P I C E r u n shows a 3 dB cutoff point one-tenth the value that would have been expected with an inductor of 10H. This was accomplished by multiplying the inductance by VCONTR which was 10 in this example.

171

quiescent inductance by 10 thus accounting for the - 3 dB point at 158 Hz.

statement on microcomputer versions of SPICE or by direct incorporation for strict batch jobs.

4. Discussion

References

Our goal was to assist SPICE modelers in accurately analyzing biologic systems by providing tools that are not readily apparent from the program documentation. Physiologic processes are often described by complex networks of nonstandard nonlinear elements, the most common of which are inverse voltage controlled resistors, inverse voltage controlled capacitors and nonlinear voltage multipliers. We have designed these and three other useful devices and presented them as subcircuits that can be incorporated in simulations almost as easily as their linear counterparts. Although SPICE does not provide these devices, we developed them using standard SPICE voltage and current controlled sources and the polynomial function. SPICE incompletely documents this function in its manual and thus its power as a modeling tool can be underestimated. In models of cerebrospinal fluid production and circulation [7] as well as in models of the cardiovascular system [20,21], investigators have either gone to great lengths attempting to solve their nonlinear network problems or have opted to use a more simplified linear approach. We believe that a more accurate representation of some biologic systems can be obtained with nonlinear elements. Investigators should not have to downgrade their models because they are unfamiliar with advanced mathematics or cannot perform complex network analysis.

[1] M.B. Mcllroy, W.S. Seitz and R.C. Targett, A transmission line model of the normal aorta and its branches, Cardiovasc. Res. 20 (1986) 581-587. [2] M.B. Mcllroy and R.C. Targett, A model of the systemic arterial bed showing ventricular-systemic arterial coupling, Am. J. Physiol. 254 (1988) H609-H618. [3] N. Westerhof, P. Sipkema, G.C. Van Den Bos and G. Elzinga, Forward and backward waves in the arterial system, Cardiovasc. Res. 6 (1972) 648-656. [4] Z. Liu, K.P. Brin and F.C.P. Yin, Estimation of total arterial compliance: an improved method and evaluation of current methods, Am. J. Physiol. 251 (1986) H588-H600. [5] R. Buranttini and S. Di Carlo, Effective length of the arterial circulation determined in the dog by aid of a model of the systemic input impedance, IEEE Trans. Bio-Med. Eng. 35(1) (1988) 53-61. [6] G. Avanzolini, P. Barbini, A. Cappello and G. Cevenini, CADCS simulation of the closed-loop cardiovascular system, Int. J. Biomed. Comput. 22 (1988) 39-49. [7] A. Marmarou, K. Shulman and R.M. Rosende, A nonlinear analysis of the cerebrospinal fluid system and intracranial pressure dynamics, J. Neurosurg. 48 (1978) 332-344. [8] H.J. Granger and A.P.Shepherd, Jr., Intrinsic microvasculax control of tissue oxygen delivery, Microvasc. Res. 5 (1973) 49-72. [9] M.M. Vayo, H.H. Lipowski, N. Karp, E. Schmalzer and S. Chein, A model of microvascular oxygen transport in sickle cell disease, Microvasc. Res. 30 (1985) 195-206. [10] K.A. Gaar, Jr., Oxygen transport, an analysis of short-term blood flow autoregulation, Comput. Biomed. Res. 20 (1987) 214-224. [11] T.W. Secomb, Flow-dependent theological properties of blood in capillaries, Microvasc. Res. 34 (1987) 46-58. [12] Y. Sun and H. Gewirtz, Characterization of the coronary vascular capacitance, resistance and flow in endocardium and epicardium based on a nonlinear dynamic model, IEEE Trans. Bio-Med. Eng. 34(10) (1987) 817-825. [13] C.V. Greenway and W.W. Lautt, Distensibility of hepatic venous resistance sites and consequences on portal pressure, Ann. J. Physiol. 254 (1988) H452-H458. [14] R.W. Sato, T.G. Wallner and B.D. Pederson, Measurement of ventricular volume by intracardiac impedance; theoretical and empirical approaches, IEEE Trans. BioMed. Eng. 33(2) (1986) 189-195. [15] P. Chaturani and R.P. Samy, Pulsatile flow of Casson's fluid through stenosed arteries with applications to blood flow, Biorheology 23 (1986) 499-511. [16] J. Choma, Jr., SPICE Macromodel for the Integrated

5. Availability All subcircuits and variations described in this text are available from the authors on a floppy disk for $15. For those who have older versions of PSPICE that do not support the ' H ' and 'F' functions, we have additionally included a modified version of our circuits so that only the 'E' and ' G ' functions are used. These subcircuits can be referenced into your circuits using the .LIB

172

[17]

[18]

[19] [20]

Bipolar Junction Transistor (TRW DSSG Microelectronics Center, TRW in-house publication, 4-7-1980). A.R. Newton, D.O. Pederson and A. SangiovanniVincentelli, SPICE 3A6 User's Guide (University of California, Berkeley, CA, Department of Electrical Engineering and Computer Sciences, 12-15-1985). E. Cohen, A. Vladimirescu and D.O. Pederson, SPICE 2E.O User's Guide (University of California, Berkeley, CA, Department of Electrical Engineering and Computer Sciences, 1-18-1978). MicroSim Corporation, PSPICE User's Manual (MicroSim Corporation, Irvine, CA, 3-1987). M.L. Costantino, R. Fumero and F. Inzoli, Hemodynamics of coronary artery stenosis, Life Support Syst. 3 (Suppl. 1) (1985) 453-457.

[21] T. Sata, S.M. Yamashero, D. Vaga and F.S. Grodins, Parameter sensitivity analysis of a network model of systemic circulatory mechanics, Ann. Biomed. Eng. 2(3) (1974) 289-306. [22] H.A. Schwid, L.A. Taylor and N.T. Smith, Computer model analysis of the radial artery pressure wave-form, J. Clin. Monit. 3 (1987) 220-228. [23] C.A. Tomaszewski and S.A. Meador, Theoretical effects of fluid infusions during CPR as demonstrated in a computer model of the circulation, Resuscitation 15 (1987) 97-112. [24] C.A. Desoer and E.S. Kuh, Basic Circuit Theory (McGraw-Hill, New York, 1978).