Third-party Models
This section explains the basics to adding a third-party model to LTspice.
Basically there are two types of third party SPICE models, those described with a .MODEL statement and those defined with a .SUBCKT.
Models given as .MODEL statements are for intrinsic SPICE devices like diodes and transistors. The .MODEL statement gives the parameters for the specific component. The behavior of the device is already known by SPICE, only the parameters need to be given to finish specifying the component's electrical characteristics.
On the other hand, models given by .SUBCKT statements define the modeled component by a collection of circuitry of intrinsic SPICE devices. For example, the SPICE model of an opamp would be given as a subcircuit.
The way how to include the model in LTspice depends on whether the model is given as a .MODEL statement or a .SUBCKT.
Example for an NPN transistor defined with a .MODEL statement:
- Add an instance of the symbol NPN to your schematic.
- Edit the value "NPN" to be "BC547C" to coincide with the name used in the target .MODEL statement.
- Now either
- Add the .MODEL BC547C... statement as a SPICE directive on your schematic.
Or - If you have a file bipol.lib containing your .MODEL BC547C... (other models may also be in this file), then add the SPICE directive ".INCLUDE bipol.lib" on your schematic. Note that "bipol.lib" must be the complete name with any file extensions and that Windows Explorer defaults to not showing the file extension. So you if you have a file called "bipol.lib.txt", which you can edit/view in notepad, and Windows Explorer shows you the file exits as "bipol.lib" The SPICE directive to include this file is ".inc bipol.lib.txt" If you used, ".inc bipol.lib" you will get an error message that that file can't be found.
Or - Create a text file user.bjt in the directory Documents/LTspice/ (by default; configurable in Settings > Sym and Lib Search Paths) and add the .MODEL BC547C... statement to this file. Models added to user.bjt will appear in the list of choices when editing the NPN transistor. The directory where user.bjt is located can be confiugred in Settings > Sym & Lib Search Paths. Do not edit %LOCALAPPDATA%\LTspice\lib\cmp\standard.* - these files is overwritten when LTspice is updated.
- Add the .MODEL BC547C... statement as a SPICE directive on your schematic.
Example for a 5-pin opamp. This will be defined with a .SUBCKT statement:
- Add an instance of symbol opamp2 to your schematic.
- Edit the value "opamp2" to "TL072" on the schematic to coincide with the name of the .SUBCKT.
- Either
- Paste the ".SUBCKT TL072 ..... .ENDS" definition as one multi-line SPICE directive to your schematic.
Or - If you have a file called "TI.lib" containing the definition of subcircuit TL072(It will look like a line that starts out as ".SUBCKT TL072...") add the SPICE directive ".INCLUDE TI.lib" to the schematic.
- Paste the ".SUBCKT TL072 ..... .ENDS" definition as one multi-line SPICE directive to your schematic.
It is possible to create a new symbol and program it to automatically include the necessary model for the simulation whenever it is used on a schematic. See help section Schematic Capture > Creating New Symbols.
It is possible to create an automatically generated symbol that netlists correctly against an arbitrary third party model and have it programmed so that it includes the necessary model for the simulation whenever it appears on a schematic. See help section Schematic Capture > Creating New Symbols. For most users, this is the only method you should consider for adding new models defined as subcircuits since all the details are handled for you.
Example for a 3-pin NPN transistor but defined with a .SUBCKT statement:
- Add an instance of symbol NPN to your schematic.
- Move the cursor over the body of the newly-placed NPN symbol instance. Press <Ctrl>RightMouseButton. A dialog box will appear. Change Prefix: QN to Prefix: X. This causes this instance of the symbol to netlist as a subcircuit instead of an intrinsic bipolar transistor.
- Edit the value "NPN" to be "BFG135" to coincide with the name given on the .SUBCKT line.
- Then either
- Add the .SUBCKT BFG135 lines to your schematic.
Or - If you have a file Phil.lib containing your .SUBCKT BFG135 .... (others may also be in this file) then you have to add a SPICE directive .INCLUDE Phil.lib
- Add the .SUBCKT BFG135 lines to your schematic.
One aspect of adding a .SUBCKT model to LTspice is that you need have the symbol used to call the subcircuit and the model agree on the same pin/port netlist order. The above examples assume the 3rd party model you're adding follows popular pin order conventions.
Further related information is in the help sections Schematic Capture and LTspice. The basic idea is that the schematic capture program generates a netlist that the simulator reads. Any aspect of importing 3rd party models can be resolved by understanding SPICE netlist syntax and how the schematic capture program generates that syntax.
Copyright © 1998–2025 by Analog Devices Inc. All Rights Reserved.