In 2012, Chris Yakopcic co-authored a book chapter in the book titled Advances in Neuromorphic Memristor Science and Applications, featuring a chapter on memristor modeling in LTSpice. In this chapter, he does a wonderful review of the most common memristor models up to that point in time including LTSpice code and simulation results for simple sine wave driven hysteresis loops. Here, we repeat many of his simulations in order to gain a better understanding of the various models and to learn a few tricks about using LTSpice. Some of the basics for memristor modeling and setting up LTSpice was already published in a previous post. I would like to thank Chris Yakopcic for sending me all the LTSpice model files appearing in his book chapter and for sharing his techniques for running his simulations on LTSpice. For more of Chris’s work, check out his blog.

In this post I will run a few of Chris’s memristor model simulations in LTSpice followed our own implementation of our Knowm Mean Metastable switch model. And as usual, all model and simulation files appearing here can be found in our memristor-models-4-all project on github.

LTSpice

In a previous post titled The Joglekar Resistance Switch Memristor Model in LTSpice, I already covered the basics of setting up LTSpice, memristor modeling in general and running a memristor model simulation in LTSpice. Here, I’ve adopted the methods of Yakopcic, so things are a tad bit different. For example, I added a third node to the memristor symbol, which is used to represent the internal state of the memristor, XSV. I didn’t connect it to anything and plotting the state is done by accessing the V(nc_01) variable. Another change from the previous post is that I link the memristor subcircuit not from the memristor symbol itself, but as a directive added to the simulation file (.asc). The Value attribute for the symbol needs to be updated however to match the subcircuit name. For each simulation there are two corresponding .plt files – one for I-V plots and one for time plots. LTSpice will look for a .plt file corresponding to the .asc file being run so what you need to do is remove the _IV and _T part of the complete .plt file name before running the simulation.

Joglekar Window

Simulation Files

LTSpice Circuit Joglekar

LTSpice Circuit Joglekar

LTSpice Joglekar Time

LTSpice Joglekar Time

LTSpice Joglekar IV

LTSpice Joglekar IV

Biolek Window

Simulation Files

LTSpice Circuit Biolek

LTSpice Circuit Biolek

LTSpice Biolek Time

LTSpice Biolek Time

LTSpice Biolek IV

LTSpice Biolek IV

Yakopcic

Simulation Files

LTSpice Circuit Yakopcic

LTSpice Circuit Yakopcic

LTSpice Yakopcic Time

LTSpice Yakopcic Time

LTSpice Yakopcic IV

LTSpice Yakopcic IV

University of Michigan

Simulation Files

LTSpice Circuit UMich

LTSpice Circuit UMich

LTSpice UMich Time

LTSpice UMich Time

LTSpice UMich IV

LTSpice UMich IV

Knowm

Simulation Files

Because this model does not appear in Yakopcic’s book chapter referenced above, I will include a quick review of the mode and the LTSpice subcircuit here.

The Mean Metastable Switch Memristor Model

The mean metastable switch memristor model was previously described here, but I will summarize it again here for completeness. The model describes a memristor as a collection of metastable switches where each switch can be in either one or the other state. At any given time, the probability of switches switching state as a function of applied voltage is calculated.

The change in the number of switches, scaled between 0 and 1,  dX is:

  dX = N_{OFF  \rightarrow ON} - N_{ON  \rightarrow OFF}

If the probabilities  P_{OFF  \rightarrow ON} and  P_{ON  \rightarrow OFF} are defined as:

  P_{OFF \rightarrow ON} = \alpha \frac{1}{{1 + {e^{ -\beta \left( {V - {V_{ON}}} \right)}}}}    P_{ON \rightarrow OFF} = \alpha \left(1 - \left(\frac{1}{{1 + {e^{ -\beta \left( {V + {V_{OFF}}} \right)}}}}\right)\right)

The number of switches switching state is thus:

 N_{OFF \rightarrow ON} = P_{OFF  \rightarrow ON} \cdot (1-X)   N_{ON \rightarrow OFF} = P_{ON  \rightarrow OFF} \cdot (X)

. Therefore plugging everything in, also setting   \alpha = \frac{dT}{\tau} :

  dX =  P_{OFF  \rightarrow ON} \cdot (1-X) - P_{ON  \rightarrow OFF} \cdot X    dX = \frac{dt}{\tau} \frac{1}{{1 + {e^{ -\beta \left( {V - {V_{ON}}} \right)}}}} \cdot (1-X) - \frac{dt}{\tau} \left(1 - \left(\frac{1}{{1 + {e^{ -\beta \left( {V + {V_{OFF}}} \right)}}}}\right)\right) \cdot X    dX/dt = 1/\tau \left[ \frac{1}{{1 + {e^{ -\beta \left( {V - {V_{ON}}} \right)}}}} \cdot (1-X) - \left(1 - \left(\frac{1}{{1 + {e^{ -\beta \left( {V + {V_{OFF}}} \right)}}}}\right)\right) \cdot X \right]

The final step to complete the MMSS model description is to define the current as a function of X. We can break that definition down into two steps, first the conductance, followed by the current. The conductance as a function of X is

  G = \frac{X}{ R_{ON} }+ \frac{1 - X}{R_{OFF}}

Note that this describes a summation of conductances. Relating this to the real-world it tells us that our model is in fact 2 parallel resistors whose resistance values are coupled to each other via X.

For completeness, given a memristance value, for example R_{init},

 X = \frac{R_{ON}  (R_{init} - R_{OFF} )}{ R_{init}  (R_{ON} - R_{OFF})}

Finally, by Ohm’s Law the current is

  I = V \cdot G

Subcircuit

LTSpice Circuit Knowm

LTSpice Circuit Knowm

LTSpice Knowm Time

LTSpice Knowm Time

LTSpice Knowm IV

LTSpice Knowm IV

Conclusion

In this post I presented my simulation results taken more or less directly from Chris Yakopcic’s book chapter in the book titled Advances in Neuromorphic Memristor Science and Applications. I didn’t run all of the examples in the chapter, but doing so shouldn’t be hard at all. One of the motivations for running these simulations was to understand the basic mechanics of memristor modeling in LTSpice so that I could implement Knowm’s mean metastable switch memristor model, which I presented as the last simulation.

Further Resources

Related Posts

Subscribe To Our Newsletter

Join our low volume mailing list to receive the latest news and updates from our team.

7 Comments

    • Shivam Acharya
      reply

      Hi,
      I am an undergrad university student and currently learning about memristors and crossbar arrays. I am trying to use one of the above-mentioned memristors models in LTSpice in a cross bar. I am not able to understand how to change the Ron and Roff values when used in a crossbar array. Do help me understand that. That would be very helpful.
      Thanks.

      • Alex Nugent
        reply

        Shivam,

        Memristors typically need current limiting to prevent burn-out. This means that setting Ron value is determined mostly by current-limiting within your circuit and drivers. Knowm memristors will go all the way to 100Ω or even lower if you keep a positive voltage over the threshold. However, these high currents will damage the device. Roff is memristor and history dependent. For example, the Roff value of a Knowm W memristor is ~1MΩ except if it has driven with high current (~1mA). In this case Roff will reduce to anywhere from 50kΩ to 200kΩ.

    • Thanasin Bunnam
      reply

      Hi, I simulated the original circuit from https://github.com/knowm/memristor-models-4-all/tree/master/Knowm/LTSpice in LTSpice. I set the sine wave amplitude as 0V because I want to see the state variable V(nc_01) stops changing. However, it still changes. Please suggest why the state variable changes while the input voltage is below the threshold? Thank you in advance.

      • Alex Nugent
        reply

        Which memristor model are you using? If you are using the MSS model, the transition probabilities (Pa, Pb) that move the meta-stable switches are not discontinuous but given by continuous functions which are also a function of temperature. The switches will flip with small probability even if under threshold until an equilibrium is reached. Note that the MSS model is not an official model of the M-SDC devices. The MSS model was created before the M-SDC memristors were invented. That said, all memristors will decay to a degree outside the influence of external voltage bias so its important to capture that effect. https://knowm.org/the-generalized-metastable-switch-memristor-model/

        • Thanasin Bunnam
          reply

          Yes, I’m studying the MSS model to see how it fits to the SDC memristor. Your reply was clear, thank you very much.

    • syed abdul rahim
      reply

      1) sir, actually we need .sub file and .asy file to get symbol in ltspice.
      but u have posted only .sub file.
      is there any way to design with only .sub ckt file?
      2) another question is how to select doped and undoped value. if it changes the value then what parameters will change in memristor.
      3) and what is the main diff between linear and nonlinear memristor?
      4) in ltspice how to create x and f(x) curve and parameters.
      5) how to create a new model of memristor?

      can u please reply me…..

Leave a Reply to Thanasin Bunnam Cancel reply

Knowm 32X32 Crossbar

Knowm Newsletter

Are you ready for memristor AI processors? With our newsletter, you will be.