Resistors

General form:

RXXXXXXX n+ n- <resistance|r=>value <ac=val> <m=val>
+ <scale=val> <temp=val> <dtemp=val> <tc1=val> <tc2=val>
+ <noisy=0|1>

Examples:

R1 1 2 100
RC1 12 17 1K
R2 5 7 1K ac=2K
RL 1 4 2K m=2

Ngspice has a fairly complex model for resistors. It can simulate both discrete and semiconductor resistors. Semiconductor resistors in ngspice means: resistors described by geometrical parameters. So, do not expect detailed modeling of semiconductor effects.

n+ and n- are the two element nodes, value is the resistance (in ohms) and may be positive or negative

1

A negative resistor modeling an active element can cause convergence problems, please avoid it.

but not zero.

Simulating small valued resistors: If you need to simulate very small resistors (0.001 Ohm or less), you should use CCVS (transresistance), it is less efficient but improves overall numerical accuracy. Think about that a small resistance is a large conductance.

Ngspice can assign a resistor instance a different value for AC analysis, specified using the ac keyword. This value must not be zero as described above. The AC resistance is used in AC analysis only (neither Pole-Zero nor Noise). If you do not specify the ac parameter, it is defaulted to value.

Ngspice calculates the nominal resistance as

[\begin{array}{ll} \begin{array}{ll} {R_{nom} =} & \frac{{\lbrack font\ rm\ \lbrack char\ V\ mathalpha\rbrack\lbrack char\ A\ mathalpha\rbrack\lbrack char\ L\ mathalpha\rbrack\lbrack char\ U\ mathalpha\rbrack\lbrack char\ E\ mathalpha\rbrack\rbrack}{\lbrack font\ rm\ \lbrack char\ s\ mathalpha\rbrack\lbrack char\ c\ mathalpha\rbrack\lbrack char\ a\ mathalpha\rbrack\lbrack char\ l\ mathalpha\rbrack\lbrack char\ e\ mathalpha\rbrack\rbrack}}{m} \ & \ {R_{acnom} =} & {\frac{{\lbrack font\ rm\ \lbrack char\ a\ mathalpha\rbrack\lbrack char\ c\ mathalpha\rbrack\rbrack}{\lbrack font\ rm\ \lbrack char\ s\ mathalpha\rbrack\lbrack char\ c\ mathalpha\rbrack\lbrack char\ a\ mathalpha\rbrack\lbrack char\ l\ mathalpha\rbrack\lbrack char\ e\ mathalpha\rbrack\rbrack}}{m}.} \ \end{array} & \ \end{array}]

If you want to simulate temperature dependence of a resistor, you need to specify its temperature coefficients, using a .model line or as instance parameters, like in the examples below:

Examples:

RE1 1 2 800 newres dtemp=5
.MODEL newres R tc1=0.001

RE2 a b 1.4k tc1=2m tc2=1.4u

RE3 n1 n2 1Meg tce=700m

The temperature coefficients tc1 and tc2 describe a quadratic temperature dependence (see equation 6) of the resistance. If given in the instance line (the R... line) their values will override the tc1 and tc2 of the .model line (3.2.3). Ngspice has an additional temperature model equation 12 parametrized by tce given in model or instance line. If all parameters are given (quadratic and exponential) the exponential temperature model is chosen.

[\begin{array}{ll} {R\left( T \right) = R\left( T_{0} \right)\left\lbrack {1.01^{TCE \cdot ({T - T_{0}})}} \right\rbrack} & \ \end{array}]

where (T) is the circuit temperature, (T_{0}) is the nominal temperature, and (TCE) is the exponential temperature coefficients.

Instance temperature is useful even if resistance does not vary with it, since the thermal noise generated by a resistor depends on its absolute temperature. Resistors in ngspice generates two different noises: thermal and flicker. While thermal noise is always generated in the resistor, to add a flicker noise

2

Flicker noise can be used to model carbon resistors.

source you have to add a .model card defining the flicker noise parameters. It is possible to simulate resistors that do not generate any kind of noise using the noisy (or noise) keyword and assigning zero to it, as in the following example:

Example:

Rmd 134 57 1.5k noisy=0 

If you are interested in temperature effects or noise equations, read the next section on semiconductor resistors.