pspice -> ngspice conversion -- Absolute Value Function

996 views Asked by At

I am trying to port an existing PSPICE model (the HP Memristor Model) to ngspice... is there an absolute value function for ngspice?

Original PSPICE Model:

.SUBCKT modelmemristor plus minus PARAMS: +phio=0.95 Lm=0.0998 w1=0.1261 foff=3.5e-6 +ioff=115e-6 aoff=1.2 fon=40e-6 ion=8.9e-6 +aon=1.8 b=500e-6 wc=107e-3

G1 plus internal value={sgn(V(x))*(1/V(dw))^2*0.0617* (V(phiI)*exp(-V(B)*V(sr))-(V(phiI)+abs(V(x)))* exp(-V(B)*V(sr2)))}
Esr sr 0 value={sqrt(V(phiI))}

Esr2 sr2 0 value={sqrt(V(phiI)+abs(V(x)))} Rs internal minus 215
Eg x 0 value={V(plus)-V(internal)} Elamda Lmda 0 value={Lm/V(w)}

Ew2 w2 0 value={w1+V(w)- (0.9183/(2.85+4*V(Lmda)-2*abs(V(x))))}
EDw dw 0 value={V(w2)-w1}
EB B 0 value={10.246*V(dw)}
ER R 0 value={(V(w2)/w1)*(V(w)-w1)/(V(w)-V(w2))} EphiI phiI 0 value= {phio-abs(V(x))*((w1+V(w2))/(2*V(w)))- 1.15*V(Lmda)*V(w)*log(V(R))/V(dw)}
C1 w 0 1e-9 IC=1.2
R w 0 1e8MEG
Ec c 0 value={abs(V(internal)-V(minus))/215}
Emon1 mon1 0 value={((V(w)-aoff)/wc)-(V(c)/b)} Emon2 mon2 0 value={(aon-V(w))/wc-(V(c)/b)}
Goff 0 w value={foff*sinh(stp(V(x))*V(c)/ioff)* exp(-exp(V(mon1))-V(w)/wc)}
Gon w 0 value={fon*sinh(stp(-V(x))*V(c)/ion)* exp(-exp(V(mon2))-V(w)/wc)}
.ENDS modelmemristor
1

There are 1 answers

0
Holger Vogt On
* test memristor

xmemr 1 0 modelmemristor phio=0.95 Lm=0.0998 w1=0.1261 foff=3.5e-6 ioff=115e-6 aoff=1.2 fon=40e-6 ion=8.9e-6 aon=1.8 b=500e-6 wc=107e-3

.SUBCKT modelmemristor plus minus phio=0.95 Lm=0.0998 w1=0.1261 foff=3.5e-6 ioff=115e-6 aoff=1.2 fon=40e-6 ion=8.9e-6 aon=1.8 b=500e-6 wc=107e-3

G1 plus internal cur={sgn(V(x))*(1/V(dw))^2*0.0617* (V(phiI)*exp(-V(B)*V(sr))-(V(phiI)+abs(V(x)))* exp(-V(B)*V(sr2)))}

Esr sr 0 vol={sqrt(V(phiI))}

Esr2 sr2 0 vol={sqrt(V(phiI)+abs(V(x)))} 

Rs internal minus 215

Eg x 0 vol={V(plus)-V(internal)} 

Elamda Lmda 0 vol={Lm/V(w)}

Ew2 w2 0 vol={w1+V(w)- (0.9183/(2.85+4*V(Lmda)-2*abs(V(x))))}

EDw dw 0 vol={V(w2)-w1}

EB B 0 vol={10.246*V(dw)}

ER R 0 vol={(V(w2)/w1)*(V(w)-w1)/(V(w)-V(w2))} 

EphiI phiI 0 vol= {phio-abs(V(x))*((w1+V(w2))/(2*V(w)))- 1.15*V(Lmda)*V(w)*log(V(R))/V(dw)}

C1 w 0 1e-9 IC=1.2

R w 0 1e8MEG

Ec c 0 vol={abs(V(internal)-V(minus))/215}

Emon1 mon1 0 vol={((V(w)-aoff)/wc)-(V(c)/b)} 

Emon2 mon2 0 vol={(aon-V(w))/wc-(V(c)/b)}

Goff 0 w cur={foff*sinh(u(V(x))*V(c)/ioff)* exp(-exp(V(mon1))-V(w)/wc)}  $ stp -> u

Gon w 0 cur={fon*sinh(u(-V(x))*V(c)/ion)* exp(-exp(V(mon2))-V(w)/wc)}  $ stp -> u

.ENDS modelmemristor

Regards Holger