# Hysteresis on LTspice with thermistor

I'm trying to simulate an hysteresis on LTspice. The goal is just to see how evolve the output voltage in function of the value of the thermistor. For this, I have done a simulation with several steps. Each step corresponds to a temperature and as the thermistor evolves in function of the temperature, the non inverting input voltage of the op amp varies in function of the actual step.

Here is the simulation :

My problem is that I am not able to see the hysteresis as the output voltage does not depend on the previous step. So I am always beginning the hysteresis in the same way. The ouput voltage is always the same at the beginning of a step. I would like to define the output voltage in function if the temperature goes up or if the temperature goes down. In other word if the non inverting input voltage goes up or goes down.

Thank you very much and have a nice day.

• I've read three times now but still don't understand what you are trying to do. Feb 5, 2021 at 12:54
• I can only trace the part of the hysteresis when the temperature goes up as the output voltage is fixed by the initial conditions. I do not know if it more clear ?
– Jess
Feb 5, 2021 at 18:32

Instead of making the resistance a function of temperature you will need to make it a function of time, and then assume that the temperature changes with some known relationship to time. Then you will be able to see the hysteresis in a single transient simulation.

• In this case, OP will have to change the .param with a .func (or directly use it as a behavioural resistor expression, R=<...>), because .params need to be all known prior to simulation start, so they can't be time-dependent. Feb 5, 2021 at 16:51
• Ok thank you very much for your help ! I will try to do this ! that's make sense !
– Jess
Feb 5, 2021 at 18:34

For future visitors who maybe come to this post when searching "how to simulate an hysteresis on LTspice". Having complied with the accepted answer's instructions, the OP received the desired hysteresis-loop-like graph in the transient analysis. To these useful question and answer, let me add a short glossary of hysteresis-related terminology.

The hysteresis discussed here is of a rate-dependent type, and, for the thermistor IV characteristic, this behavior cannot be revealed in a parameter sweep simulation with no transient analysis at all. The OP's successful simulation produces a hysteresis-like plot only due to a time-dependent resistance function introduced per Elliot's answer and citizen's comment.

One can use a Vishay NTC model (see a comment to this electronics.SE question) and readily receive a hysteresis-like plot, doing the transient analysis, but this model still does not help one produce a hysteresis loop for a forward/backward DC sweep of the voltage across the thermistor, i.e., to observe the rate-independent hysteresis, like magnetization in ferromagnetics or polarization in ferroelectrics or IV characteristic plots of a Schmitt trigger. The thermistor has no internal state variable feature like that the memristor has.

A hysteresis is a word often used to describe a transient analysis plot produced in simulation with a temperature-relaxation-dependent time lag. When writing a thesis or a publication for peer-reviewed journals, it is better to reserve this word for rate independent hysteresis phenomena.