that hysteresis curve is for sin wave. what is your plot for square wave and what do you expect from that?
I didn't plot resistance of memristor but I think you should perform dc sweep.
Dear ahmd1954
I am applying square pulse input as given in the HSPICE code given below. With the polarity of square pulse the resistance of memristor should switch between Ron and Roff. I am unable to plot the mermristance state of memristor. Please help me with this.
Thanking you in anticipation.
Manish
HSPICE code for memristor
* MEMRISTOR
* Ron, Roff - Resistance in ON / OFF States
* Rinit - Resistance at T=0
* D - Width of the thin film
* uv - Migration coefficient
* p - Parameter of the WINDOW-function
* for modeling nonlinear boundary conditions
* x - W/D Ratio, W is the actual width
* of the doped area (from 0 to D)
*
.SUBCKT memristor Plus Minus
+ Ron=100 Roff=16k Rinit=11k D=10N uv=10F p=10
* DIFFERENTIAL EQUATION MODELING *
.PARAM f(x,p)= '1-pow((2*x-1),(2*p))'
Gx 0 x value='I(Emem)*uv*Ron/pow(D,2)*f(V(x),p)'
Cx x 0 1 IC='(Roff-Rinit)/(Roff-Ron)'
Raux x 0 1T
* RESISTIVE PORT OF THE MEMRISTOR *
Emem plus aux value='-I(Emem)*V(x)*(Roff-Ron)'
Roff aux minus Roff
*Flux computation*
*Eflux flux 0 value={SDT(V(plus,minus))}
*Charge computation*
*Echarge charge 0 value={SDT(I(Emem))}
*.meas TRAN charge INTEG I(Emem) FROM = 100u TO = 5s
* WINDOW FUNCTIONS
* FOR NONLINEAR DRIFT MODELING *
*window function, according to Joglekar
*.func f(x,p)={1-(2*x-1)^(2*p)}
*proposed window function
*;.func f(x,i,p)={1-(x-stp(-i))^(2*p)}
.ENDS memristor
*.param Vmin=-1V Vmax=1V
*.PARAM Vinitial=Vmin Vpulsed=Vmax td=0
*+ tr=1ns tf=1ns PW=100us per='tr+tf+2*pw'
Xmemrist aa 0 memristor
Vtest aax 0 pulse (Vinitial Vpulsed td tr tf PW per)
Vaux aax aa 0
.tran 100u 1m
.plot tran V(aa) I(Vaux)
.probe rmem=par('(v(aa))/I(Vaux)')
.option list node post=2 ingold=2 runlvl=0
.end