# Oregano User's Guide

2009 Marc Lorber
2003 2004 LUGFi
1999 2001 2002 Richard Hult
LUGFI
Marc Lorber

    Lorber.Marc@wanadoo.fr

Ricardo Markiewicz

    rmarkie@fi.uba.ar

Oregano Manual V 0.1
2009

Marc Lorber

Oregano Manual V 0
2004

Ricardo Markiewicz

Oregano is a tool for schematic capture and simulation of electronic circuits. It simplifes design of simple circuits by letting the user draw the circuit and then simulate its electrical characteristics. This document is mostly meant to be an introduction for someone who already is familiar with circuit simulation and wants to try out Oregano.
&legal;

Feedback

To report a bug or make a suggestion regarding the Oregano application or this manual, follow the directions in the Oregano Feedback Page.

## Introduction to &app;

&app; is a general purpose circuit-editor and simulation tool that provides a variety of features. As you will see, you can switch from the circuit editor to the simulation environment by clicking the icons in the &app; window.

&app; is based on the SPICE simulation program, originates from the EECS Department of the University of California at Berkeley.

For more details regarding SPICE, see .

### &app;: Circuit Editor

&app; provides a variety of services to draw, edit an electrical circuit:

- Pick up a part using the part browser, clicking on the "place" button.

- Draw wires using the wire editor, after clicking on the "Wire Editor" button

- Join parts between each other to feature a circuit.

- Save the drawn circuit as an oregano file.

- Re-open an oregano file to edit or modify it.

&app;: main window

### &app;: Simulation environment

From a schematic drawn under &app; as a circuit editor, it is possible to obtain a file input for SPICE 3. To realize this, you have to select Tools-> Generate Netlist

&app;: Generate Netlist

Concurrently, it is posible to directly run a simulation, using a simulation engine:

- Either ngspice.

- Or gnucap.

To run a simulation, just select the "engine" icon.

&app;: Simulate

The plot, result of the simulation will appear in a new window, beside the circuit window.

&app;: Simulate

## Getting Started with Oregano

When you first start &app;, you will be presented to an empty sheet, where you can place circuit components and connect them with wires.

&app;: main window

To place a component, also known as 'part', first select one in the part browser on the right hand side of the application window. Then press the 'Place' button, or double-click the selected part. You can also drag the part preview and drop it on the sheet.

&app;: main window

When you have some parts placed on the sheet, you can start connecting them with wires. Select the wire tool on the toolbar, and click on the sheet where you want the wire to start. Then click where you want to fixate the wire.

&app;: main window

Caution:

Make sure you connect at least one ground node to the circuit, as this is neccessary to perform a simulation.

&app;: main window

## Editing the Circuit

There are a few accelerator keys that can help editing the circuit:

Ctrl-A

  Select all objects on the sheet

Ctrl-Shift-A

  Deselect all objects

r

  Rotate the selected objects 90 degrees clockwise

<Del>

  Delete the selected objects

l

  Place the currently selected part

Parts and wires can be selected by clicking on them, and by holding the Shift-key while clicking, you can select multiple parts and wires. You can also select objects by 'rubber-banding': hold down the mouse button while dragging the pointer over the objects that you wish to select.

Parts selected will appear "green" on the circuit.

&app;: main window

### Circuit Description

Each circuit can be described into a dedicated "description" window, that can be activated via File->Schematic Properties

&app;: main window

### Print the circuit

The circuit drawn on the main window can be printed. Conversely, you may will observe the printing by a preview before. Therefore select File->Print Preview. This service will use evince and will raise a new window containing the circuit within a title block.

&app;: preview printing

As you probably see, the orientation of the preview is not correct, you may correct the printing parameters, selecting File->Print Properties. A new window will appear providing you with possibilities to:

Select a printer

- Any printer, for portable format

- <The System printer>

- a PDF output

parametrize the Paper size

- A4

- various format supported by the system

define the orientation of the circuit on the printinted page:

- Portrait

- Landscape

- Reverse Portrait

- Reverse Landscape

&app;: page properties window

Select, now, an orientation conformed to "Landscape" and select again the printing preview, you will see the printing preview window with a correct orientation.

&app;: preview printing

### Generate the netlist input for SPICE

It si possible to generate a file "netlist" input for SPICE. For that, select View->Netlist.

The produced "netlist" can be recorded into an iondependant file. Select "Save" in the window (see below).

&app;: preview printing

### Export the circuit as figure

The circuit can be exported to be integrated into an other document. For that, select File->Export....

A new window will appear providing you with possibilities to:

Size the export in pixels

- Width (by default) = 300

- Height (by default) = 300

define the format (according to the formats supported by your system) of the export

- Scalable Vector Graphic (SVG)

- Portable Document Format (PDF)

- Postscript (PS)

- Portable Network Graphic (PNG)

define the colour of the background of the export

- White

- Black

- Transparent

define if the export is in colour or not

- Colour

- Black and White

Finally, you will define the file in which you will record your export.

&app;: preview printing

## Simulation

When you have finalized a circuit, you may wish to run a simulation.

The simulation "run" may be parmetrized, through several menus, that will be detailled within this paragraph, hereunder.

Simulation may be activated:

- either pressing the simulate button on the toolbar

- or select Tools->Simulation.

The simulation then starts and you can follow the progress on the dialog box that pops up.

&app;: main window

### Analyses

This paragraph will go through the analyses that the engine ngspice is able to provide.

#### Noise analysis

The noise analysis does analysis device-generated noise for the given circuit. When provided with an input source and an output port, the analysis calculates the noise contributions of each device (and each noise generator within the device) to the output port voltage. It also calculates the input noise to the circuit, equivalent to the output noise referred to the specified input source. This is done for every frequency point in a specified range - the calculated value of the noise corresponds to the spectral density of the circuit variable viewed as a stationary gaussian stochastic process.

#### Operating point analysis

The operating point analysis determines the dc operating point of the circuit with inductors shorted and capacitors opened.

#### Operating point sweep Analysis

The operating point sweep analysis determines the values of output variables while one or two specified independent voltage or current source is stepped over a user-specified range and the dc output variables are stored for each sequential source value.

#### Pole-zero analysis

The pole-zero analysis computes the poles and/or zeros in the small-signal ac transfer function. The program first computes the dc operating point and then determines the linearized, small-signal models for all the nonlinear devices in the circuit. This circuit is then used to find the poles and zeros of the transfer function.

#### Small-Signal distortion analysis

The distortion analysis computes steady-state harmonic and intermodulation products for small input signal magnitudes. Not all devices are supported.

#### Small Signal frequency response analysis

The ac small-signal 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.

#### Sensitivity analysis

Ngspice will calculate either the DC operating-point sensitivity or the AC small-signal sensitivity of an output variable with respect to all circuit variables, including model parameters. Spice calculates the difference in an output variable (either a node voltage or a branch current) by perturbing each parameter of each device independently.

#### Transfer function analysis

The (small signal) transfer function analysis computes the dc small-signal value of a transfer function (ratio of output variable to input source), input resistance, and output resistance is also computed as a part of the dc solution.

#### Transient analysis

The transient analysis computes the transient output variables as a function of time over a user-specified time interval. The initial conditions are automatically determined by a dc analysis. All sources which are not time dependent (for example, power supplies) are set to their dc value.

### Parameters of the simulation

Your circuit being captured, you may want to run a simulation. For that you have access to 2 simulations engines that you may chosen via Edit-> Preferences.

Then select the simulation engine by ticking the engine name.

&app;: main window

The simulation can be parametrized according to the kind of circuit you may analyse. The selection of parameters of the siumulation is performed through:

- either pressing the "simulation Settings" button on the toolbar (see figure here below)

- or select Edit->Simulation Settings.

&app;: main window

The "simulation settings" window pops up, allowing you to parmetrize the simulation.

&app;: main window

Therefore, you may be able to select the analysis you will run: tick the ticking box you select and the window will open the parameters associated to the analysis.

#### Select the Transient analysis

- You can tick to force the Initial Conditions

- You may choose the Start figure

- You may choose the Stop figure

You may tick if you want to force the stepping figure: the hidden field apperas

- You may choose the Stepping figure

&app;: main window

#### Select the Fourier analysis

&app;: main window

### Advanced Parameters

#### Distorsion Control

This card controls whether SPICE will compute the distortion characteristic of the circuit in a small-signal mode as a part of the ac small-signal sinusoidal steady-state analysis. The analysis is performed assuming that one or two signal frequencies are imposed at the input; let the two frequencies be f1 (the nominal analysis frequency) and f2 (=SKW2*f1). The program then computes the following distortion measures:

- HD2 - the magnitude of the frequency component 2*f1 assuming that f2 is not present.

- HD3 - the magnitude of the frequency component 3*f1 assuming that f2 is not present.

- SIM2 - the magnitude of the frequency component f1 + f2.

- DIM2 - the magnitude of the frequency component f1 - f2.

- DIM3 - the magnitude of the frequency component 2*f1 - f2.

RLOAD is the name of the output load resistor into which all distortion power products are to be computed. INTER is the interval at which the summary printout of the contributions of all nonlinear devices to the total distortion is to be printed. If omitted or set to zero, no summary printout will be made. REFPWR is the reference power level used in computing the distortion products; if omitted, a value of 1 mW (that is, dbm) is used. SKW2 is the ratio of f2 to f1. If omitted, a value of 0.9 is used (i.e., f2 = 0.9*f1). SPW2 is the amplitude of f2. If omitted, a value of 1.0 is assumed.

The distortion measures HD2, HD3, SIM2, DIM2, and DIM3 may also be be printed and/or plotted (see the description of the .PRINT and .PLOT cards).

#### Noise Control

This card controls the noise analysis of the circuit. The noise analysis is performed in conjunction with the ac analysis (see .AC card). OUTV is an output voltage which defines the summing point. INSRC is the name of the independent voltage or current source which is the noise input reference. NUMS is the summary interval. SPICE will compute the equivalent output noise at the specified output as well as the equivalent input noise at the specified input. In addition, the contributions of every noise generator in the circuit will be printed at every NUMS frequency points (the summary interval). If NUMS is zero, no summary printout will be made.

The output noise and the equivalent input noise may also be printed and/or plotted (see the description of the .PRINT and .PLOT cards).

#### Choice of the incrementyal steps figure

TSTEP is the printing or plotting increment for line-printer output. For use with the post-processor, TSTEP is the suggested computing increment. TSTOP is the final time, and TSTART is the initial time. If TSTART is omitted, it is assumed to be zero. The transient analysis always begins at time zero. In the interval , the circuit is analyzed (to reach a steady state), but no outputs are stored. In the interval , the circuit is analyzed and outputs are stored. TMAX is the maximum stepsize that SPICE will use (for default, the program chooses either TSTEP or (TSTOP-TSTART)/50.0, whichever is smaller. TMAX is useful when one wishes to guarantee a computing interval which is smaller than the printer increment, TSTEP.

UIC (use initial conditions) is an optional keyword which indicates that the user does not want SPICE to solve for the quiescent operating point before beginning the transient analysis. If this keyword is specified, SPICE uses the values specified using IC=... on the various elements as the initial transient condition and proceeds with the analysis. If the .IC card has been specified, then the node voltages on the .IC card are used to compute the intitial conditions for the devices. Look at the description on the .IC card for its interpretation when UIC is not specified.

#### Fourier Analysis

# This card controls whether SPICE performs a Fourier analysis as a part of the transient analysis. FREQ is the fundamental frequency, and OV1, ..., are the output variables for which the analysis is desired. The Fourier analysis is performed over the interval , where TSTOP is the final time specified for the transient analysis, and period is one period of the fundamental frequency. The dc component and the first nine components are determined. For maximum accuracy, TMAX (see the .TRAN card) should be set to period/100.0 (or less for very high-Q circuits).

## Howto maintain the oregano libraries

### How to create a new library part?

The libraries are stored in an XML based format, called *.oreglib, and are installed in "prefix"/share/oregano/libraries.

The easiest way to describe how to create a part is to look at one from the default library, the resistor. In each library, there is first a <symbols> tag. This tag contains all the symbols used for the parts in the library. Take a look at the resistor symbol:

       <ogo:symbol>
       	<ogo:name>resistor</ogo:name>
       	<ogo:objects>
       		<ogo:line>(0 10)(10 10)(11 10)(13 6)(16 14)(19 6)(22 14)
       		                (25 6)(28 14)(30 10)(40 10)</ogo:line>
       	</ogo:objects>

       	<ogo:connections>
       		<ogo:connection>(0 10)</ogo:connection>
       		<ogo:connection>(40 10)</ogo:connection>
       	</ogo:connections>
       </ogo:symbol>

It is built with a polyline, where each (x y) pair is a point on the line. So far so good. Now lets take a look at the <parts> section, containing all the parts that are shown in the part browser. The resistor definition looks like this:

        <ogo:part>
        	<ogo:name>Resistor</ogo:name>
        	<ogo:symbol>resistor</ogo:symbol>
        	<ogo:description>Resistor</ogo:description>

        	<ogo:properties>
        		<ogo:property>
        			<ogo:name>Refdes</ogo:name>
        			<ogo:value>R</ogo:value>
        		</ogo:property>
        		<ogo:property>
        			<ogo:name>Res</ogo:name>
        			<ogo:value>1k</ogo:value>
        		</ogo:property>
        		<ogo:property>
        			<ogo:name>Template</ogo:name>
        			<ogo:value>R_@refdes %1 %2 @res</ogo:value>
        		</ogo:property>
        	</ogo:properties>

        	<ogo:labels>
        		<ogo:label>
        			<ogo:name>Reference designator</ogo:name>
        			<ogo:text>@refdes</ogo:text>
        			<ogo:position>(15 0)</ogo:position>
        			<ogo:modify>yes</ogo:modify>
        		</ogo:label>
        		<ogo:label>
        			<ogo:name>Resistance</ogo:name>
        			<ogo:text>@res</ogo:text>
        			<ogo:position>(15 30)</ogo:position>
        			<ogo:modify>yes</ogo:modify>
        		</ogo:label>
        	</ogo:labels>

        </ogo:part>

This is a bit more compilicated than the symbol tag. First we define a name, which is what is shown in the part list in the browser. The description is the string shown below the part in the part preview. This could be a longer and more descriptive string than the name, if needed. The symbol tag assigns the symbol that should be used for this part (this way a symbol can be shared between several parts).

Then we can define properties. Most parts define Refdes, that is the reference designator to use. For a resistor, we use R. Likewise, a capacitor would use C. We also define a property named Res, which is the actual resistance. Finally, we have Template, which is the template to use when generating spice netlists. As you can see, when evaluating these strings, the proporties can be referred to as @<property name>.

he use of label tags are more or less obvious. We can use properties, using the @ character. For example, the label whose text is <ogo:text>@refdes</ogo:text> will display the reference designator.

### How to add a new part model?

If you need to include a spice model for a part, you either add it inline in the library or by including a model file.

For the former, you can do like this example (a diode):

        <ogo:name>Template</ogo:name>
        <ogo:value>D_@refdes %1 %2 M_@refdes \n.model M_@refdes (IS=0.1PA, RS=16 CJO=2PF
        		TT=12N BV=100 IBV=0.1PA)</ogo:value>

This will add the model below each instance of the diode in the netlist.

For more complicated models, you should probably choose the latter method, which is to add a property called Model. If the value of this property is, for instance, PNP, the model file should be called PNP.model. The model file should be placed in "srcdir"/data/models/ and gets installed in "prefix"/share/oregano/models.

Note that we can NOT ship most models that can be found on the internet. Most of these have some kind of restrictive license that keeps them from being used commercially etc. So if anyone creates any models from scratch, I would be very interested in adding them to Oregano. Perhaps we should start a library of free part spice models.

### How to add a new advanced part model?

For parts that do more than just sit and wait for spice to handle them, there might be a need to do some hacking. Examples of this are the parts Ground and Jumper Wire. They all have a property called internal. The netlist generator looks for this property and have special case code to handle them.

If you need to hack in some kind of special behaviour, take a look at netlist.c and search for "internal", and "jumper". This should get you going.

## Spice: circuit simulation program

&app; is based on the SPICE simulation program, originates from the EECS Department of the University of California at Berkeley.

Spice is a general-purpose circuit simulation program for nonlinear DC, nonlinear transient, and linear AC analyses. Circuits may contain resistors, capacitors, inductors, mutual inductors, independent voltage and current sources, four types of dependent sources, lossless and lossy transmission lines (two separate implementations), switches, uniform distributed RC lines, and the five most common semiconductor devices: diodes, BJTs, JFETs, MESFETs, and MOSFETs.

Spice has built-in models for the semiconductor devices, and the user need specify only the pertinent model parameter values. The model for the BJT is based on the integral-charge model of Gummel and Poon; however, if the Gummel-Poon parameters are not specified, the model reduces to the simpler Ebers-Moll model. In either case, charge-storage effects, ohmic resistances, and a current-dependent output conductance may be included. The diode model can be used for either junction diodes or Schottky barrier diodes. The JFET model is based on the FET model of Shichman and Hodges. Six MOSFET models are implemented: MOS1 is described by a square-law I-V characteristic, MOS2 [1] is an analytical model, while MOS3 [1] is a semi-empirical model; MOS6 [2] is a simple analytic model accurate in the short-channel region; MOS4 [3, 4] and MOS5 [5] are the BSIM (Berkeley Short-channel IGFET Model) and BSIM2. MOS2, MOS3, and MOS4 include second-order effects such as channel-length modulation, subthreshold conduction, scattering-limited velocity saturation, small-size effects, and charge-controlled capacitances.

### Types of analyses

#### DC analyses

The DC analysis portion of Spice (.DC) determines the DC operating point of the circuit with inductors shorted and capacitors opened. The DC analysis options are specified on the .DC, .TF, and .OP control lines. A DC analysis is automatically performed prior to a transient analysis to determine the transient initial conditions, and prior to an AC small-signal analysis to determine the linearized, small-signal models for nonlinear devices. If requested, the DC small-signal value of a transfer function (ratio of output variable to input source), input resistance, and output resistance is also computed as a part of the dc solution. The DC analysis can also be used to generate dc transfer curves: a specified independent voltage or current source is stepped over a user-specified range and the DC output variables are stored for each sequential source value.

#### AC Small-Signal Analysis

The AC small-signal portion of Spice (.AC) 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, trans-impedance, 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.

#### Transient analysis

The transient analysis portion of Spice (.TRAN) computes the transient output variables as a function of time over a user-specified time interval. The initial conditions are automatically determined by a DC analysis. All sources which are not time dependent (for example, power supplies) are set to their DC value. The transient time interval is specified on a .TRAN control line.

#### Pole-Zero Analysis

The pole-zero analysis portion of Spice (.PZ) computes the poles and/or zeros in the small-signal AC transfer function. The program first computes the DC operating point and then determines the linearized, small-signal models for all the nonlinear devices in the circuit. This circuit is then used to find the poles and zeros of the transfer function.

Two types of transfer functions are allowed: one of the form (output voltage)/(input voltage) and the other of the form (output voltage)/(input current). These two types of transfer functions cover all the cases and one can find the poles/zeros of functions like input/output impedance and voltage gain. The input and output ports are specified as two pairs of nodes.

The pole-zero analysis works with resistors, capacitors, inductors, linear-controlled sources, independent sources, BJTs, MOSFETs, JFETs and diodes. Transmission lines are not supported.

The method used in the analysis is a sub-optimal numerical search. For large circuits it may take a considerable time or fail to find all poles and zeros. For some circuits, the method becomes "lost" and finds an excessive number of poles or zeros.

#### Small-Signal Distortion Analysis

The distortion analysis portion of Spice (.DISTO) computes steady-state harmonic and intermodulation products for small input signal magnitudes. If signals of a single frequency are specified as the input to the circuit, the complex values of the second and third harmonics are determined at every point in the circuit. If there are signals of two frequencies input to the circuit, the analysis finds out the complex values of the circuit variables at the sum and difference of the input frequencies, and at the difference of the smaller frequency from the second harmonic of the larger frequency.

Distortion analysis is supported for the following nonlinear devices: diodes (DIO), BJT, JFET, MOSFETs (levels 1, 2, 3, 4/BSIM1, 5/BSIM2, and 6) and MESFETS. All linear devices are automatically supported by distortion analysis. If there are switches present in the circuit, the analysis continues to be accurate provided the switches do not change state under the small excitations used for distortion calculations.

#### Sensitivity Analysis

Spice will calculate (.SENS) either the DC operating-point sensitivity or the AC small-signal sensitivity of an output variable with respect to all circuit variables, including model parameters. Spice calculates the difference in an output variable (either a node voltage or a branch current) by perturbing each parameter of each device independently. Since the method is a numerical approximation, the results may demonstrate second order affects in highly sensitive parameters, or may fail to show very low but non-zero sensitivity. Further, since each variable is perturb by a small fraction of its value, zero-valued parameters are not analyized (this has the benefit of reducing what is usually a very large amount of data).

#### Noise Analysis

The noise analysis portion of Spice (.NOISE) does analysis device-generated noise for the given circuit. When provided with an input source and an output port, the analysis calculates the noise contributions of each device (and each noise generator within the device) to the output port voltage. It also calculates the input noise to the circuit, equivalent to the output noise referred to the specified input source. This is done for every frequency point in a specified range - the calculated value of the noise corresponds to the spectral density of the circuit variable viewed as a stationary gaussian stochastic process.

After calculating the spectral densities, noise analysis integrates these values over the specified frequency range to arrive at the total noise voltage/current (over this frequency range). This calculated value corresponds to the variance of the circuit variable viewed as a stationary gaussian process.

### Analyses at different temperatures

All input data for Spice is assumed to have been measured at a nominal temperature of 27°C, which can be changed by use of the TNOM parameter on the .OPTIONS control line. This value can further be overridden for any device which models temperature effects by specifying the TNOM parameter on the model itself. The circuit simulation is performed at a temperature of 27°C, unless overridden by a TEMP parameter on the .OPTIONS control line. Individual instances may further override the circuit temperature through the specification of a TEMP parameter on the instance.

Temperature appears explicitly in the exponential terms of the BJT and diode model paras. In addition, saturation currents have a built-in temperature dependence. The temperature dependence of the saturation current in the BJT models is determined by:

IS(T1) = IS(T0)*(T1 XTI/T0)*exp(q*EG*(T1*T0)/(k*T1-T0))

where k is Boltzmann's constant, q is the electronic charge, Eg is the energy gap which is a model parameter, and XTI is the saturation current temperature exponent (also a model parameter, and usually equal to 3).

The temperature dependence of forward and reverse beta is according to the formula:

B(T1) = B(T0)* T1 XTB/T0

                                  XTI
                              |T |        | E q(T  T )|
                                1            g   1  0
              I (T ) = I (T ) |--|     exp|-----------|
               S  1     S  0
                              |T |        |k (T  - T )|
                                0              1    0

where T1 and T0 are in kelvin, and XTB is a user-supplied model parameter. Temperature effects on beta are carried out by appropriate adjustment to the values of BF, ISE, BR , and ISC (Spice model parameters BF, ISE, BR, and ISC, respectively).

Temperature dependence of the saturation current in the junction diode model is determined by:

IS(T1) = IS(T0)*(T1 XTI/T0) *exp(q*EG*(T1*T0)/(k*T1-T0))

                                          XTB
                                      |T |
                                        1
                        B(T ) = B(T ) |--|
                           1       0
                                      |T |
                                        0

where N is the emission coefficient, which is a model parameter, and the other symbols have the same meaning as above. Note that for Schottky barrier diodes, the value of the saturation current temperature exponent, XTI, is usually 2.

Temperature appears explicitly in the value of junction potential, U (in Spice PHI), for all the device models. The temperature dependence is determined by:

                                 XTI
                                 ---
                                  N
                             |T |        |  E q(T  T ) |
                               1             g   1  0
             I (T ) = I (T ) |--|     exp|-------------|
              S  1     S  0
                             |T |        |N k (T  - T )|
                               0                1    0

where k is Boltzmann's constant, q is the electronic charge, Na is the acceptor impurity density, Nd is the donor impurity density, Ni is the intrinsic carrier concentration, and Eg is the energy gap.

Temperature appears explicitly in the value of surface mobility, M0 (or UO), for the MOSFET model. The temperature dependence is determined by:

R(T) = R(T0) [1 + TC1 (T - T0 ) + TC2 (T - T0)2]

                                       | N N   |
                                          a d
                              kT       |------ |
                       U(T) = --  log        2
                               q     e |N (T)  |
                                         i

The effects of temperature on resistors is modeled by the formula:

IS(T1) = IS(T0)*(T1 XTI/T0) *exp(q*EG*(T1*T0)/(k*T1-T0))

                                    M (T )
                                     0  0
                           M (T) = -------
                            0          1.5
                                   | T|
                                   |--|
                                   |T |
                                     0

where T is the circuit temperature, T0 is the nominal temperature, and TC1 and TC2 are the first- and second-order temperature coefficients.

### Convergence

Both DC and transient solutions are obtained by an iterative process which is terminated when both of the following conditions hold:

1. The nonlinear branch currents converge to within a tolerance of 0.1% or 1 picoamp (1.0-12A), whichever is larger.

2. The node voltages converge to within a tolerance of 0.1% or 1 microvolt (1.0-6V), whichever is larger.

Although the algorithm used in Spice has been found to be very reliable, in some cases it fails to converge to a solution. When this failure occurs, the program terminates the job.

Failure to converge in dc analysis is usually due to an error in specifying circuit connections, element values, or model parameter values. Regenerative switching circuits or circuits with positive feedback probably will not converge in the dc analysis unless the OFF option is used for some of the devices in the feedback path, or the .NODESET control line is used to force the circuit to converge to the desired state.

### Input Format

The input format for SPICE is of the free format type. Fields on a card are separated by one or more blanks, a comma, an equal (=) sign, or a left or right parenthesis; extra spaces are ignored. A card may be continued by entering a ; (semicolon) as the last character of the card; SPICE continues reading the command on the next card.

A name field must begin with a letter (A through Z) and cannot contain any delimiters. Only the first eight characters of the name are used.

A number field may be an integer field (12, -44), a floating point field (3.14159), either an integer or floating point number followed by an integer exponent (10-14, 2.65*1033), or either an integer or a floating point number followed by one of the following scale factors:

T=1012 G=109 MEG=106 K=103 MIL=25.4*10-6 M=10-3 U=10-6 N=10-9 P=10-12 F=10-15

Letters immediately following a number that are not scale factors are ignored, and letters immediately following a scale factor are ignored. Hence, 10, 10V, 10VOLTS, and 10HZ all represent the same number, and M, MA, MSEC, and MMHOS all represent the same scale factor. Note that 1000, 1000.0, 1000 Hz, 103, 1.0 * 103, 1 KHz, and 1 K all represent the same number.