Spectrum Software
spacer
Industrial Strength Simulation
select:

divider

 

News:

Effective 7/4/2019, Spectrum Software is closed. Micro-Cap is now free.

Technical support will be available for at least 90 days via email at Support.

You can download the latest versions of Micro-Cap here: Download
You can choose either the executable program or the entire installation CD for MC10, MC11, and MC12. If you have an earlier version, download and use MC12. These new versions do not require the security key, so they make Micro-Cap free to the entire engineering community.

Thank you for the honor and privilege of serving you for the last 39 years.

Spectrum Software

 

divider

 

Using Array Variables

 

Array variables are real or complex symbolic variables accessed by an index variable which selects an element of the array. Here is the syntax for one dimensional arrays.

.ARRAY arrayname V1[,V2 [,V3...[,Vn]]...]

Note that there must be at least one element (V1) in the array and that a one-dimensional array of size N+1 has values located at 0, 1, 2, ...N.

You can define a one-dimensional array of real values like this:

.ARRAY CV 1n, 3n, 6n

To access the values you use an index variable that typically is created like this:

.DEFINE M 1

The index name may be any non-reserved name. You access the array contents like this:

CV(M)

For example, you could set the CAPACITANCE attribute of a capacitor to CV(M) and then the capacitor value takes on the CV array element that M is set to. If M is set with the .define statement to 1, then the capacitor value would be 3n.

If M is stepped through the values 0, 1, and 2, the capacitor value would take on the values 1n, 3n, and 6n respectively.

To illustrate how array variables can be used, we'll use this example.

Array circuit

Here we have a circuit that uses several array variables to capture the beta values for two different transistors. The devices that use model N1 specify the forward beta as

BF=BETA_N1(M)

The devices that use model N2 specify the forward beta as

BF=BETA_N2(M)

So if M takes on the values 0, 1, and 2, the BF values will take on these values.

M N1 N2

0 300 60

1 250 70

2 200 90

In this way you can use the M variable to select unique sets of BF values for the two types of bipolar transistors. These sets may represent worst case, or merely interesting, combinations of parameters.

Typically the index variable is stepped so that one run can show the effects of the BF combinations.

Here is the Stepping dialog box for transient analysis. Its settings step M from 0 through 4 accessing all of the defined array values.

Array circuit stepping dialog box

Here is the transient run.

Transient analyis of array circuit

You can label the branches using the Scope Menu / Label Branches option. The Automatic option usually works well but you can override it and specify where to place the labels by picking the X-axis location where there is a nice separation between the curves.

Here is the run with the branches labelled. Note that you must select the Label Branches option for each plot group in turn.

Transient analyis of array circuit

Here is the AC analysis run using the same Stepping dialog box settings as used in transient analysis.

AC analyis of array circuit

And here is the DC analysis run, again using the same Stepping dialog box settings as used in transient analysis.

DC analyis of array circuit

Array variables are powerful devices to specify complex simulation and stepping settings.

 
Download Summer 2012 Circuit Files
Return to the main Newsletter page