I want to simulate the effect of temperature on a semiconductor.

I can use .temp ... or .option temp ... or .step temp ..., but all of these show multiple lines and I am not able to do anything with it in the simulation, for instance, having an op-amp/comparator react on the change in the forward voltage of the semiconductor.

LTspice has some tricks to convert a voltage to a resistance, like this:

enter image description here

Is there something similar to create a gradient in temperature from 0°C at the beginning of the simulation to 100°C at the end?


1 Answer 1


I think you just want a linear sweep of the temperature. If so, just use a card like this one:

.step temp 0 100 1

That sweeps from \$0^\circ\text{C}\$ to \$100^\circ\text{C}\$ in \$1^\circ\text{C}\$ increments.

I'd then set up a behavioral voltage supply and set it equal to temp. Then set the x-axis to its output.

Here's an example to illustrate:

enter image description here

Let me know if there's something I missed.

  • \$\begingroup\$ thank you for the solution. I have created hundreds of simulations with .tran already, but I had never used .op before. With .op all the "duplicate" lines in the plot are gone and that makes it a lot easier to read. \$\endgroup\$
    – hennep
    Jan 13 at 9:41
  • \$\begingroup\$ @hennep I'm glad that helped. :) \$\endgroup\$ Jan 13 at 9:52
  • \$\begingroup\$ There is still something I cannot solve. To be able to add a hysteresis resistor to an opamp, I need to reverse the temperature scale or better let the temperature go up in the first half and down in the second half of the scale. Using a PWL for voltage is also not possible because there is no time scale in the plot. \$\endgroup\$
    – hennep
    Jan 13 at 11:47
  • \$\begingroup\$ @hennep I can't offer a specific suggestion without seeing the situation. But if you post up a new question with an exact schematic that presents the specific issues, I'll try to help find an answer. \$\endgroup\$ Jan 13 at 12:00
  • \$\begingroup\$ @hennep There is this reference that is worth reading closely about using LTspice and temperature sweeps. You may be able to consider that approach, as well, when considering getting a nice hysteresis loop plot. I've done it before, that way. But a lot depends on exactly what you are doing. \$\endgroup\$ Jan 13 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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