# HP ADS 1.5 User-defined Models User Manual

Brand: HP, Pages: 216, PDF Size: 1.33 MB

### Page 126 from 216

5-26 SDD Examples

Custom Modeling with Symbolically-Defined Devices

Obtaining Charge From Capacitance

Often the equation for a nonlinear capacitor is specified not in terms of charge, but in

terms of a nonlinear capacitance C(v) where

Given this representation, the charge function is obtained by integrating the

capacitance

where we have explicitly included the arbitrary constant of integration Q

0.

If for some reason, the charge cannot be calculated, then the alternative technique

presented in “Alternative Implementation of a Capacitor” on page 5-47 can be used to

implement the capacitor. iCv()

d

dt ------ =

Qv()Cvˆ

()vˆ

Qo+ d

vò=

### Page 127 from 216

SDD Examples 5-27

Multi-port Capacitors

A nonlinear voltage-controlled two-port capacitor is usually defined by a capacitance

matrix

The capacitor currents are given by

The charge for a two-port capacitance is defined as the function Q(v

1,v2) such

that C(v

1, v2) is the derivative (that is, Jacobian) of Q(v1,v2). It follows that

Q(v

1,v2) exists if and only if

and

If Q(v

1,v2) does not exist, then the technique presented in “Alternative

Implementation of a Capacitor” on page 5-47 can be used to implement the capacitor. Cv

1v2, ()C11v1v2, ()C12v1v2, ()

C

21v1v2, ()C22v1v2, () =

i1

i2

Cv1v2, ()

t ddv1

v2

=

¶C11

¶v2-------------¶C12

¶v1------------- =

¶C21

¶v2-------------¶C22

¶v1------------- =

### Page 128 from 216

5-28 SDD Examples

Custom Modeling with Symbolically-Defined Devices

Full Model Diode, with Capacitance and Resistance

This example is under the Examples directory in the following location:

Tutorials/SDD_Examples_prj/networks/SDD_Diode.dsn

Capacitance. The junction capacitance of a reverse-biased pn diode may be written

as

The subscript r signifies reverse bias.

To develop this expression into an equation that can be used in an SDD, you integrate

C

r(v) with respect to v to get an expression for the charge:

where the arbitrary constant of integration is chosen so that Q

r(Vo) = 0.

There is a limitation to this equation because it is valid only for v < V

o. Though it is

useful in applications where the diode is always reverse biased (for example, a

varactor diode), it is not suitable for a general harmonic-balance analysis (or a DC

analysis, for that matter) where the bias voltage may exceed V

o.

A better diode model has the charge model extended into the forward-biased region,

plus resistance. Capacitance is described next, followed by resistance and the SDD

implementation. Besides yielding a valuable result, this example also highlights

some useful techniques for ensuring the continuity of charge and its derivative.

To increase the range of operation of the model, you can extend the capacitance into

the region v > V

o using a linear extrapolation. To do this, choose a such that 0 < a <1.

Let the previous C

r(v) equation be valid for v < aVo, and for v < aVo use

where:

•C

'

r(v) is the derivative of Cr(v) with respect to v

•The subscript f signifies forward bias

•C

f is a linear extension of Cr that matches the value and slope of Cr at v = a Vo

Crv ()CoVo

Vov – --------------- vVo< =

Qrv ()2 –CoVoVov – () vVo< =

Cfv ()CraVo()C'raVo()vaVo– () + =

### Page 129 from 216

SDD Examples 5-29

This definition of Cf ensures that, when joined with Cr, the capacitance and its

derivative are continuous. The boundary between reverse and forward bias is chosen

to be aV

o instead of Vo because the slope of Cr at Vo is infinite.

The next step is to integrate C

f (v) to obtain

where the constant of integration is chosen so that Q

f(aVo) = Qr(aVo). This equation

can be rewritten as

The overall expression for the junction charge is given as

NoteQ(v) and its derivatives are guaranteed continuous due to the definition of

Cf(v) and due to the choice of the constant of integration for Qf(v).

Resistance. The equation for the resistive behavior of a pn junction is the ideal

diode equation

Thus, total diode current has two components, one from the ideal diode equation and

one from the charge. This is handled in the SDD by specifying two equations for the

current of port one, one using weighting function number 0 and the other using

weighting function number 1.

Implementation. The SDD implementation is Q

fv ()vaVo– ()CraVo()C'raVo()vaVo– ()2 ¤ + ()QraVo() vaVo³. + =

Q

fv ()Co

1a – -----------------

vaVo–vaVo– ()2

4Vo1a – () ------------------------- +

èø ç÷

æö

Q +raVo() vaVo³. =

Qv()Qrv if vaVo<

Q

fv if vaVo³

è ç

æ

=

iIsexpvVT¤ ()1 – (). =

### Page 130 from 216

5-30 SDD Examples

Custom Modeling with Symbolically-Defined Devices

Note the following points:

• The current in the diode is based on two SDD equations:

• The first equation models the resistive behavior of the diode. It uses

expressions listed in the Var Eqn component under Current equations. These

include the variables max_exp, max_arg, the function exp_soft(x), and the

variable Vt. They determine what value Is is multiplied by. exp_soft is the soft

exponential function and is used to prevent overflow problems when taking

the exponent of a large number. It is the same as a normal exponential except

it becomes a linear extrapolation when its argument is such that the normal

exponential would exceed max_exp.

• The second equation models the charge. It uses the expressions listed in the

Var Eqn component under Charge equations. The value of _v1 is passed to

the function Q(v), where it is evaluated and the result is returned to the SDD.

There are several parameters with user-defined values, which also enter into

the calculations: Is (), Co (), Vo (), and alpha () (these value are passed from

TestDiode.dsn).