# memristor project problem on netlist code ! (spice)

#### saha33

Joined Jun 19, 2013
1
Hi all,
I have a project about memristor based phase shift oscillator. I have wrote a spice code. I suppose that, It has some problems about subcircuit usage and library definition.
If you can help me to work this code I appreciate. The code can be seen below.

*Libraries:
* Local Libraries :
* From [PSPICE NETLIST] section of C:\Program Files\Orcad\PSpice\PSpice.ini file:
.lib "nom.lib"

X_U1A 0 N00542 N01372 N01457 N00895 AD648A
R_R1 N01002 N00542 1.3k
R_R2 N00542 N00895 37.7k
X_memristor 0 N00575 1k 100k 80k 10f 1 memristor
R_R4 0 N00633 1.3k
C_C2 N00575 N00633 0.5u
C_C3 N00633 N01002 0.5u
V_V1 N01457 0 -12Vdc
V_V2 N01372 0 12Vdc
C_C1 N00895 N00575 0.5u

.tran 0 1 0 1.0001

.SUBCKT memristor Plus Minus PARAMS:
+ Ron=1K Roff=100K Rinit=80K D=10N uv=10F p=1
***********************************************
*STATE EQUATION MODELLING*
Gx 0 x value={I(Emem)*uv*Ron/D^2*f(V(x),p)}
Cx x 0 1 IC ={(Roff-Rinit)/(Roff-Ron)}
Raux x 1G
************************************************
* RESISTIVE PORT MODELING*
Emem plus aux value ={-I(Emem)*V(x)*(Roff-Ron)}
Roff aux minus {Roff}
***********************************************
* WINDOW FUNCTION MODELLING*
.func f(x,p)={1-(2*x-1)^(2*p)}
.ENDS memristor

.END

It gives some error such as " ERROR -- Incorrect number of interface nodes for X_memristor"

This work done in the article (http://link.springer.com/article/10.1007/s13204-011-0021-4#page-1)