Spectrum Software
spacer
Industrial Strength Simulation
select:

divider

 

News:

Spectrum Software has released Micro-Cap 11, the eleventh generation of our SPICE circuit simulator.

For users of previous Micro-Cap versions, check out the new features available in the latest version. For those of you who are new to Micro-Cap, take our features tour to see what Micro-Cap has to offer.

 

divider

 

Using Symbolic Variables

 

Micro-Cap provides a way of creating symbolic variables that can be very useful. In particular it lets you step and vary parameters in Monte Carlo that would otherwise be impossible.

A good example is the SPICE V (and I) source. Let's say you want to build a pulse source and vary its parameters. The SPICE V source does not use a MODEL statement so its parameters cannot be stepped directly. But there is another way. Here is how you use symbolic variables to do it.

To simplify the process, consider the following test circuit.
V source with stepped parameters


The circuit contains a SPICE V source, where the parameters, usually defined with numbers, are defined in term of the symbolic variables, TD, TR, TF, PW, and PERIOD. These symbolic variables are declared and given nominal values using DEFINE statements. These are pieces of text located in the text or schematic area of a circuit. Since Micro-Cap can step symbolic parameters, defining the V source parameters in terms of symbolic parameters means we can now step the key parameters of the SPICE V (and I) source. To step these parameters, run transient analysis, invoke the Stepping dialog box with F11 and make the following selections:

Stepping dialog box options to step the TF parameter

Click OK and press F2 to start the run. This is what you will see.

Stepping the fall time (TF) parameter
Here we have stepped the source's fall time by stepping the TF parameter from 0 to 200ns in steps of 50ns. The plot shows five branches, one for 0ns, 50ns, 100ns, 150ns, and 200ns. In each case the other pulse parameters are constant at their (symbolically) defined values.

As another example let's step the pulse width. To do so we step the PW parameter by setting up the stepping options like this:

Stepping dialog box options to step the PW parameter
The results are shown below.

Stepping the pulse width (PW) parameter
Suppose you wanted to step two parameters together so that the two were always related to one another. For example, suppose you wanted the fall time to always be double the rise time. Here is one way to do that.

Linking symbolic parameters
Here we have defined the rise time parameter as TR and the fall time parameter as TF. TR is then defined as 100ns and TR as 2*TR. The rise time can be changed by editing the DEFINE statement, by stepping, or by Monte Carlo. The fall time will always be twice the rise time regardless of how the rise time is changed.

Stepping dialog box options to step the TR and related TF
Here is how the plot looks for a run time of 1us. Note that while we only stepped TR, both TR and TF varied because TF was defined in terms of TR.

Stepping two related symbolic parameters
Suppose we wanted to vary all of the parameters except the period in a Monte Carlo analysis. How can we do that? The figure below shows how.

Here we have added tolerance values to each of the symbolic parameters except the period parameter, PERIOD.

Monte Carlo Setup
To add a lot tolerance you simply add the term {LOT=10%} before the symbolic variable name. Here is the result of these tolerances in a Monte Carlo run. There are more options that you can read about on page 234 of the Micro-Cap 7 Reference Manual.

Monte Carlo Plot
Here is a Monte Carlo histogram of the pulse width distribution for these runs.


Monte Carlo Histogram
Symbolic parameters give you great flexibility in stepping and Monte Carlo. The same techniques used here in the parameters of simple sources can also be employed in other more complex parts such bipolar transistors and MOSFETS. These parts may employ expressions for their model parameter values. For example, you might typically specify the VTO of a MOSFET this way.

.MODEL 2N6661 NMOS ( VTO= 1.6 )

But you could also use an expression for VTO like this:

.MODEL 2N6661 NMOS (VTO= {1.6-TCX*TEMP} )

Where TCX would be a symbolic parameter perhaps defined as follows:

.DEFINE TCX 0.25

TEMP is a global variable for the run's operating temperature.

Expressions like this must always be run-invariant expressions. That is, they must use only parameters that are known at the start of the run and do not vary during the run. This means primarily 1) symbolic variables and 2) static parameters like TEMP (operating temperature) and TMAX (Maximum Run Time) that are know at the start of the run and do not vary during the run.

The reason for this restriction is that expressions that vary during the run would have to be recomputed at every time point. This would be a horrendous burden to do for MOSFETS, for example, which can have hundreds of model parameters.

 
Return to the main Newsletter page