Harmonic Balance Basics

This is a description of Harmonic Balance (HB) simulation, including when to use it, how to set it up, and the data it generates. Examples are provided to show how to use this simulation. Detailed information describes the parameters, theory of operation, and troubleshooting information.

Overview

Harmonic balance is a frequency-domain analysis technique for simulating distortion in nonlinear circuits and systems. It is usually the method of choice for simulating analog RF and microwave problems, since these are most naturally handled in the frequency domain. Within the context of high-frequency circuit and system simulation, harmonic balance offers several benefits over conventional time-domain transient analysis. Harmonic balance simulation obtains frequency-domain voltages and currents, directly calculating the steady-state spectral content of voltages or currents in the circuit. The frequency integration required for transient analysis is prohibitive in many practical cases. Many linear models are best represented in the frequency domain at high frequencies. Use the HB simulation to:

Refer to the following topics for details on Harmonic Balance simulation:

Using Harmonic Balance Simulation

This section describes when to use Harmonic Balance simulation, how to set it up, and the basic simulation process used to collect data.

License Requirements

The Harmonic Balance simulation uses the Harmonic Balance Simulator license (sim_harmonic) which is included with all Circuit Design suites except RF Designer. You must have this license to run Harmonic Balance simulations. You can work with examples described here and installed with the software without the license, but you will not be able to simulate them.

When to Use Harmonic Balance Simulation

Start by creating your design, then add current probes and identify the nodes from which you want to collect data.

How to Use Harmonic Balance Simulation

For a successful analysis:

For details about each field, click Help from the dialog box.

What Happens During Harmonic Balance Simulation

To perform a harmonic balance simulation, you only need to specify one or more fundamental frequencies and the order for each fundamental frequency. Agilent EEsof EDA recommends that all other parameters remain set to their default values. The simulator will set up the simulation in a proper way so that near optimal performance can be achieved without any additional parameter tweaking. For example, with Auto Select as the default choice for selecting matrix solvers, the simulator will determine whether the Direct Solver or the Krylov Solver is more effective for a particular circuit. For multi-tone HB simulations, the simulator will automatically determine whether to use Harmonic Balance Assisted Harmonic Balance (HBAHB) and how to set it up to achieve the optimal simulation speed.

Examples of Harmonic Balance Simulation

This section gives detailed setups to perform these simulations on a power amplifier:

Single Tone Harmonic Balance Simulation

The following figure illustrates the setup for simulating a power amplifier circuit.


Example setup for a basic harmonic balance simulation
Note
This design, HB1.dsn, is in the Examples directory under Tutorial/SimModels_prj. The results are in HB1.dds.
  1. From the Sources-Freq Domain palette, select and place a V_1Tone source on the schematic. Edit the component to set these values:
    • V = 0.01 V
    • Freq = 20 MHz. This is the first and only fundamental.
  2. Ensure that the inputs and outputs of nodes at which you want data to be reported are appropriately labeled. In this example, the output node has been labeled Vout.
  3. From the Simulation-HB palette, select and place the HB component on the schematic, then double-click to edit it. Select the Freq tab and edit these parameters:
    • Frequency = 20 MHz
    • Order = 7
      Click Add. If this line appears as the second fundamental frequency in the list, select the one above it and click Cut. Make sure that 1 20 MHz 7 is the only line that appears in the list of fundamental frequencies.
      Note
      With only a single frequency defined, the parameter Maximum mixing order is not available.
  4. Simulate. When the simulation is finished, a Data Display window opens. The following plot illustrates the results of the simulation, showing the fundamental and seven harmonics, declining in voltage (Vout) with increasing frequency.

Swept Harmonic Balance Simulation

In this example, the fundamental is swept from 500 MHz to 1500 MHz in 25 MHz steps. At 41 points along the sweep, data is collected for the value of the fundamental and 8 harmonics.

The following figure illustrates the setup for a swept harmonic-balance simulation of a power amplifier circuit.


Setup for a swept harmonic balance simulation
Note
This design, HB2.dsn, is in the Examples directory under Tutorial/SimModels_prj. The results are in HB2.dds.

To perform a swept harmonic balance simulation:

  1. From Sources-Freq Domain palette, select and place a P_1Tone component on the schematic and edit it to set these values:
    • Num = 1
    • P = dbmtow(-10). The function dbmtow() is used to convert power in dBm to watts for the purpose of simulation.
    • Freq = freq_swp. This sets the frequency to a variable which will be defined later.
  2. Label the nodes at which you want data to be reported, in this example, label the output node as Vout.
  3. From the Simulation-HB palette, select and place an HB simulation component on the schematic and edit it to select the Freq tab. Set the following parameters:
    • Frequency = freq_swp MHz. This is the only fundamental, or Freq[1].
    • Order = 8
      Click Add. If any other fundamentals appear in the list, select each line and click Cut. Make sure that 1 freq_swp MHz 8 is the only line that appears in the list of fundamental frequencies.
      Note
      Ensure that frequencies are established for all of the frequencies of interest in a design under test (for example, RF, LO, and IF frequencies). You may want to display them on the schematic to facilitate editing.
  4. Select the Sweep tab. Ensure that Start/Stop is selected and set the following:
    • Parameter to sweep = freq_swp
    • Sweep Type = Linear
    • Start = 500*
    • Stop = 1500
    • Step = 25
  5. Click OK to accept changes and close the dialog box.
  6. From Data Items palette, select and place a VAR (variables and equations) component on the schematic and edit it:
    • Under Variable or Equation Entry Mode, select Name=Value.
    • Under Select Parameter, select the default equation X=1.0 and in the field to the right, change it to freq_swp=1. This assigns freq_swp to the fundamental.
  7. Click OK to accept changes and close the dialog box.
  8. Simulate. When the simulation is finished, a Data Display window opens. One way to plot Vout is against the harmonic index. By setting the Trace Type to a spectral display, it shows the strength of each of the eight harmonics as the fundamental changes from 500 MHz to 1500 MHz.

The harmonic index (harmindex) is a sequential index of frequencies, starting with zero. It is generated either during a frequency sweep, or during oscillator analysis (since the oscillation frequency as an unknown variable is swept during the analysis). The harmindex is always the innermost variable, which makes it the independent variable. Each harmindex value corresponds to an actual simulated frequency (harmonic or intermod product) for each frequency value of the frequency sweep. The following illustration shows the relationship between the LO, the RF frequency, and the harmonics generating the harmindex in a table of results. Assuming a downconverting mixer design, the

Here are the reported values for the simulation frequency freq relative to the harmindex value that would appear in the data display:

harmindex freq
RFfreq=12 GHz RFfreq=14 GHz
0 0 GHz 0 GHz
1 4 GHz 2 GHz
2 12 GHz 14 GHz
3 16 GHz 16 GHz
4 28 GHz 30 GHz

Reference Equations

For equations on which the harmonic balance simulation is based, please see Harmonic Balance Background in the Guide to Harmonic Balance Simulation in ADS.

Limitations

Harmonic balance is limited in that the signal must be quasi-periodic and representable as a superposition of a number M of discrete tones. As M becomes large, the amount of required internal memory becomes excessive since the internal matrix size grows as M 2. Using Krylov linear solvers instead of direct methods reduces the memory growth from quadratic to linear (proportional to M). Therefore, the Krylov solvers enable harmonic balance to be used on very large circuits, and circuits with a large number of tones.

HB Simulation Parameters


ADS provides access to harmonic balance simulation parameters enabling you to define aspects of the simulation listed in the following table:

Important
For details about backward compatibility of default values for selected parameters, see Backward Compatibility Exceptions.
Tab Name Description For details, see...
Freq Frequencies of fundamentals. Setting Fundamental Frequencies
Sweep Sweep type and associated characteristics. Setting Up a Sweep
Initial Guess Sets parameters related to initial guess, including automated transient assisted harmonic balance (TAHB), harmonic balance assisted harmonic balance (HBAHB), initial guess from a data file, and initial guess for parameter sweep. It also allows the user to save the final solution in a data file. Setting Up the Initial Guess
Oscillator Enabling and setting up parameters for oscillator analysis. Enabling Oscillator Analysis
Noise Parameters related to noise simulation, including sweeps, input and output ports, and the nonlinear noise controllers to be simulated. Selecting Nonlinear Noise Analysis
Small-Sig Parameters related to small-signal/large-signal simulation. Setting Up Small-Signal Simulations
Params Parameters related to status level for summary information and device operating-point levels, as well as parameters related to FFT oversampling and convergence. Defining Simulation Parameters
Solver Parameters enabling you to choose between a Direct or Krylov solver or an automatic selection. The automatic selection is the default and recommended choice, since it allows the simulator to choose the most effective solver for each particular circuit. Additional parameters manage memory usage. Selecting a Harmonic Balance Solver Technique
Output Selectively save simulation data to a dataset. Selectively Saving and Controlling Simulation Data
Display Control the visibility of simulation parameters on the Schematic. Displaying Simulation Parameters on the Schematic

For additional information on setting up a harmonic balance simulation, refer to these topics:

Setting Fundamental Frequencies

On the Freq tab, you can specify the frequency portion of the simulation. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Frequency Parameters  
Setup Dialog Name Parameter Name Description
Fundamental Frequencies
Edit   Edit the Frequency and Order fields, then use the buttons to Add the frequency to the list displayed under Select.
  Frequency Freq[n] The frequency of the fundamental(s). Change by typing over the entry in the field. Select the units (None, Hz, kHz, MHz, GHz) from the drop-down list.
Order Order[n] The maximum order (harmonic number) of the fundamental(s) that will be considered. Change by typing over the entry in the field.
The number of harmonics need to be sufficiently large to represent nonlinear signals (sharp transitions, square waves). An increase in the Order slows down the simulation considerably or results in excessive memory usage. Use the Krylov solver if the problem is too big for the Direct solver.
The lower the Order, the greater the Harmonic Balance truncation error as a result of the Fourier truncation in the solution representation. As a rule of thumb, anything below 5-7 harmonics is unacceptable. Using the Manual Convergence Mode (ConvMode=1) and StatusLevel=4 or 5 will give an estimate of this error.
The computational complexity of the Krylov solver is determined by the size of FFT (i.e. by the number of samples). With Krylov Harmonic Balance, set Order to 7, 15, 31, etc.
Keep in mind that according to the Nyquist theorem at least 2 x Order + 1 samples are needed to represent the highest harmonic. The Oversample parameter increases the number of samples beyond the minimum by this factor, and, due to the nature of FFT, the number of samples is rounded up to the nearest power of 2.
Select   Contains the list of fundamental frequencies. Double-click in the Edit field to add fundamental frequencies to this window.
Add enables you to add an item.
Cut enables you to delete an item.
Paste enables you to take an item that has been cut and place it in a different order.
Run transient analysis long enough to approach steady state.
- At least 4-5 periods of excitation frequency
- Use fixed time-step (make sure it is small enough)
- Apply window (HB_Window=yes) to smooth the transient waveforms
Maximum mixing order MaxOrder The maximum order of the intermodulation terms in the simulation. The combined order is the sum of the individual frequency orders that are added or subtracted to make up the frequency list. For example, assume there are two fundamentals and Order (see below) is 3.
If Maximum mixing order is 0 or 1, no mixing products are simulated. The frequency list consists of the fundamental and the first, second, and third harmonics of each source.
If Maximum mixing order is 2, the sum and difference frequencies are added to the list.
If Maximum mixing order is 3, the second harmonic of one source can mix with the fundamental of the others, and so on.
Levels   Enables you to set the level of detail in the simulation status report.
  Status level StatusLevel Prints information about the simulation in the Status/Summary part of the Message Window.
- 0 reports little or no information, depending on the simulation engine.
- 1 and 2 yield more detail.
- Use 3 and 4 sparingly since they increase process size and simulation times considerably.
The type of information printed may include the sum of the current errors at each circuit node, whether convergence is achieved, resource usage, and where the dataset is saved. The amount and type of information depends on the status level value and the type of simulation.

Setting Up a Sweep

On the Sweep tab, setting up the sweep portion of the simulation consists of two basic parts:

To shorten simulation time in any parameter sweep, select a start point as close as possible to the convergence point and vary the parameter gradually. This yields better estimates for the next simulation, and achieves convergence more rapidly than if the parameter were changed abruptly. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Sweep Parameters
Setup Dialog Name Parameter Name Description
Parameter to sweep SweepVar The name of the parameter to be swept. Choose a parameter that can be set to a value for which the circuit will easily converge: source amplitude / power (amplifiers), bias voltage / current, or any component parameter that controls the amount of non-linearity in the circuit.
Find the parameter value for which the circuit converges. This is the start point of the sweep (e.g. smaller input power).
The actual parameter value for which the circuit does not converge is the end point of the sweep.
Parameter sweep-The sweep type and parameters.
  Sweep Type   A linear sweep works best in most cases Make sure Restart on the HB Initial Guess tab is not checked so that the sweep is used as a continuation (solution from previous sweep step used as an initial guess for the next step).
The number of sweep points (or step-size) controls the continuation step. The more sweep points, the greater the chances of success, but longer computation time as well.
  Single point Pt Enables simulation at a single frequency point. Specify the desired value in the Parameter field.
Linear   Enables sweeping a range of values based on a linear increment. Click Start/Stop to set start and stop values for the sweep, or Center/Span to set the center value and a span of the sweep.
Log   Enables sweeping a range of values based on a logarithmic increment. Click Start/Stop to set start and stop values for the sweep, or Center/Span to set the center value and a span of the sweep.
Start/Stop
Start, Stop,
Step-size,
Pts./decade,
Num. of pts.
Start
Stop
Step
Dec
Lin
Select the Start/Stop option to sweep based on start, stop, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade.
- Start-the start point of a sweep
- Stop-the stop point of a sweep
- Step-size-the increments at which the sweep is conducted
- Pts./decade-number of points per decade
- Num. of pts.-the number of points over which sweep is conducted
Center/Span
Center, Span,
Step-size,
Pts./decade,
Num. of pts.
Center
Span
Step
Dec
Lin
Select the Center/Span option to sweep based on center and span, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade.
- Center-the center point of a sweep
- Span-the span of a sweep
- Step-size-the increments at which the sweep is conducted
- Pts./decade-number of points per decade
- Num. of pts.-the number of points over which sweep is conducted
Note: Changes to any of the Start, Stop, etc. fields causes the remaining fields to be recalculated automatically.
Use sweep plan SweepPlan Enables use of an existing sweep plan component. Select this option and enter the name of the plan or select it from the drop-down list.

Setting Up the Initial Guess


On the Initial Guess tab, setting up the initial guess for a harmonic balance simulation consists of:

To set up a TAHB analysis:

It is recommended to use the TAHB Auto mode, which is the default setting. The simulator will turn on TAHB automatically if the circuit involves a divider. The TAHB On and Off choices are for you to manually turn on or off TAHB, which should be done only when you would like to override the simulator's automatic setting.

To set up a HBAHB analysis:

The Auto mode is the default and is recommended, which allows the simulator to determine whether to use HBAHB and to optimize the HBAHB setup if it is used. Selecting the On mode forces HBAHB to be turned on and the default sequencing (1-tone, 2-tone, ...) will be used. Selecting the Off mode forces HBAHB to be turned off.

By using HBAHB, the simulator will generate its own initial guess for multi-tone Harmonic Balance from another harmonic balance analysis with fewer fundamental frequencies than the original multi-tone problem. You do not need to supply an initial guess. If you do provide an initial guess by enabling Use Initial Guess and entering a name for File (parameters UseInFile and InFile ), then that will take precedence over HBAHB so long as the file exists.

The following table shows the parameters available to set the Initial Guess. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Initial Guess Parameters
Setup Dialog Name Parameter Name Description
Transient Assisted Harmonic Balance (TAHB)
  Transient Assisted Harmonic Balance TAHB_Enable Set the TAHB mode to Auto (default), On, or Off. Auto is set automatically if the circuit contains a divider. Choose On or Off to override the default settings. The Advanced Transient Settings are available when On is set.
Transient Setup - available with Advanced Transient Settings when Transient Assisted Harmonic Balance is On.
  Transient StopTime StopTime This is the transient stop time. The default is 100 cycles of the commensurate frequency. The commensurate frequency for a single tone simulation will be Freq [1]. If steady state is detected earlier than the StopTime, then transient will end earlier than the StopTime.
Transient MaxTimeStep MaxTimeStep This is the transient maximum time step. The default is 1/(8 x Maximum frequency).
Additional Transient Settings - available with Advanced Transient Settings when Transient Assisted Harmonic Balance is On.
  Min Time for detecting steady state SteadyStateMinTime This is the earliest point in time that the transient simulator starts checking for steady state conditions. If your circuit exhibits a large amount of over/undershoot, then this needs to be larger than the default so that the detector will begin to check for steady state after some of the initial transients have settled.
Transient IV_RelTol IV_RelTol This is the transient relative voltage and current tolerance. The default is 1e-3. When simulation options are included in the simulation (using the Options controller), use this value to set specific relative tolerances to be used for transient only. The value will be used for both current and voltage relative tolerance for transient.
Transient Other AddtlTranParamsTAHB Enables ability to set other transient simulation parameters that are not found in this dialog box. For example, use this parameter to set the following transient convolution parameter ImpMaxFreq=10 GHz.
Use only Freq[1] for transient OneToneTranTAHB Tells the simulator to perform a single tone transient simulation for a multitone harmonic balance simulation. The default setting is enabled.
Save transient data to dataset OutputTranDataTAHB When enabled, the transient simulation data used in generating the initial guess is output to the dataset, in addition to the final harmonic balance data. For large circuits, this can cause the datasets to become quite large.
Harmonic Balance Assisted Harmonic Balance HBAHB_Enable Set the HBAHB mode to Auto, On, or Off.
Initial Guess
  Use Initial Guess UseInFile Check this box to enter a file name for a solution to be used as initial guesses. This file is typically generated from a previous simulation by enabling Write Final Solution. If no initial guess file name is supplied, a default name (using DC solution) is generated internally, using the design name and appending the suffix .hbs. A suffix is neither required nor added to any user-supplied file name. For example, if you have saved the Harmonic Balance solution from a previous simulation, you can later do a nonlinear noise simulation and use this saved solution as the initial guess, removing the time required to recompute the nonlinear Harmonic Balance solution. Or you could quickly get to the initial Harmonic Balance solution, then sweep a parameter to see the changes. In this latter case, you will probably either want to disable the Write Final Solution option or use a different file name for the final solution to avoid overwriting the initial guess solution. (See Write Final Solution in the Final Solution section below).
The Annotate value specified in the DC Solutions tab in the Options block is also used to control the amount of annotation generated when there are topology changes detected during the reading of the initial guess file. Refer to DC Simulation. Since HB simulations also utilize the DC solution, to get optimum speed-up, both the DC solution and the HB solution should be saved and re-used as initial guesses.
The initial guess file does not need to contain all the HB frequencies. For example, one could do a one-tone simulation with just a very nonlinear LO, save that solution away and then use it as an initial guess in a two tone simulation. The exact frequencies do not have to match between the present analysis and the initial guess solution. However, the fundamental indexes should match. For example, a solution saved from a two tone analysis with Freq[1] = 1GHz and Freq[2]= 1kHz would not be a good match for a simulation with Freq[1] = 1kHz and Freq[2] = 1 GHz.
If the simulator cannot converge with the supplied initial guess, it then attempts to a global node-setting by connecting every node through a small resistor to an equivalent source. It then attempts to sweep this resistor value to a very large value and eventually tries to remove it.
File InFile Specify a file name to save results.
Regenerate Initial Guess for ParamSweep (Restart) Restart=yes or no Instructs the simulator to not use the last solution as the initial guess for the next solution.
Final Solution
  Write Final Solution UseOutFile Check this box to save your final HB solution to the output file. If a file name is not supplied, a file name is internally generated using the design name, followed by an .hbs suffix. If a file name is supplied, the suffix is neither appended nor required. If this box is checked, then the last HB solution is put out to the specified file. If this is the same file as that used for the Initial Guess, this file is updated with the latest solution.
Transient simulations can also be programmed to generate a harmonic balance solution that can then be used as an initial guess for an HB simulation. Refer to Harmonic Balance Simulation.
File OutFile Specify a file name to save results.

Enabling Oscillator Analysis

On the Oscillator tab, setting up an oscillator analysis consists of:

The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Oscillator Analysis Setup
Setup Dialog Name Parameter Name Description
Enable Oscillator Analysis OscMode Choose this if you want an oscillator analysis.
Method   Select Use Oscport if an OscPort or OscPort2 component is being used. There is no need to specify the name of the OscPort component; the simulator will find it automatically. Select Specify Nodes to use the OscProbe method which does not use an OscPort or OscPort2 component.
Specify Oscillator Nodes - The following parameters are available only when selected Method is Specify Nodes.
  Node Plus OscNodePlus This is the required name of a named node in the oscillator. Recommended nodes are those at the input or output of the active device, or in the resonator. Hierarchical node names are permitted.
Node Minus OscNodeMinus This second node name should only be specified for a differential (balanced) oscillator. Leave it blank for single-ended oscillators. Node Plus and Node Minus should be chosen symmetrically. Hierarchical node names are permitted.
Fundamental Index OscFundIndex Specifies which of the fundamental frequencies is to be treated as the unknown oscillator frequency which the simulator will solve for. The default value of 1 means that Freq[1] is the unknown.
Harmonic Number OscHarmNum Specifies which harmonic of the fundamental frequency is to be used for the oscillator. Normally this parameter stays at its default setting of 1. If an oscillator followed by a frequency divider is to be analyzed, this parameter should be set to the frequency divider ratio.
Octaves to Search OscOctSrch Specifies the number of octaves used in the initial frequency search during oscillator analysis. This many octaves are searched, centered around the frequency specified you specify for the Fundamental Tone. To skip the initial frequency search, provide a good initial guess of the frequency for Fundamental Tone, and set this parameter to zero.
Steps per Octave OscOctStep Specifies the number of steps per octave used in the initial frequency search. A high-Q oscillator may require a much larger value, such as 1000, in order for the search to find the phase shift at resonance.

Selecting Nonlinear Noise Analysis

The NoiseCon is used to select which NoiseCon nonlinear noise controllers should be simulated with the current harmonic balance analysis. These noise simulations will be performed in addition to any noise simulation that may be set up with Noise(1) and Noise(2) dialog boxes. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Noise Parameters
Setup Dialog Name Parameter Name Description
NoiseCons NoiseConMode The NoiseCons check-box in the tab must be clicked to enable noise simulation with NoiseCons. This button can be used to disable noise simulation of all NoiseCons without deleting them from the Select NoiseCons list.
  Select NoiseCons
  Edit   Specifies the name of the NoiseCon item to add to the simulation list.
Select Noisecon[n] Holds the names of the NoiseCon items to be simulated.
- Add -- adds a NoiseCon name.
- Cut -- deletes a NoiseCon name.
- Paste -- takes a NoiseCon name that has been cut and places it in a different order in the Select window.
Nonlinear noise NLNoiseMode Click to enable nonlinear noise analysis with harmonic balance.
  Noise (1)...   Choose Noise (1) to set up and run a small-signal/Harmonic Balance noise analysis following the final time point of the simulation.
Noise (2)...   Defining the Noise2 parameters consists of the following basic parts:
- Enable noise calculation.
- Specifying the nodes to use for noise parameter calculation.
- Specifying the noise contributors and the threshold for noise contribution.
- Optionally, specifying the bandwidth over which the noise simulation is performed.

Setting Up Parameters for Noise(1)

Choose Noise (1) to set up and run a small-signal/Harmonic Balance noise analysis following the final time point of the simulation. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Noise(1) Parameters
Setup Dialog Name Parameter Name Description
Noise frequency
  Sweep Type
  Single point FreqForNoise Enables simulation at a single frequency point. Specify the desired value in the Parameter field.
Linear   Enables sweeping a range of values based on a linear increment. Click the Start/Stop option to select start and stop values for the sweep.
Log   Enables sweeping a range of values based on a logarithmic increment. Click the Center/Span option to select a center value and a span of the sweep.
Start/Stop
Start, Stop,
Step-size,
Num. of pts.
NLNoiseStart
NLNoiseStop
NLNoiseStep
NLNoiseLin
Select the Start/Stop option to sweep based on start, stop, step-size and number of points.
- Start -- the start point of a sweep
- Stop -- the stop point of a sweep
- Step-size -- the increments at which the sweep is conducted
- Num. of pts. -- the number of points over which sweep is conducted
Center/Span
Center, Span,
Pts,/decade,
Num. of pts.
NLNoiseCenter
NLNoiseSpan
NLNoiseDec
NLNoiseLin
Select the Center/Span option to sweep based on center and span.
- Center -- the center point of a sweep
- Span -- the span of a sweep
- Pts./decade -- number of points per decade
- Num. of pts. -- the number of points over which sweep is conducted
Note: Changes to any of the Start, Stop, etc. fields causes the remaining fields to be recalculated automatically.
Use sweep plan NoiseFreqPlan Enables use of an existing sweep plan component (SweepPlan). Select this option and enter the name of the plan or select it from the drop-down list.
Input Frequency InputFreq Because the simulator uses a single-sideband definition of noise figure, the correct input sideband frequency must be specified here. This parameter identifies which input frequency will mix to the noise frequency of interest.
In the case of mixers, Input frequency is typically determined by an equation that involves the local oscillator (LO) frequency and the noise frequency. Either the sum of or difference between these two values is used, depending on whether upconversion or downconversion is taking place.
The above parameters do not need to be specified if only the output noise voltage is desired (that is, if no noise figure is computed).
Noise input port NoiseInputPort Number of the source port at which noise is injected. This is commonly the RF port. Although any valid port number can be used, the input port number is frequently defined as Num=1.
Noise output port NoiseOutputPort Number of the Term component at which noise is retrieved. This is commonly the IF port. Although any valid port number can be used, the output port number is frequently defined as Num=2.

Setting Up Parameters for Noise(2)

Defining the Noise2 parameters consists of the following basic parts:

The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Noise(2) Parameters
Setup Dialog Name Parameter Name Description
Nodes for noise parameter calculation NoiseNode[n] The fewer the number of nodes requested, the quicker the simulation and the less memory required.
  Edit   Selects the named node(s) for the simulator to consider
Select   Holds the names of the nodes the simulator will consider.
- Add -- adds a named node.
- Cut -- deletes a named node.
- Paste -- takes a named node that has been cut and places it in a different order in the Select window.
Noise contributors - Use this area to sort the noise contributors list and to select a threshold below which noise contributors will not be reported. A list shows how each component contributes to noise at a specific node. The noise contributor data are always in units of V/sqrt(Hz) for noise voltages, and A/sqrt(Hz) for noise currents; they do not scale with noise bandwidth.
  Mode SortNoise Provides options for sorting noise contributors by value or name.
  Off Off Causes no individual noise contributors to be selected. The result is simply a value for total noise at the output.
Sort by value Sort by value Sorts individual noise contributors, from largest to smallest, that exceed a user-defined threshold (see below). The subcomponents of the nonlinear devices that generate noise (such as Rb, Rc, Re, Ib, and Ic in a BJT) are listed separately, as well as the total noise from the device.
Sort by name Sort by name Causes individual noise contributors to be identified and sorts them alphabetically. The subcomponents of the nonlinear devices that generate noise (such as Rb, Rc, Re, Ib, and Ic in a BJT) are listed separately, as well as the total noise from the device.
Sort by value with no device details Sort by value with no device details Sorts individual noise contributors, from largest to smallest, that exceed a user-defined threshold (see below). Unlike Sort by value, only the total noise from nonlinear devices is listed without any subcomponent details.
Sort by name with no device details Sort by name with no device details Causes individual noise contributors to be identified and sorts them alphabetically. Unlike Sort by name, only the total noise from nonlinear devices is listed without subcomponent details.
Dynamic range to display NoiseThresh A threshold below the total noise, in dB, that determines what noise contributors are reported. All noise contributors less than this threshold will be reported. For example, assuming that the total noise voltage is 10 nV, a setting of 40 dB (a good typical value) ensures that all noise contributors up to 40 dB below 10 nV (that is, up to 0.1 nV) are reported. The default of 0 dB causes all noise contributors to be reported. This parameter is used only with Sort by value and Sort by value with no device details.
Include port noise in node noise voltages IncludePortNoise Causes port noise to be included in noise currents and voltages. Ports must be placed and defined.
Calculate noisy two-port parameters NoisyTwoPort Causes an S-parameter simulation to be performed. Ports must be placed and defined. The Noise input port parameter should be set equal to the port number specified by the Num parameter on the input source, and the Noise output parameter to the number of the output Term (termination) component to Num=2. The following two-port parameters (dataset variables) are then returned and can be plotted:
- NFmin -- minimum noise figure of a two-port circuit. It is equal to the noise figure when the optimum source admittance is connected to the circuit. (Its default unit is dB).
- Sopt -- the optimum source match for a two-port circuit. It is the reflection coefficient (looking into the source) that gives the minimum noise figure.
- Rn -- the effective noise resistance in ohms (unnormalized) of a two-port circuit. Effective noise resistance can be used to plot noise-figure circles or related quantities. This parameter determines how rapidly the minimum noise figure deteriorates when the source impedance is not at its optimum value.
- Icor -- the noise current correlation matrix, in units of Amperes squared. It describes the short circuit noise currents squared at each port, and the correlation between noise currents at different ports.
These expressions for noise simulation can be manipulated in equations. At low powers, NFmin agrees with NFssb and both match the noise figure found from a small-signal analysis. As the input power increases and nonlinear devices compress, this is no longer the case. NFmin and NFssb both deteriorate from their small-signal values. NFmin is an approximation to NFssb which neglects higher order conversion gains, and the difference between NFmin and NFssb expresses the importance of these higher order conversion gains. For most applications, compression is moderate and NFmin and NFssb are close. For applications driven into severe compression, NFmin and NFssb can differ significantly. Also, note that Sopt is only defined at one frequency and that severe compression may demand a matching network that takes into account other frequencies. Deep into compression, care should be taken when using the noisy two-port parameters for design.
Use all small-signal frequencies UseAllSS_Freqs Use all small-signal frequencies causes the simulator to solve for all small-signal mixer sidebands. This default option requires more memory but delivers more accurate results. In addition, it may require large kernel swap-size parameters. Only if there is insufficient memory should this option be set to no. Setting this option to no, causes only half of the small-signal mixer sidebands to be used and also uses one-fourth of the memory, but at the cost of generating potentially inaccurate results. Exercise caution when setting this option to no.
Note: If you find you are running out of RAM, either set this parameter to no after reading the paragraph above, or switch to the Krylov option.
Bandwidth BandwidthForNoise Bandwidth for spectral noise simulation. 1 Hz is the recommended bandwidth for measurements of spectral noise power. The noise contributor data do not scale with noise bandwidth.

Setting Up Small-Signal Simulations

The Small-Sig tab enables you to use a large-signal/small-signal method to achieve faster simulations when some signal sources are much smaller than others, and are assumed not to exercise circuit nonlinearities. For example, in a mixer the LO tone can be considered the large-signal source and the RF the small-signal source. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Small-Signal Parameters
Setup Dialog Name Parameter Name Description
Small-signal SS_MixerMode Choose this if you want a small-signal analysis.
Small-signal frequency
  Sweep Type
  Single point SS_Freq Enables simulation at a single frequency point. Specify the desired value in the Frequency field.
Linear   Enables sweeping a range of values based on a linear increment. Click Start/Stop to set start and stop values for the sweep, or Center/Span to set the center value and a span of the sweep.
Log   Enables sweeping a range of values based on a logarithmic increment. Click Start/Stop to set start and stop values for the sweep, or Center/Span to set the center value and a span of the sweep.
Start/Stop
Start, Stop,
Step-size,
Pts./decade,
Num. of pts.
SS_Start
SS_Stop
SS_Step
SS_Dec
SS_Lin
Select the Start/Stop option to sweep based on start, stop, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade.
- Start -- the start point of a sweep
- Stop -- the stop point of a sweep
- Step -- size-the increments at which the sweep is conducted
- Pts./decade -- number of points per decade
- Num. of pts. -- the number of points over which sweep is conducted
Center/Span
Center, Span,
Step-size,
Pts./decade,
Num. of pts.
SS_Center
SS_Span
SS_Step
SS_Dec
SS_Lin
Select the Center/Span option to sweep based on center and span, step-size or pts./decade, and number of points. Linear sweep uses Step-size; Log sweep uses Pts./decade.
- Center -- the center point of a sweep
- Span -- the span of a sweep
- Step -- size-the increments at which the sweep is conducted
- Pts./decade -- number of points per decade
- Num. of pts. -- the number of points over which sweep is conducted
Note: Changes to any of the Start, Stop, etc. fields causes the remaining fields to be recalculated automatically.
Use sweep plan SS_Plan Enables use of an existing sweep plan component (SweepPlan). Select this option and enter the name of the plan or select it from the drop-down list.
Use all small-signal frequencies UseAllSS_Freqs Solves for all small-signal mixer frequencies in both sidebands. This default option requires more memory and simulation time, but is required for the most accurate simulations.
Merge small- and large-signal frequencies MergeSS_Freqs By default, the simulator reports only the small-signal upper and lower sideband frequencies in a mixer or oscillator simulation. Selecting this option causes the fundamental frequencies to be restored to the dataset, and merges them sequentially.

Defining Simulation Parameters

The Params tab enables you to define these basic simulation parameters:

The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Parameters
Setup Dialog Name Parameter Name Description
Device operating point level DevOpPtLevel Enables you to save all the device operating-point information to the dataset. In ADS, if this simulation performs more than one HB analysis (from multiple HB controllers), the device operating point data for all HB analyses will be saved, not just the last one. Default setting is None.
  None None No information is saved.
Brief Brief Saves device currents, power, and some linearized device parameters.
Detailed Detailed Saves the operating point values which include the device's currents, power, voltages, and linearized device parameters.
FFT
  Fundamental Oversample FundOversample Sets the FFT oversampling ratio. Higher levels increase the accuracy of the solution by reducing the FFT aliasing error and improving convergence. Memory and speed are affected less when the direct harmonic balance method is used than when the Krylov option is used.
Increasing the Oversample can help convergence by ensuring that rapid transitions and sharp features in waveforms are more precisely sampled. This does not increase the problem size, but does increase the number of device evaluations. The computational complexity of the direct Harmonic Balance solver (determined by the Order and size of circuit) is largely not affected. As a rule of thumb, try to set the Oversample to 2, 4, etc.
For multi-tone Harmonic Balance, the number of samples is equal to the product of the sample sizes of the fundamentals.
More... Oversample[n] Displays a small dialog box. To increase simulation accuracy, enter in the field an integer representing a ratio by which the simulator will oversample each fundamental.
Budget
  Perform Budget simulation OutputBudgetIV Enables Budget simulation, which reports current and voltage data at the pins of devices following a simulation. Current into the nth terminal of a device is identified as ...device_name.tn.i. Voltage at the nth terminal of a device is identified as ...device_name.tn.v.

Selecting a Harmonic Balance Solver Technique




The Solver tab enables you to select a Direct or Krylov solver, or to allow the simulator to assign one automatically. The automatic selection is the default and recommended choice, since it allows the simulator to choose the most effective solver for each particular circuit. Newton's method needs to solve a sequence of linear problems. If Newton's method doesn't converge or the convergence rate is too slow the Direct method will use arc-length continuation, while the Krylov method will use source stepping. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Solver Parameters
Setup Dialog Name Parameter Name Description
Convergence    
  Convergence Mode ConvMode  
  Auto (Preferred) =Auto  (Preferred) This is the default mode setting. It is both fast and robust, combining capabilities of the Basic and Advanced modes. This mode will automatically activate advanced features to achieve convergence. The Auto mode also allows for convergence at looser tolerances if the simulation does not meet the default tolerances. A warning message is given in the status window when this occurs, and it includes the tolerance level up to which convergence was achieved.
Advanced (Robust) =Advanced  (Robust) Enables an advanced Newton solver. This mode is extremely robust, and ensures maximal KCL residual reduction at each iteration. It is recommended that the maximum number of iterations (MaxIters) be increased to the 50-100 range when this mode is selected.
Basic (Fast) =Basic  (Fast) Enables the basic Newton solver. It is fast and performs well for most circuits. For highly nonlinear circuits the basic mode may have difficulties converging. It is then recommended to switch to the Advanced convergence mode.
Max. iterations MaxIters The maximum number of Newton iterations to be performed. The simulation will iterate until it converges, an error occurs, or this limit is reached. The default and recommended option is Robust. You can also specify the number manually by choosing the Custom option and entering an integer. The larger the number is, the more robust the simulation will be.
Advanced Continuation Parameters   Opens dialog to set the arc-length continuation parameters.
Matrix Solver
  Solver Type UseKrylov  
    Auto Select =auto This is the default mode setting. It is recommended because optimal performance can be achieved for most circuits. It allows the simulator to choose which solver would be most effective for the active design.
Direct =no Best suited for smaller problems and faster. The computation time grows with the cube of the problem size and memory grows with the square of the problem size.
The parts (blocks) of the Jacobian are truncated to a specified threshold (bandwidth) by default (GuardThresh= 10 to the power 4). This bandwidth truncation speeds up the Jacobian factorization, but can lead to convergence problems as the Newton direction is not accurate. Try setting GuardThresh=0 (full bandwidth).
Krylov =yes Intended for larger problems, includes advanced preconditioning technology with an iterative linear solver. This method greatly reduces memory requirements in large harmonic balance problems, such as those encountered in RFICs or RF System simulations. The computation time grows slightly faster than linear with the number of samples (FFT size), and memory grows linearly with the number of harmonics.
This is an iterative linear solver that does not require explicit storage of Jacobian. The linear problem can be approximately solved in fewer iterations to a desired (loose) tolerance and the Newton direction is computed approximately. This can affect the Newton convergence properties, but not the accuracy of the final solution.
Krylov solver iterations are limited by the max number of iterations ( HB Solver tab, or KrylovMaxIters, default 150). Increase this limit if it is often reached.
The Krylov solver achieves full convergence if the linear system residual is smaller than the tight tolerance (KrylovTightTol, default 0.001). After KrylovLooseIters iterations (default 50), the solver uses KrylovLooseTol (default 0.1) to achieve partial convergence. The solver fails if residual reduction factor in two adjacent iterations is larger than KrylovConvRatio (default 0.9).
Matrix Re-use SamanskiiConstant This parameter is for the Direct Solver only. It controls how frequently the Jacobian is constructed and factored rather than being reused. The default and recommended option is Fast. The user can specify the number by choosing Custom and entering 0, 1, or 2. The smaller the number is, the more robust the simulation will be.
Krylov Restart Length GMRES_Restart This parameter determines the number of iterations after which the Krylov Solver is restarted. The larger this parameter, the more memory and CPU time will be required but the more robust the simulation will be as well.
Advanced Krylov Parameters   Opens dialog to set the Krylov solver's parameters.
Memory Management    
  Matrix Bandwidth GuardThresh The Jacobian matrix from the direct solver within the Newton solver is a block matrix. A block matrix is a matrix whose elements are matrices and vectors. The blocks of the Jacobian are truncated to a specified threshold by default. The default threshold (bandwidth) is set by Guard Threshhold, and its default option is Fast. The bandwidth truncation speeds up the Jacobian factorization and saves memory, but can lead to convergence problems due to an inaccurate Newton direction. In order to get the full bandwidth of the Jacobian blocks and improve the convergence, choose the Robust option.
FFT Options PackFFT Controls the frequency map packing for multitone Harmonic Balance. By default, when it is not explicitly set to yes or no by the user, the simulator enables it (sets it to yes).
  Minimize memory & runtime PackFFT=yes Enables frequency map packing, which may improve the simulation speed and reduce memory consumption by using a smaller number of time samples (smaller FFTs), but at the potential loss of dynamic range and accuracy due to the aliased harmonics of the first fundamental now possibly landing on various mixing tones.
Minimize aliasing PackFFT=no Disables frequency map packing to achieve most accurate results.
Waveform Memory Reduction    
  Use Dynamic Waveform Recalculation RecalculateWaveForms Enables reuse of dynamic waveform memory instead of upfront storage on all waveforms. Small circuits might simulate a little slower, but not significantly.
Use Compact Frequency Map UseCompactFreqMap Enables a spectral compression, typically requiring less memory for individual waveforms.

Advanced Continuation Parameters

These parameters are for arc-length continuation. The arc-length continuation is an extremely robust algorithm. If it fails, try all other convergence remedies first before adjusting these arc-length parameters. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Solver Advanced Continuation Parameters
Setup Dialog Name Parameter Name Description
Arc Max Step ArcMaxStep Limits the maximum size of the arc-length step during arc-length continuation. In the arc-length continuation, the arc-length is increased in steps. The step size is calculated automatically for each problem. However if the ArcMaxStep is specified and is nonzero, it will define an upper-limit for the size of the arc-length step. The default is 0 which means there is no upper limit for the ArcMaxStep. Display and set this parameter directly on the schematic.
Arc Level Max Step ArcLevelMaxStep Limits the maximum arc-length step size for source-level continuation. The default is 0 which means there is no limit for the ArcLevelMaxStep. Display and set this parameter directly on the schematic.
Arc Min Value ArcMinValue Set relative to ArcMaxValue. ArcMinValue determines the lower limit that is allowed for the continuation parameter p during the simulation. In the arc-length continuation, p can trace a complicated manifold and its value can vary non-monotonically. ArcMinValue specifies a lower bound for p such that if during the arc-length continuation, p becomes smaller than ArcMinValue, the simulation is considered to have failed to converge. The default is pmin-delta, where delta is pmax-pmin, pmin is the lower end of the parameter sweep, and pmax is the upper end of the parameter sweep. Display and set this parameter directly on the schematic.
Arc Max Value ArcMaxValue Set relative to ArcMinValue. ArcMaxValue determines the allowed upper limit of the continuation parameter p during the simulation. In the arc-length continuation, p can trace a complicated manifold and its value can vary non-monotonically. ArcMaxValue specifies an upper bound for p such that if during the arc-length continuation, p becomes greater than ArcMaxValue, the simulation is considered to have failed to converge. The default is pmax+delta, where delta is pmax-pmin, pmin is the lower end of the parameter sweep, and pmax is the upper end of the parameter sweep. Display and set this parameter directly on the schematic.
Max Step Ratio MaxStepRatio Controls the maximum number of continuation steps (default is 100). Display and set this parameter directly on the schematic.
Max Shrinkage MaxShrinkage Controls the minimum size of the arc-length step (default is 1e-5). Display and set this parameter directly on the schematic.

Advanced Krylov Parameters

These parameters allow detailed configuration for the Krylov solver. Default values are recommended for optimal performance. The following table describes the parameter details. Names listed in the Parameter Name column are used in netlists and on schematics.

HB Simulation Advanced Krylov Parameters
Setup Dialog Name Parameter Name Description
Max Iterations KrylovMaxIters Maximum number of GMRES iterations allowed. It is used to interrupt an otherwise infinite, loop in the case of poor or no convergence. The default is intentionally set to a large value of 150 to accommodate even slowly convergent iterations. You can still increase this number in cases where poor convergence may be improved and you are willing to allow more time for it.
Krylov Noise Tolerance KrylovSS_Tol Sets the tolerance for the Krylov solver when that solver is used either for small-signal harmonic balance analysis or for nonlinear noise analysis. It needs to be tight, and the default value is 1e-6. Larger values may lead to less accurate results, while further tightening may require longer simulation times.
Packing Threshold KrylovPackingThresh Used with Matrix Packing. Packing Threshold sets the bandwidth threshold for the packing. The default value is 1e-8. Set this to a larger value to increase the memory reduction. Display and set this parameter directly on the schematic.
Tight Tolerance KrylovTightTol The solver achieves full convergence if the Krylov solver residual is less than this tight tolerance setting (default=0.001). Display and set this parameter directly on the schematic.
Loose Tolerance KrylovLooseTol After the number of iterations specified by the parameter Loose Iterations, the solver then uses Loose Tolerance (default=0.1) to achieve partial convergence. Display and set this parameter directly on the schematic.
Loose Iterations KrylovLooseIters Sets the number of iterations allowed (default=50) to achieve convergence before using the Loose Tolerance value. When the number of Loose Iterations is reached, the solver then uses the Loose Tolerance value to achieve partial convergence. Display and set this parameter directly on the schematic.
Matrix packing KrylovUsePacking Directs the solver to use the technique known as spectral packing, which reduces the memory needed for the Jacobian, typically by 60-80%. The penalty is a longer computation time if no swapping is required. By default, this feature is turned off. You should turn on for extremely large problems in which the available RAM would not be able to accommodate the Jacobian.
Preconditioner KrylovPrec The Krylov solver requires a preconditioner for robust and efficient convergence. Preconditioners (matrices approximating the Jacobian) are used to speed up the Krylov solver's convergence. ADS uses GMRES, a robust and theoretically optimal Krylov solver that is memory intensive without a restart.
  DCP =DCP (DC Preconditioner) is the default preconditioner, which is effective in most cases, but fails for some very strong nonlinear circuits. It uses a DC approximation on the entire circuit. Due to its block-diagonal nature, it can be factored once and applied inexpensively at each linear solve step. This preconditioner approximates the Jacobian by ignoring all but the DC Fourier coefficients (consists of the diagonal blocks of the Jacobian).
BSP =BSP (Block Select Preconditioner) is recommended for instances when a Krylov HB simulation fails to converge using the DCP option. The BSP preconditioner is more robust than the DCP for highly nonlinear circuits. On those circuits that converge with DCP, the overhead that the BSP preconditioner introduces is small. On circuits that fail with the DCP, using the BSP option will often achieve convergence at the cost of additional memory usage. Hidden BSP parameter is accessible only by using Other=:
- bspRHS_Thresh -- activate BSP if Newton residual smaller than this threshold (default 0.05)
SCP =SCP (Schur-Complement Preconditioner) is also intended for use with circuits that fail to converge with the DCP preconditioner. This is a robust choice for highly nonlinear circuits. It uses the DC approximation for most of the circuit similar to DCP. The most nonlinear parts of the circuit are excluded, and are instead factored with a specialized Krylov solver. The complex technology of the SCP preconditioner results in a memory usage overhead. This overhead is due to a construction of a knowledge base that enables the SCP to be much more efficient in the later phase of the harmonic balance solution process. Hidden SCP parameters are accessible only by using Other=:
- ScpRhsThresh activate SCP if Newton residual smaller than this threshold (default 0.05)
- ScpRestart inner SCP GMRES restart value (default 100)
- ScpTol inner SCP GMRES tolerance (default 0.001)
- ScpStartIter use SCP from this Newton iteration onward (default 0)

Backward Compatibility Exceptions

Beginning with ADS 2006A, the default value for the following parameter does not maintain backwards compatibility with ADS 2004A as shown in the following table. When a project created in 2004A is opened in 2005A or 2006A, this parameter will use the default value specified in 2006A regardless of the value specified in 2004A either by default or by the user.

Parameter Name Setup Dialog Name Default Value
2004A 2005A
2006A
Restart Regenerate Initial Guess for ParamSweep yes no

Theory of Operation

Harmonic balance is a frequency-domain analysis technique for simulating distortion in nonlinear circuits and systems. It is well-suited for simulating analog RF and microwave problems, since these are most naturally handled in the frequency domain. You can analyze power amplifiers, frequency multipliers, mixers, and modulators, under large-signal sinusoidal drive.

Harmonic balance simulation enables the multitone simulation of circuits that exhibit intermodulation frequency conversion. This includes frequency conversion between harmonics. Not only can the circuit itself produce harmonics, but each signal source (stimulus) can also produce harmonics or small-signal sidebands. The stimulus can consist of up to twelve nonharmonically related sources. The total number of frequencies in the system is limited only by such practical considerations as memory, swap space, and simulation speed.

The Simulation Process

The harmonic balance method is iterative. It is based on the assumption that for a given sinusoidal excitation there exists a steady-state solution that can be approximated to satisfactory accuracy by means of a finite Fourier series. Consequently, the circuit node voltages take on a set of amplitudes and phases for all frequency components. The currents flowing from nodes into linear elements, including all distributed elements, are calculated by means of a straightforward frequency-domain linear analysis. Currents from nodes into nonlinear elements are calculated in the time-domain. Generalized Fourier analysis is used to transform from the time-domain to the frequency-domain.

The Harmonic Balance solution is approximated by truncated Fourier series and this method is inherently incapable of representing transient behavior. The time-derivative can be computed exactly with boundary conditions, v(0)=v(t), automatically satisfied for all iterates.

The truncated Fourier approximation + N circuit equations results in a residual function that is minimized.

N x M nonlinear algebraic equations are solved for the Fourier coefficients using Newton's method and the inner linear problem is solved by:

Nonlinear devices (transistors, diodes, etc.) in Harmonic Balance are evaluated (sampled) in the time-domain and converted to frequency-domain via the FFT.

A frequency-domain representation of all currents flowing away from all nodes is available. According to Kirchoff's Current Law (KCL), these currents should sum to zero at all nodes. The probability of obtaining this result on the first iteration is extremely small.

Therefore, an error function is formulated by calculating the sum of currents at all nodes. This error function is a measure of the amount by which KCL is violated and is used to adjust the voltage amplitudes and phases. If the method converges (that is, if the error function is driven to a given small value), then the resulting voltage amplitudes and phases approximate the steady-state solution. The following flow chart presents a visual representation of the process:

Comparing Harmonic Balance and Time Domain Simulators

In the context of high-frequency circuit and system simulation, harmonic balance has a number of advantages over conventional time-domain transient analysis:

Harmonics and Maximum Mixing Order

With multiple sources in a circuit, mixing products will occur. The parameter Maximum mixing order (on the Freq tab) determines how many mixing products are to be included in the simulation. Consider an example with two sources and three harmonics:

Source Frequency Order
Fund 1 5 MHz 3
Fund 2 7 MHz 3

If Maximum mixing order is 0 or 1, no mixing products are simulated. The frequency list consists of the fundamental (Fund) frequency and the first, second, and third harmonics of each source, as follows:

Frequency Combination
0 Hz DC term
5 MHz Fund 1
7 MHz Fund 2
10 MHz Second harmonic of Fund 1
14 MHz Second harmonic of Fund 2
15 MHz Third harmonic of Fund 1
21 MHz Third harmonic of Fund 2

If Maximum mixing order is 2, the sum and difference frequencies of the two fundamentals are added to the list:

Frequency Combination
2 MHz Fund 2 − Fund 1
12 MHz Fund 2 + Fund 1

If Maximum mixing order is 3, the second harmonic of one source can mix with the fundamental of the other. These frequencies are also added to the list:

Frequency Combination
3 MHz Second harmonic of Fund 1 - Fund 2
9 MHz Second harmonic of Fund 2 - Fund 1
17 MHz Second harmonic of Fund 1 + Fund 2
19 MHz Second harmonic of Fund 2 + Fund 1

This pattern is also used when there are three sources. The combined order is the sum of the individual signal orders that are added or subtracted to make up the frequency list.

Consider an example with the following three sources, where Maximum mixing order = 5:

Source Frequency Order
Fund 1 10.00 GHz 5
Fund 2 10.95 GHz 2
Fund 3 11.05 GHz 2

The frequencies that are used in the simulation and the combinations that produce them are listed in the following table.

Frequency List (Maximum mixing order = 5)
Frequency Combination Order
0.000 Hz DC term always present
100.0 MHz Fund 3 - Fund 2 2
200.0 MHz Second harmonic of Fund 3 - Second harmonic of Fund 2 4
850.0 MHz Second harmonic of Fund 2 - Fund 1 - Fund 3 4
950.0 MHz Fund 2 - Fund 1 2
1.050 GHz Fund 3 - Fund 1 2
1.150 GHz Second harmonic of Fund 3 - Fund 1 - Fund 2 4
1.900 GHz Second harmonic of Fund 2 - Second harmonic of Fund 1 4
2.000 GHz Fund 2 + Fund 3 - Second harmonic of Fund 1 4
2.100 GHz Second harmonic of Fund 3 - Second harmonic of Fund 1 4
7.900 GHz Third harmonic of Fund 1 - Second harmonic of Fund 3 5
8.000 GHz Third harmonic of Fund 1 - Fund 2 - Fund 3 5
8.100 GHz Third harmonic of Fund 1 - Second harmonic of Fund 2 5
8.850 GHz Second harmonic of Fund 1 + Fund 2 - Second harmonic of Fund 3 5
8.950 GHz Second harmonic of Fund 3 - Second harmonic of Fund 1 4
9.050 GHz Second harmonic of Fund 2 - Second harmonic of Fund 1 4
9.150 GHz Second harmonic of Fund 1 + Fund 3 - Second harmonic of Fund 2 5
9.800 GHz Fund 1 + Second harmonic of Fund 3 - Second harmonic of Fund 2 5
9.900 GHz Fund 1 + Fund 2 - Fund 3 3
10.00 GHz Fundamental 1
10.10 GHz Fund 1 + Fund 3 - Fund 2 3
10.20 GHz Fund 1 + Second harmonic of Fund 3 - Second harmonic of Fund 2 5
10.85 GHz Second harmonic of Fund 2 - Fund 3 3
10.95 GHz Fundamental 2
11.05 GHz Fundamental 3
11.15 GHz Second harmonic of Fund 3 - Fund 2 3
11.90 GHz Second harmonic of Fund 2 - Fund 1 3
12.00 GHz Fund 2 + Fund 3 - Fund 1 3
12.10 GHz Second harmonic of Fund 3 - Fund 1 3
12.95 GHz Second harmonic of Fund 2 + Fund 3 - Fund 1 4
13.05 GHz Fund 2 + Second harmonic of Fund 3 - Second harmonic of Fund 1 5
18.95 GHz Third harmonic of Fund 1 - Fund 3 4
19.05 GHz Third harmonic of Fund 1 - Fund 2 4
19.90 GHz Second harmonic of Fund 1 + Fund 2 - Fund 3 4
20.00 GHz Second harmonic of Fund 1
20.10 GHz Second harmonic of Fund 1 + Fund 3 - Fund 2 4
20.85 GHz Fund 1 + Second harmonic of Fund 2 - Fund 3 4
20.95 GHz Fund 2 + Fund 1 - 2nd order  
21.05 GHz Fund 3 + Fund 1 - 2nd order  
21.15 GHz Fund 1 + Second harmonic of Fund 3 - Fund 2 4
21.90 GHz Second harmonic of Fund 2
22.00 GHz Fund 2 + Fund 3 - 2nd order  
22.10 GHz Second harmonic of Fund 3
22.95 GHz Fund 3 + Second harmonic of Fund 2 - Fund 1 4
23.05 GHz Fund 2 + Second harmonic of Fund 3 - Fund 1 4
28.95 GHz Fourth harmonic of Fund 1 - Fund 3 5
29.05 GHz Fourth harmonic of Fund 1 - Fund 2 5
29.90 GHz Third harmonic of Fund 1 + Fund 2 - Fund 3 5
30.00 GHz Third harmonic of Fund 1
30.10 GHz Third harmonic of Fund 1 + Fund 3 - Fund 2 5
30.85 GHz Second harmonic of Fund 1 + Second harmonic of Fund 2 - Fund 3 5
30.95 GHz Second harmonic of Fund 1 + Fund 2 3
31.05 GHz Second harmonic of Fund 1 + Fund 3 3
31.15 GHz Second harmonic of Fund 1 + Second harmonic of Fund 3 - Fund 2 5
31.90 GHz Fund 1 + Second harmonic of Fund 2 3
32.00 GHz Fund 1 + Fund 2 + Fund 3 3
32.10 GHz Fund 1 + Second harmonic of Fund 3 3
32.95 GHz Fund 3 + Second harmonic of Fund 2 3
33.05 GHz Fund 2 + Second harmonic of Fund 3 3
34.00 GHz Second harmonic of Fund 2 + Second harmonic of Fund 3 - Fund 1 5
40.00 GHz Fourth harmonic of Fund 1
40.95 GHz Third harmonic of Fund 1 + Fund 2 4
41.05 GHz Third harmonic of Fund 1 + Fund 3 4
41.90 GHz Second harmonic of Fund 1 + Second harmonic of Fund 2 4
42.00 GHz Second harmonic of Fund 1 + Fund 2 + Fund 3 4
42.10 GHz Second harmonic of Fund 1 + Second harmonic of Fund 3 4
42.95 GHz Fund 1 + Second harmonic of Fund 2 + Fund 3 4
43.05 GHz Fund 1 + Fund 2 + Second harmonic of Fund 3 4
44.00 GHz Second harmonic of Fund 2 + Second harmonic of Fund 3 4
50.00 GHz Fifth harmonic of Fund 1
50.95 GHz Fourth harmonic of Fund 1 + Fund 2 5
51.05 GHz Fourth harmonic of Fund 1 + Fund 3 5
51.90 GHz Third harmonic of Fund 1 + Second harmonic of Fund 2 5
52.00 GHz Third harmonic of Fund 1 + Fund 2 + Fund 3 5
52.10 GHz Third harmonic of Fund 1 + Second harmonic of Fund 3 5
52.95 GHz Second harmonic of Fund 1 + Second harmonic of Fund 2 + Fund 3 5
53.05 GHz Second harmonic of Fund 1 + Fund 2 + Second harmonic of Fund 3 5
54.00 GHz Fund 1 + Second harmonic of Fund 2 + Second harmonic of Fund 3 5

Selecting a Solver

Many harmonic balance simulators rely on the Newton-Raphson technique to solve the nonlinear systems of algebraic equations that arise in large-signal frequency-domain circuit simulation problems. Each iteration of Newton-Raphson requires an inversion of the Jacobian matrix associated with the nonlinear system of equations. When the matrix is factored by direct methods, memory requirements climb as O(H 2), where H is the number of harmonics. Thus, the factorization of a Jacobian at H=500 will require 2500 times as much RAM as one at H=10.

An alternate approach to solving the linear system of equations associated with the Jacobian is to use a Krylov subspace iterative method such as GMRES (generalized minimum residual). This method does not require the explicit storage of the Jacobian matrix J, but rather only the ability to carry out matrix-vector products of the form JV, where V is an arbitrary vector. But the information needed to carry out such an operation can be stored in O(H) memory, not in O(H 2), in the context of harmonic balance. Thus, Krylov subspace solvers offer substantial savings in memory requirements for large harmonic-balance problems. Similar arguments show that even larger increases in computational speed can be obtained.

Note
For circuits involving large numbers of frequencies, consider using the Circuit Envelope simulator.

Use the following guidelines when selecting a solver:

In most cases, Auto Select will choose the most effective solver automatically. Choose Direct Solver or Krylov Solver only when the Auto Select option cannot deliver satisfactory performance for a certain circuit.

Simulation time may not be a good indicator for the choice. Some problems are small, but still take a long time to simulate because parameters are being swept over many steps; such a problem should really be viewed as a sequence of small problems, and thus Krylov is not necessarily applicable. When a parameter is swept, if it takes X seconds to compute a single solution using the Krylov solver, it will probably take approximately 10X seconds to compute 10 solutions. On the other hand, if it takes Y seconds to compute a single solution using the direct solver, it will probably take far less than 10Y seconds to compute 10 swept steps of the analysis.

For system-level applications (behavioral mixers, amplifiers, etc.), the Krylov solver should be the preferred method of solution, as it is very robust in this area. For some transistor-level circuits, the Krylov solver may experience convergence difficulties at high input power levels. If this occurs, an analysis using the direct solver or the Envelope simulator should be attempted.

To select a specific solver:

  1. Select the Solver tab in the Harmonic Balance setup dialog box.
  2. Select the desired solver option. In general, we recommend that you accept the defaults and click OK to close the dialog box (or select another tab to set additional simulation specifications, as needed).

For descriptions of the options and parameters associated with the solvers, click Help from the dialog box.

Reusing Simulation Solutions

Harmonic balance simulation solutions can be saved and used later as an initial guess for another simulation, including harmonic balance, large-signal S-parameter, gain compression, or circuit envelope. Reusing solutions can save a considerable amount of simulation time. For example, you can save a harmonic balance solution and perform a nonlinear noise simulation, using this saved solution as the initial guess. Doing so removes the time required to re-compute the nonlinear HB solution. Another instance would be to solve for an initial harmonic balance solution and then sweep a parameter to see the changes.

To save a simulation for reuse:

  1. Add the desired simulation component to your schematic-harmonic balance, large-signal S-parameter, gain compression, or envelope. Double-click to edit it.
  2. Select the Params tab. If using the Envelope controller, select the HB Params tab.
  3. Enable Write Final Solution. Enter a filename and any extension, or use the default which is <project_name>.hbs. The file will be saved in the networks folder of the project.
  4. Click OK. When you run the next simulation, the solution will be saved.

To select a solution file to be used as the initial guess:

  1. Place the simulation component of interest on the schematic if one is not present, then double-click to edit it.
  2. Select the Params tab.
  3. Enable Use Initial Guess. Enter the filename and extension.
  4. To view any messages regarding how the initial guess affects the simulation, add an Options component and set the Annotate parameter. For more information on how to do this, refer to the topic Reusing Simulation Solutions.
Note
Since harmonic balance simulations also use the DC solution, for optimum speed improvement, both the DC solution and the HB solution should be saved and re-used as initial guesses.

The initial guess file does not need to contain all of the harmonic balance frequencies. For example, you could perform a one-tone simulation with a very nonlinear LO, save the solution, and then use it as an initial guess in a two-tone simulation.

The exact frequencies do not have to match between the present analysis and the initial guess solution. However, the fundamental indexes should match. For example, a solution saved from a two-tone analysis with Freq[1] = 1GHz and Freq[2] = 1kHz would not be a good match for a simulation with Freq[1] = 1kHz and Freq[2] = 1 GHz.

Troubleshooting a Simulation

This section presents suggestions to help achieve a successful simulation that is fast and accurate. It includes the following topics:

Also, refer to the troubleshooting sections in DC Simulation and AC Simulation.

Selecting the Number of Harmonics

The number of harmonics needed to simulate a circuit accurately depends on nonlinearities in the circuit, the accuracy desired, and the acceptable simulation time.

Consider the following in choosing or changing the number of harmonics:

To verify that the simulation is accurate, choose a certain number of harmonics and perform the simulation. Then double the number of harmonics and simulate the circuit again.

If the results are the same, the first choice used enough harmonics for an accurate simulation. If the results differ, double the second choice and run the simulation again. Continue this procedure until there is no change (or there is an acceptable change) in the simulation after the number of harmonics is doubled.

Reducing Simulation Time

To reduce simulation time while still maintaining an accurate simulation, consider the following factors in your simulation and make the appropriate trade-offs:

Solving Convergence Problems

Nonconvergence is a numerical problem encountered by the harmonic balance simulator when it cannot reach a solution, within a given tolerance, after a given number of numerical iterations. There is no one specific solution for solving convergence problems. However, consider the following guidelines:

Sweeps as Convergence Tools

Continuation methods provide a sequence of initial guesses that are sufficiently close to the solution to assure Newton's method convergence in Harmonic Balance. Sweeps can be used to formulate a specialized continuation method geared towards the particular circuit problem.

Try sweeping a parameter to correct a convergence problem. Find a circuit element that, when set to some different value, makes the circuit more linear. For instance, in an amplifier circuit there may be a resistor that can be used to lower the amplifier's gain. The simulator may be able to find a solution to the circuit under a low-gain condition. Then, if the component's value is swept toward the desired value, the simulator may be able to find a final solution. Start with a value that works, and stop with the desired value. Also, select Restart, on the Initial Guess tab. Usually, a better initial guess at each step helps the simulator to converge.

The two main ways to perform sweeps are:

Convergence and the Samanskii Steps

The Samanskii constant is a real non-negative number that is used to determine whether the simulator can skip the Jacobian evaluation in some iterations, and just reuse an approximate Jacobian instead (Samanskii steps). The Samanskii steps can significantly speed up the solution process. However, using an approximate Jacobian, particularly for a larger number of iterations, may result in poor or even no convergence. The constant is used in two ways. First, it becomes a more absolute measure when it is smaller. It then approaches the requirement that each iteration reduces the relevant norm by one-third.

Decreasing the Samanskii constant beyond a certain point (which in turn depends on the quality of the most recent Newton step) will make no difference. However, setting the Samanskii constant to zero will effectively disable any Samanskii steps altogether.

Increasing the Samanskii constant relaxes this requirements in general, but the condition becomes more dependent on the quality of the standard most recent Newton iteration. In other words, a more rapid convergence of the Newton step would also require better convergence of the Samanskii steps.

The default Samanskii constant of 2.0 corresponds to the quality of the Newton step such that the norm is reduced by 50% (decreasing the Samanskii constant will not make any difference if this is the case). Such a cut-off value gets larger with a more significant norm reduction of the Newton step. For example, an 83% norm reduction would result in a cut-off value of 10.

Note
To edit this parameter, select the Display tab in the Harmonic Balance Simulation component and set SamanskiiConstant to display on the schematic page. You can then edit the parameter directly on the schematic.

Convergence and Arc-Length Continuation

Arc-length continuation is an extremely robust algorithm. If it fails, try all other convergence remedies first before adjusting arc-length parameters:

Oversampling to Prevent Aliasing

Oversampling increases the accuracy of the solution by reducing the FFT aliasing error, and improves convergence for circuits with many nonlinear devices.

Aliasing error is introduced during the evaluation of nonlinear devices when a time waveform is converted into a spectrum. Aliasing is caused by using too few time-points to represent the time waveform. The Nyquist criterion states that to avoid aliasing errors, the sampling frequency should be at least twice the highest frequency present in the time waveform. If not, error is introduced into the high-frequency Fourier coefficients. The only way to eliminate aliasing error is to increase the sampling rate (that is, to increase the number of data points). This can be done by oversampling the time waveform (select Fundamental Oversample, on the Params tab). The relationship between Order, Fundamental Oversample, and the number of samples for a single tone simulation is given by:

Number of Samples = 2*(Order[1] +1)*Oversample, rounded up to the nearest power of two.

For the same value of Order, different values of Fundamental Oversample can yield the same number of samples. Also, oversampling can occur even with a Fundamental Oversample value of 1, because the system rounds the FFT size up to the next power of two. This can be seen from the following two tables:

Order Fundamental Oversample Number of Samples
7 1 16
7 2 32
7 3 32
7 4 64
7 5 128
7 6 128


Order Fundamental Oversample Number of Samples
8 1 32
8 2 64
8 3 64
8 4 128
8 5 128
8 6 128

In a multitone HB simulation, it is possible to set the oversample for each tone. To do this, click More next to the Fundamental Oversample parameter. The Oversample Options dialog box appears enabling you to enter the Oversample values for each fundamental in the multitone simulation. For a multitone simulation, the number of samples is determined in two parts. First, the same method used for the single tone case applies to the first tone; that is, 2*(Order[1]+1)*Oversample, rounded up to the nearest power of two. Second, for all successive tones (Order[i], i > 1), the number of samples is (2*Order[i]+1)*Oversample, rounded up to the nearest power of two. The final resultant number of samples is the product of the number of samples from each part.

Order[1] Order[2] Fundamental Oversample Number of Samples
3 4 1 128
3 4 2 512
3 4 3 1024
3 4 4 2048
 
7 3 1 128
7 3 2 512
7 3 3 2048
7 3 4 2048

In the case of having different sample values, the same rules apply for determining the total number of samples. The value for Oversample[1] applies only to Order[1], and Oversample[2] applies only to Order[2]. If a value is given for Fundamental Oversample and for Oversample[1], the value of Oversample[1] will be used.

Order[1] Order[2] Oversample[1] Oversample[2] Number of Samples
5 3 1 4 512
5 3 2 3 1024
7 4 3 2 2048
7 4 4 1 1024

While oversampling does not increase the number of harmonics, it does increase the size of the FFT used in HB. This means that the HB simulation run time using the direct solver (which is determined by the Order and the circuit size) is not largely affected when the Fundamental Oversample is increased. However, an HB simulation run time using the Krylov solver will be slower since this solver's computational complexity depends on the size of the FFT.

Note that MaxOrder does not enter any of the calculations for the number of samples.

Linearizing Nonlinear Devices

The number of nonlinear devices in a network has a dramatic effect on the speed of harmonic balance simulation. For circuits with a large number of nonlinear devices, such as those found in RFICs and high-speed digital applications, a standard harmonic balance simulation may become extremely slow, especially for a multitone simulation or where large numbers of harmonics are involved. However, usually only a few devices in such circuits are driven into nonlinearity. Depending upon the application, many devices in the circuit may be operating in their linear region.

A significant increase in the speed of a harmonic balance simulation can be achieved without loss of accuracy if the devices that are operating in the linear region can be identified and linearized about their DC operating point. When these devices are simulated, they are treated as other linear elements and are evaluated in the frequency domain instead of the time domain. The increase in simulation speed is generally proportional to the number of valid device linearizations.

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources