# HP ADS 1.5 User-defined Models User Manual

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

### Page 106 from 216

5-6 Writing SDD Equations

Custom Modeling with Symbolically-Defined Devices

Explicit Versus Implicit Representations

The explicit representation is a voltage-controlled representation and can implement

only voltage-controlled expressions. The implicit representation has no such

restriction. It can model equations that are voltage-controlled, current-controlled, or

use some other control.

Although implicit equations have no restrictions, explicit equations are more

“natural” and more efficient. The explicit representation is more natural simply

because many models are expressed in the voltage-controlled form i = f(v). The

corresponding implicit equation is i - f(v) = 0, which is less intuitive.

Explicit equations use standard nodal analysis, that is, the sum of the currents

entering and exiting a node equal zero. Implicit equations use modified nodal

analysis, which adds a branch equation and makes i

k available as a variable. For

more information on modified modal analysis, refer to the section “Modified Nodal

Analysis” on page 5-45.

The explicit representation is more efficient during a simulation because it is a

voltage-controlled representation and, therefore, does not create any new variables in

the modified nodal equations. With implicit equations, for every port that uses an

implicit representation, the port current is appended to the list of branch currents

and the port equation is appended to the modified nodal analysis equations. The

result is a larger system of equations with a larger number of unknowns (for a

discussion of modified nodal analysis and branch equations, see the section “Modified

Nodal Analysis” on page 5-45).

In general, you should use the implicit representation only when the explicit

representation is insufficient. For example, for a given port n, the port current

variable _in can be used in other equation s only if port n is defined with an implicit

equation.

### Page 107 from 216

Writing SDD Equations 5-7

Continuity

Many of the circuit-solving algorithms used by the simulator are based on the

Newton-Raphson algorithm. Consequently, constitutive relationships should conform

to the following:

• The functions must be continuous with respect to v and i.

• Ideally, the functions should be differentiable with respect to v and i, but it is

not required.

• It is desirable if the derivatives are continuous with respect to v and i, but this

is not necessary, for example, a step discontinuity in the derivative is often

acceptable.

An example where these considerations are important is piecewise-defined devices

where the constitutive relationship changes depending on the region of operation.

The constitutive relationships should be carefully pieced together to ensure

continuous derivatives at the region boundaries. An example is given in “Full Model

Diode, with Capacitance and Resistance” on page 5-28.

Although continuous derivatives are not requires, if a constitutive relationship does

not have continuous derivatives, the simulator may have trouble converging, even at

low power levels. If you are having convergence problems with an SDD, continuous

derivatives is the first thing to check.

### Page 108 from 216

5-8 Writing SDD Equations

Custom Modeling with Symbolically-Defined Devices

Weighting Functions

A weighting function is a frequency-dependent expression used to scale the spectrum

of a port current.Weighting functions are evaluated in the frequency domain.

There are two predefined weighting functions. Weighting function 0 is defined to be

identically one. It is used when no weighting is desired. Weighting function 1 is

defined as jw and is used when a time derivative is desired.

You can define other weighting functions, starting with the number 2. Weighting

functions must be defined in the frequency domain. Weighting functions can, for

example, correspond to time delay or to a low-pass or high-pass filter. An example of a

time delay weighting function is

:

Be aware that the SDD will be evaluated at DC, so a user-defined weighting function

should be well behaved at jw=0. For example, you might want to use a weighting

function of 1/jw to perform time integration, but this will cause a divide-by-zero error

at DC.

A procedure for how to enter weighting functions as part of an SDD definition is in

the section “Defining a Weighting Function” on page 5-16. e

j–wdelay´ ´

### Page 109 from 216

Writing SDD Equations 5-9

Weighting Function Example

To understand how the weighting functions are used, this example outlines the steps

taken to evaluate the port current of an SDD during a harmonic balance simulation.

For simplicity, consider a one-port SDD with an explicit representation for port one:

I[1,1] = f(_v1)

where f is some nonlinear function.

During a harmonic balance simulation, the simulator supplies the SDD with the

spectrum V

1(w) of the port voltage and asks the SDD for the spectrum I1(w) of the

corresponding port current. To evaluate the current, the SDD performs four steps:

1. Perform an inverse Fourier transform on the voltage spectrum V

1(w) to obtain a

(sampled) time waveform v

1(t).

2. Evaluate the nonlinearity f point by point along the time waveform. The result

is the (sampled) time waveform .

3. Perform a Fourier transform on the time waveform to obtain its spectrum

.

4. Scale the components of this spectrum using the weighting function to obtain

the spectrum of the port current.

NoteThe nonlinearity is evaluated in the time domain. The weighting function is

evaluated in the frequency domain.

Since multiplication by jw in the frequency domain is equivalent to time

differentiation in the time domain, in this example, the current is:

You will see this result used in “Nonlinear Capacitors” on page 5-25 and “Nonlinear

Inductors” on page 5-32, where the weighting function 1 is used to implement

nonlinear capacitors and inductors.V

1w ()v1t ()i ˆ1t ()Iˆ1t ()I1w ()ÞÞÞÞ

i1t ())

I1w ()

)

I1w ()

i1t ()d

dt------fv1t () () =

### Page 110 from 216

5-10 Writing SDD Equations

Custom Modeling with Symbolically-Defined Devices

Controlling Currents

Not only can the equations for an SDD be written in terms of its own port voltages

and currents, an SDD can also be set up to reference the current flowing in another

device. The devices that can be referenced are limited to either voltage sources or

current probes in the same network. For instructions on how to define a controlling

current, refer to the section “Defining a Controlling Current” on page 5-15 An

example appears in “Controlling Current, Instantaneous Power” on page 5-34.

Specifying More than One Equation for a Port

It is possible to specify more than one expression for a port, but they must be either

all implicit or all explicit expressions. And, each port must have at least one equation.

When more than one expression is given for a port, the SDD calculates a separate

spectrum for each expression. Each spectrum is weighted by the weighting function

specified for that expression. The SDD then sums up the individual spectra to get the

final spectrum. Explicit and implicit examples follow.

Explicit Cases

The two SDD equations

I[1,0] = f1(_v1)

I[1,0] = f2(_v1)

and

I[1,0] = f1(_v1) + f2(_v1)

are equivalent and implement

The SDD equations

I[1,0] = f1(_v1)

I[1,1] = f2(_v1)

implement

i1f1v1()f2v1() + =

i1f1v1()d

dt------f2v1() + =