Electro-thermal simulation with ngspice

With ngspice you may not only simulate electrical circuits, but also “thermal circuits” and the interaction of both.

So for example there is an amplifier with power transistors. They will dissipate electrical power and heat up. The “thermal circuit” now consists of the heat generated in the device, the heat flow through the package to the heat sink and finally into the ambient. This flow is somewhat limited, and therfore the device temperature increases. Fortunately “thermal” circuits may be translated into electrical circuits and then be simulated with ngspice.

I have set up a tutorial at
with circuits entered by Eeschema, using electro-thermal device models from semiconductor makers (Power MOS and GaN devices) and some new KiCad symbols to follow these models.


WOW! Excellent write-up. Thanks!

I agree, this writeup is superb, @holger :slight_smile:, I’ve been playing with it and with pyspice for fun.

Now, I wonder if those electro-thermal analogies can be stretched somehow to account for spatial effects of temperature across (different) materials and components?

For instance, if I wanted so simulate a matrix of 20x20 0603 SMD resistors connected in parallel, spaced by 5mm and then do a simulation of say, from 12 to 24V applied on the input: would an ngspice model be accurate on simulating the temperature interactions between the PCB and its components and/or interactions between them? Or FEM software should be used for that instead?

In other words, I’m thinking about doing sth similar to what this paper describes:


Or this proprietary software does:


If it’s reasonable to do all this in ngspice I would love to know how… otherwise if someone has experience and/or knows if there’s OSS that can do simulation (and preferably also visualization) with a reasonable amount of effort, I’m all ears :slight_smile:

Yes, basically that is possible. But you have to create your model. And the accuracy does not depend on ngspice, but on your model. Model here denotes: you have to set up a thermal resistance matrix describing the heat paths (e.g. in your PCB), provide adequate heat storage capacity, take into account how much heat goes away from the front and from the back of your board. You have the electrical network, the resistors then are the ‘point sources’ of heat, and you have to couple the electrical network with the thermal network. This will require some efforts, but you may obtain a detailed understanding of what is going on.

If you want to know the tiny details of heat conductance and spreading around a single resistor, FEM may be the better approach. But for a global view the RC electrothermal network may be adequate.

1 Like