This may not be the ideal forum for the question; please migrate if a forum is better suited for the question.

I'm looking at a component for which my attempts at locating a SPICE model online were fruitless. There are, however, datasheets of the component available for online reference. The SPICE model for a component probably draws upon the content of the datasheet for it...

So, how does one construct a SPICE model when the data-sheet is available for reference? I'm looking at LTSpice

  • 1
    \$\begingroup\$ Can you narrow it down a bit? What sort of component are we talking about? \$\endgroup\$
    – Dave Tweed
    Sep 27 '12 at 3:20
  • 2
    \$\begingroup\$ Well, I'm looking at the 2SJ50 at the moment. But I meant this question to address a broader array of components from resistors, condensors, diodes, through BJT/FET atleast. \$\endgroup\$
    – Everyone
    Sep 27 '12 at 9:13
  • 2
    \$\begingroup\$ I have the same problem as you do. These links helped me - h-renrew.de/h/spicelib/doc/index.html github.com/werner2101/spicelib \$\endgroup\$ Feb 2 '14 at 12:02

Depending on the component the common method is to use a .MODEL card for basic elements (transistors, diodes) or for more complex components (ICs like Opamps, Regulators, etc) you can use either a sub-circuit model (made up of basic elements) or a behavioral model (using formulas to approximate behaviour)

This can get very complicated very quickly, how complex depends on how accurate you need the component to simulate, and requires pretty detailed knowledge of the component type so you know which datasheet parameters are important, how they translate to SPICE parameters, etc.

For an example of the type of parameters you need to know about (at least some of them), in LTSpice help look under LTSpice->Circuit Elements->Bipolar Transistor and look at the Gummel-Poon parameters.
As complex as this looks, you can use the defaults for most and just alter the basics like the Bf (Beta), Vje(b-e voltage), Cje (base emitter capacitance), Cjc, etc. It's helpful to look at the various models that come with LTSpice to get an idea of things.

The help provides a lot of useful information, so read it thoroughly. Also "A guide to Circuit Simulation using PSPICE" is a half decent book with some discussion of the model parameters. Also, google for info on the models, you should find plenty - for instance, here is an excellent document on the Gummel-Poon model and how to use it.


Here is a very good tutorial on how to build a .model statement for a MOSFET: http://www.simonbramble.co.uk/lt_spice/ltspice_lt_spice_tutorial_6.htm

Just to give a little more information here: there are two paths to create a component model. One uses a .subsckt statement and the other uses a .model statement.

For basic components like a MOSFET, it is better to use a .model statement. A MOSFET can be modeled with the template statement .model XXXX VDMOS(Rg= Rd=5 Rs=1 Vto= Kp= Cgdmax= Cgdmin= Cgs= Cjo= Is= Rb= ), where the parameters Rg, Rd, Rs etc. can be determined from the data sheet and other spice files.

An example is the Fairchild FDS6680A MOSFET with a model defined by the statement .model FDS6680A VDMOS(Rg=3 Rd=5m Rs=1m Vto=2.2 Kp=63 Cgdmax=2n Cgdmin=1n Cgs=1.9n Cjo=1n Is=2.3p Rb=6m mfg=Fairchild Vds=30 Ron=15m Qg=27n).

  • \$\begingroup\$ Link only answers tend to be frowned upon as the links can break rendering the answer useless. Perhaps you could summarise the link or expand the answer a bit. \$\endgroup\$ Feb 24 '16 at 4:08
  • \$\begingroup\$ @Tom - You are correct and thanks for the feedback. I've added a bit more that hopefully makes the answer more "standalone". \$\endgroup\$
    – py_man
    Mar 23 '16 at 17:05

After reading through these answers, clicking on a couple links, and more in depth links, a a whole rabbit hole of clicks, I have found quite a bit of info which I will skim over as an updated answer (and for my own documentational purposes ;)

First of all : you should know that this is much more invloved than can be answered as an answer here. More-over, your question is too generic ,as others have commented already. I will only touch the surface, list a couple from the basic passive elements which aren't documented much and then provide links to further investigate how to model your component of interest as this is a HUGE subject, even for just a single element.

For creating your own models in SPICE for a specific component you will need to figure out the following:

  1. How Spice Models a specific component and the parameters available to you
  2. How each parameter influences the modeled behaviour
  3. How to correlate the provided information in the datasheet to modeled behaviour

Spice available model defined elements

.MODEL -- Define a SPICE Model

Syntax: .model <modname> <type>[(<parameter list>)]

Type (Associated Circuit Element) :

SW (Voltage Controlled Switch) , CSW (Current Controlled Switch) , URC (Uniform Distributed RC Line) , LTRA (Lossy Transmission Line) ,D (Diode) ,NPN (NPN Bipolar Transistor) ,PNP (PNP Bipolar Transistor) ,NJF (N-channel JFET model) ,PJF (P-channel JFET model) ,NMOS (N-channel MOSFET) ,PMOS (P-channel MOSFET) ,NMF (N-channel MESFET) ,PMF (P-channel MESFET) ,VDMOS (Vertical Double Diffused Power MOSFET)

RES(Resistor), CAP(Capacitor), IND(Inductor)

note:this list may not be complete

Basic Passives (R,L,C)

  1. Resistor : You can define/tweak a temperature dependence
  2. Capacitor : You can define/tweak a temperature dependence, voltage dependence
  3. Inductor : You can define/tweak a temperature dependence, current dependence

Temperature dependence (R,L,C)

=========== ============================== ======= =======
   name      parameter                      units  default
=========== ============================== ======= =======
TC1          linear temperature coeff.      1/ºC     0.0 
TC2          quadratic temperature coeff.   1/ºC²    0.0 
T_MEASURED    override component temp.       ºC      27  
TNOM             (same as above)             ºC      27  
=========== ============================== ======= =======

These coefficients get calculated to a Temperature Factor multiplier as follows:

Temperature Factor Calculation

(\Delta T = \left(T_{amb} - T_{nom} \right ) \text{ , default } T_{amb}=27\ TempFactor = 1+T_{c1} \cdot\Delta T+T_{c2}\cdot(\Delta T)^2)

Resistor Extended temperature modeling

======= ============================== ======= =======
 name    parameter                      units  default
======= ============================== ======= =======
 TCE    exponential temperature coeff.   %/ºC    0.0 
======= ============================== ======= =======

Extended Resistance Temperature Factor Equation

(TempFactor_{R} = TempFactor\cdot 1.01^{Tce\cdot\Delta T})

T_amb = is the global temperature, by default 27ºC This can be defined in .TEMP runs

.TEMP 10 20

or sweeping the temp parameter in a DC sweep analysis for example.

The value of the resistors, capacitors, inductors will be calculated as follows:

Passives Temperature Factor Applied

Voltage dependence (C)

=========== ============================== ======= =======
   name      parameter                      units  default
=========== ============================== ======= =======
VC1          linear voltage coefficient      1/V     0.0 
VC2          quadratic voltage coefficient   1/V²    0.0 
=========== ============================== ======= =======

Capacitor Voltage coefficient equation

(C = C\cdot \left(1+Vc1\cdot V_C+Vc2\cdot V_C^2\right))

Current dependence (L)

=========== ============================== ======= =======
   name      parameter                      units  default
=========== ============================== ======= =======
IL1          linear current coefficient      1/A     0.0 
IL2          quadratic current coefficient   1/A²    0.0 
=========== ============================== ======= =======

Inductor current coefficient formula

(L = L\cdot \left(1+Il1\cdot I_L+Il2\cdot I_L^2\right))

Initial Values

This will only cause an effect on the simulation if the ‘UIC’ (skip initial operating point solution) option is specified on the .tran analysis.

Within the model you can also specify the initial value with the parameter ic where its value will define the initial current in an inductor or the initial voltage in a capacitor. It does not apply to resistances.

Initial Values can also be set in a general context at specific Nodes with the .ic spice directive.

Parasitic elements

Resistors In this case, define a subcircuit such as presented in this question/answer Equivalent circuit of a non-ideal resistor, modeling the parasitic elements.

R parasitics subcircuit 1 R parasitics subcircuit 2

The model which suits your specific resistor construction and application is up to you to choose.

In this Application Note from Vishay on Thin Film Chip Resistors they provide model coefficients for parasitic parameter variation depending on smd coponent case size a type of terminal endings.

Capacitors LTSpice has the following parasitic element model.

C parasitics equivalent spice model

In LTSpice, right-clicking on the device allows you to specify the following parasitic components:

Rser, Lser, Rpar, Cpar

To specify RLShunt you will need to (cntrl+right click) and scroll down to SpiceLine or SpiceLine2 and manually type it in there. e.g. RLShunt=0.01

Inductors LTSpice has the following parasitic element model.

L parasitics equivalent circuit spice

In LTSpice, right-clicking on the device allows you to specify the following parasitic components:

Rser, Lser, Rpar, Cpar

*Rser defaults to 1mΩ unless strictly specified. This allows LTspice to integrate the inductance as a Norton equivalent circuit instead of Thevenin equivalent in order to reduce the size of the circuit's linearized matrix.

Defining the model

To define the model create a spice directive and place it on the sheet:

.model myR res(Tnom=150 Tc2=-19u)

then enter the model into its "SpiceModel" field (via ctrl-right mouse click) on the Resistor. Same procedure applies for all components

Defining Non-Linear behaviours

These statements are not compatible with model definitions of the passives. They are entered instead of the component value as the expression defines the behaviour of that value.


R=<expression>                , defines resistance (R<>0 to avoid problems)
R=limit(1,100k,V(1,2)*I(V1))  , result is kept between 1Ω and 100kΩ


Q=<expression>      , defines capacitance ('x' is Capacitors voltage)
Q=1u*x              , defines a 1uF capacitor
Q=x*if(x>3,1n,400p) , a more complex relationship

More info here


There are two forms of non-linear inductors available in LTspice. The basic one follows:

Flux=<expression> , defines the inductance ('x' is Inductors current)
Flux=1m*x         , defines a 1mH inductor
Flux=1m*tanh(5*x) , a more complex relationship

The other non-linear behaviour attempts to model a core, defining a hysterisis loop using the following parameters:

====== ========================= ===============
 Name      Description                Units
====== ========================= ===============
  Hc     Coercive force          Amp-turns/meter 
  Br     Remnant flux density        Tesla
  Bs     Saturation flux density     Tesla
------ ------------------------- ----------------
     Mechanical dimensions of the core
------ ------------------------- ----------------
  Lm    Magnetic Length(excl.gap)    meters
  Lg     Length of gap               meters
  A      Cross sectional area        meters²
  N      Number of turns               -
====== ========================= ===============

L core hysteretical model

More info here

Step 2 :

Now that you have an idea of how you can model a couple components, now you have to look at the datasheet and see what you can use to best model the component to your needs.

Here is a nice read to selecting and calculating the equivalent circuit for passives behavior when provided a graph.

Step 3 :

Generate curves with test setups in spice simulation runs and tweak the values of the parameters to fit the curves.

I'm adding a section on MOSFETs because it was the component you were initially attempting to model and the once I am too.


There are two fundamentally different types of MOSFETS in LTspice, monolithic MOSFETs and a new vertical double diffused power MOSFET model.

Power MOSFETs is the current area of interest are modeled as vertical double diffused power MOSFETs: VDMOS

Minimum Required model Parameters

=========== ===========================================
 Parameter     Description 
=========== ===========================================
  Rg         Gate ohmic resistance 
  Rd         Drain ohmic resistance (this is NOT RDSon 
             but the resistance of the bond wire) 
  Rs         Source ohmic resistance. 
  Vto        Zero-bias threshold voltage. 
  Kp –       Transconductance coefficient 
  Lambda     Change in drain current with Vds 
  Cgdmax     Maximum gate to drain capacitance. 
  Cgdmin     Minimum gate to drain capacitance. 
  Cgs        Gate to source capacitance. 
  Cjo        Parasitic diode capacitance. 
  Is         Parasitic diode saturation current. 
  Rb         Body diode resistance. 
=========== ===========================================

How to correlate the model to the datasheet is extensively and very well modeled in the multiple papers published by Ian Hegglun. There are test setups for tweaking the curves aswell in zip files to be downloaded.

MOSFET : VDMOS Parameter Extraction from curves and datasheet

Resources to trace curves from datasheets



You need to be clear as to what you mean by component. Spice natively models transistors circuit elements, it is pluggable to put your own "C" models in (not all version can do this) but then you have to understand how SPICE works to make the models correctly. For larger more complex devices you can use macro-models or the more modern trend is to use Verilog-A.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.