Simulation of memristor device in qspice

I have tried to simulate a memristor model which already working well on LTspice.
but gives a syntax error in qspice. can anyone help debug?

  • Knowm Mean Metastable Switch Memristor SPICE Model

  • Copyright Tim Molter Knowm Inc. 2017

  • Connections:

  • TE: Top electrode

  • BE: Bottom electrode

  • XSV: External connection to plot state variable

  •  that is not used otherwise


  • Ron: Minimum device resistance
  • Roff: Maximum device resistance
  • Von: Threshold voltage to turn device on
  • Voff: Threshold voltage to turn device off
  • TAU: Time constant
  • T: Temperature

.params Ron=500 Roff=1500 Voff=0.27 Von=0.27 TAU=0.0001 T=298.5 x0=0

  • Function G(V(t)) - Describes the device threshold
    .func G(V) = V/Ron+(1-V)/Roff

  • Function F(V(t),x(t)) - Describes the SV motion
    .func F(V1,V2) = (1/TAU)((1/(1+exp(-1/(Tboltz/echarge)(V1-Von))))(1-V2)-(1-(1/(1+exp(-1/(Tboltz/echarge)(V1+Voff)))))*V2

  • Memristor I-V Relationship
    .func IVRel(V1,V2) = V1*G(V2)

  • Circuit to determine state variable

  • dx/dt = F(V(t),x(t))*G(V(t))
    Cx XSV 0 {1}
    .ic V(XSV) = x0
    Gx 0 XSV value={F(V(TE,BE),V(XSV,0))}

  • Current source for memristor IV response
    Gmem TE BE value={IVRel(V(TE,BE),V(XSV,0))}


the code is already found in this link:

Visited this link but the symbol file .asy is missing. Goto Biolek directory and download memristor_with_state.asy and run .asc in Knowm, but it return syntax error in Qspice. Do you have a set of file which simulation can run in LTspice for review?
memristor-models-4-all/Knowm/LTSpice at master · knowm/memristor-models-4-all (