rmmstn
Newbie level 6
Hello,
I am currently working on a project in which a new model of device has to be added to the SPICE library. However, when I used the code below, I am getting the error which is :
ERROR(ORPSIM-16364): Invalid device in subcircuit.
According to my investigations, I have seen that one person offered to make some important modifications in the code. Do you also think that it is the way?
If so, can you suggest me what to do in order to solve this issue.
Thank you.
CODE:
.SUBCKT memristor Plus Minus PARAMS:
+ Ron=10 Roff=16K Rinit=11K D=10N uv=10F
p=10
****************************************
* DIFFERENTIAL EQUATION MODELING *
****************************************
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 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))}
****************************************
* 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
I am currently working on a project in which a new model of device has to be added to the SPICE library. However, when I used the code below, I am getting the error which is :
ERROR(ORPSIM-16364): Invalid device in subcircuit.
According to my investigations, I have seen that one person offered to make some important modifications in the code. Do you also think that it is the way?
If so, can you suggest me what to do in order to solve this issue.
Thank you.
CODE:
.SUBCKT memristor Plus Minus PARAMS:
+ Ron=10 Roff=16K Rinit=11K D=10N uv=10F
p=10
****************************************
* DIFFERENTIAL EQUATION MODELING *
****************************************
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 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))}
****************************************
* 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