nkhadar
Newbie level 2
*Netlist corresponding to schematic of Fig. 1a
*Netlist corresponding to schematic of Fig. 1a
* Main Circuit
Code dot - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 .subckt memristorplus plus minus PARAMS: *Parameters' values +rmin=100 rmax=390 rinit=390 alpha=1E15 beta=10 gamma=0.1 Vtr=1.5 Vtl=-1.5 yo=0.0001 +m=82 fo=310 Lo=5 Gr 0 r value={dr_dt(V(plus)-V(minus))*(st_f(V(plus)-V(minus))*st_f(V(r)-rmin)+ +st_f(-(V(plus)-V(minus)))*st_f(rmax-v(r)))} Cr r 0 1 IC={rinit} Raux r 0 1E12 *Current equation Imem = V / R(L) Gpm plus minus value={(V(plus)-V(minus))/((fo*exp(2*L(V(r))))/L(V(r)))} *Func. for non-linear threshold-based behavior .func dr_dt(y)={-alpha*((y-VtL)/(gamma+abs(y-VtL)))*st_f(-y+VtL)-beta*y*st_f(y-VtL)* +st_f(-y+VtR)-alpha*((y-Vtr)/(gamma+abs(y-VtR)))*st_f(y-VtR)} *Smoothing function .func st_f(y)={1/(exp(-y/yo)+1)} *L(V) function .func L(y)={Lo-Lo*m/y} .ends memristorplus
*Netlist corresponding to schematic of Fig. 1a
Code dot - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 .subckt memristorminus plus minus PARAMS: *Parameters' values +rmin=100 rmax=390 rinit=100 alpha=1E15 beta=10 gamma=0.1 Vtr=-1.5 Vtl=1.5 yo=0.0001 +m=82 fo=310 Lo=5 Gr 0 r value={dr_dt(V(plus)-V(minus))*(st_f(V(plus)-V(minus))*st_f(V(r)-rmin)+ +st_f(-(V(plus)-V(minus)))*st_f(rmax-v(r)))} Cr r 0 1 IC={rinit} Raux r 0 1E12 *Current equation Imem = V / R(L) Gpm plus minus value={(V(plus)-V(minus))/((fo*exp(2*L(V(r))))/L(V(r)))} *Func. for non-linear threshold-based behavior .func dr_dt(y)={-alpha*((y-VtL)/(gamma+abs(y-VtL)))*st_f(-y+VtL)-beta*y*st_f(y-VtL)* +st_f(-y+VtR)-alpha*((y-Vtr)/(gamma+abs(y-VtR)))*st_f(y-VtR)} *Smoothing function .func st_f(y)={1/(exp(-y/yo)+1)} *L(V) function .func L(y)={Lo-Lo*m/y} .ends memristorminus
* Main Circuit
Code dot - [expand] 1 2 3 4 5 6 7 8 9 VS 1 0 DC 3 PWL( 0s 0 0.25s 3 0.5s 0 0.75s -3 1s 0 1.25s 3 1.5s 0 1.75s -3 2s 0 2.25s 3 2.5s 0 2.75s -3 3s 0) X1 1 2 memristorplus X2 2 0 memristorminus *ANALYSIS .TRAN 10m 1 .PROBE .END
Last edited by a moderator: