LTspice - DC Analysis

Article:  Andy Collinson
Email :

Please Note: All the information presented here is my own work and not from Linear Technology. This advice does not replace the information given by Linear Technology, the LTWiki or the Yahoo LTspice User group. Please also read my sites general disclaimer.

DC Analysis
Drawing the schematic
Start LTspice and select New Schematic from the File Menu. Components can be selected in two ways. Either from the edit menu, or by pressing F2. The F2 key will give access to all the components in LTspice, frequently used parts like the resistor,capacitor, inductor and ground symbol can be selected from the top menu line.

General Navigation
Also shown on the edit menu are general navigation keys. For example, key F3 draws a wire, F4 allows you to label a net, F5 will delete a wire or symbol, F6 copies a component and F7 allows you to move a component. To perform the same action on a group of components, first select the action e.g. F5 for delete, then hold down the left mouse button and drag a rectangle around the components to be edited. Once mouse button is released, the action will be performed. If you make a mistake, F9 will undo previous action.

After selecting a component, you have the option to place another of the same type press Escape to cancel this. Components can be moved around by pressing F7. Wires are drawn by pressing F3 or from the edit menu.

Other components are found in the main component menu, by pressing F2, or the icon on the menu bar as shown above. Use the scroll bar and then click on voltage generator as shown above. The triangle symbol is the ground symbol or 0 Volt line in the circuit. Every schematic needs a ground as a reference and it is always labelled as node 0.

Edit Component Values

After re-arranging components, press F7 and move the component, F5 deletes a wire or component and F3 draws a wire. the simple series circuit is drawn, as above. To edit the value of a component right click its symbol and enter a new resistance value. The designation can also be changed with a right click, e.g. right click over R1 to change the designation.

Operating Point Analysis
An operating point analysis (.op) will provide a DC analysis of the circuit and results will appear in a dialog box. There are two ways to add the .op analysis to your circuit; from the simulation menu or by pressing "t" on the keyboard. If you press "t", then change the radio button to SPICE directive and add the text .op as shown below.

Running the Simulation
To run the simulation click on the running man icon or press the appropriate hotkey if you remapped this function. The DC operating point is calculated with all capacitances open circuited and all inductances short circuited. The results will appear in a dialog box, as shown below:

Conventional Current
You may be surprised to see that the current from the power supply has a negative value. This is because LTspice assumes conventional current flows from positive to negative terminal; but actual electron flow is from negative to positive terminal. This is why the minus "-" sign is used.

Ltspice Netlist
Every circuit contains a netlist. The netlist is an ASCII text file describing the circuit. The first line is always the title, and the other lines will contain node numbers and circuit descriptors for each component. The netlist can be displayed from the View Menu, SPICE netlist. The netlist for the simple dc circuit is shown below:

* Z:\media\share\electronics\ltspice\basic_dc.asc
R1 N002 0 15k
R2 N001 N002 5k
V1 N001 0 20V
.op
.backanno
.end

The title line includes the PATH to where the circuit was loaded from, ending with the file name, basic_dc.asc Lines 2 and 3 contain resistor statements and line 4 is the voltage source V1. The ground terminal is always node 0 in any circuit. The next line contains the simulation command, followed by some options, the final line is an .end statement. More about spice netlists can be found in the Spice Primer article.

Displaying Node Numbers in the Status Bar
After an .op simulation has been run, when you move your mouse cursor over a wire, the voltage at that node will appear on the status bar. This is shown on the screenshot below. If you move your mouse pointer over a component the current and power dissipated in that component will also be displayed. For example, hovering over R1 will show the current is 1mA and power dissipation in R2 is 15mW.

Spice error Log
After each simulation, or if something went wrong a spice error log is created. This is available from the view menu or by shortcut keys Ctrl+L.

Operating Point Data Labels
Each connection in a circuit is given a node number. Sometimes it is useful to display the numeric dc value of a node. To label a node, after the simulation has run, double click the desired wire segment as shown below, the operating point voltage of the node will be displayed:

Voltage and Current Labeling
By default the voltage of a node will be displayed. However you can display current through the node or use a numeric expression. Right click over the current label and you will see a screen like below:


The default expression is the dollar character, "$" which will display voltage at that node. However, the expression may be edited to any equation, including currents, powers or even the voltage of a specific node. Once placed, these data labels may be moved or copied to other nodes in the circuit.
To display, say current through R1, delete the $ and click on the I(R1) as shown above. Click on OK and current through R1 will be displayed. You can even double click the vertical wire segment, which will show voltage of the node. The screenshot below shows the modified circuit, now displaying both voltage and current at node 2.

Decimal Values
So far, the example has been simple and answers produced have been integers. Now consider the circuit below: a fraction, then you could enter an expression to limit the amount of digits. For example:
round($*1k)/1k ; display no more than 3 digits (typically automatically expressed in engineering format). round(I(R1)*1k)/1k ; same display format as above, but expression is of the current through R1. round(V(1,2)*1k)/1k ; same format, but expression is of the voltage difference between nodes 1 & 2. DC sweep
parameter sweep max power
voltage sweep with diode

This and other useful information about LTspice is available at the LTwiki web site: http://www.ltwiki.org

Operating Point Data

http://ltwiki.org/index.php5?title=Undocumented_LTspice#Operating_Point_Data_Lab\ els_.28visible_numeric_dc_bias_values.29