next up previous contents index
Next: .dc Line Up: Analysis Specification Previous: Analysis Specification   Contents   Index

.ac Line

The ac small-signal portion of WRspice computes the ac output variables as a function of frequency. The program first computes the dc operating point of the circuit and determines linearized, small-signal models for all of the nonlinear devices in the circuit. The resultant linear circuit is then analyzed over a user-specified range of frequencies. The desired output of an ac small-signal analysis is usually a transfer function (voltage gain, transimpedance, etc). If the circuit has only one ac input, it is convenient to set that input to unity and zero phase, so that output variables have the same value as the transfer function of the output variable with respect to the input.

General Form:
.ac dec|oct|lin np fstart fstop [dc dc_args]
.ac dec 10 1 10k
.ac dec 10 1k 100meg
.ac lin 100 1 100hz dc vcc 10 15 5
.ac dec 10 1meg 1g dc vdd 5 7.7 .25

The keyword dec specifies decade variation, with np the number of points per decade. The keyword oct specifies octave variation, with np the number of points per octave, and lin specifies linear variation, with np the number of points. The two parameters fstart (the starting frequency), and fstop (the final frequency) complete the basic analysis specification. If this line is included in the circuit file, WRspice will perform an ac analysis of the circuit over the specified frequency range. Note that in order for this analysis to be meaningful, at least one voltage or current source must have been specified with an ac value.

There is a subtlety when using dec with fstop/fstart less than 10. WRspice will adjust the frequency delta to hit the final value, if the frequency ratio is integral. This is very appropriate when fstop/fstart is a power of two and np is 10. The table shows the frequency multiplication factors without and with correction. Without correction, the frequency multiplier is the tenth root of 10. The corrected multiplier is the ninth root of 8. With correction, the binary powers are hit exactly.

Uncorrected Binary Correction
1.000000 1.000000
1.258925 1.259921
1.584893 1.587401
1.995262 2.000000
2.511886 2.519842
3.162278 3.174802
3.981072 4.000000
5.011872 5.039684
6.309573 6.349604
7.943282 8.000000
10.000000 10.079368

The optional dc sweep is a dc analysis specification which will cause the ac analysis to be performed at each point of the dc sweep. The small-signal parameters are reevaluated at every sweep point, and the output vectors will be multidimensional.

In interactive mode, the ac command, which takes the same arguments as the .ac line, can be used to initiate ac analysis.

AC analysis is not available if Josephson junctions are included in the circuit.

next up previous contents index
Next: .dc Line Up: Analysis Specification Previous: Analysis Specification   Contents   Index
Stephen R. Whiteley 2017-02-22