Next: , Previous: Elementary Devices, Up: Elementary Devices


8.2.1 Resistors

General form:

       RXXXXXXX n+ n- value <ac=val> <m=val> <scale=val> <temp=val>
       +        <dtemp=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 modelling of semiconductor effects.

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

Hint: 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 (not Pole-Zero nor noise). If you do not specify the ac parameter, it is defaulted to value.

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

       RE1 1 2 700 std dtemp=5
     
       .MODEL std tc1=0.001

Instance temperature is useful even if resistance does not varies 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 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 keyword and assigning zero to it, as in the following example:

       Rmd 134 57 1.5k noisy=0

Ngspice calculates the nominal resistance as described below:

                             Rnom = value * scale / m
     			Racnom = ac * scale / m

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