Transient analysis failure using Joglekar memristor model

110 views
Skip to first unread message

Abitha Thyagarajan

unread,
May 2, 2021, 2:46:12 PM5/2/21
to xyce-users

Hello,

I am trying to simulate a circuit containing a certain memristor model, the “Joglekar memristor model”. I have tried including it in my circuit (1) as a subcircuit and (2) as a Verilog model; however, transient analysis fails using both approaches. 


(1) When used as a subcircuit

I am able to simulate the memristor without errors when used in the file “joglekar.cir”. However, when I use the memristor in a larger circuit (“m2x2_jog_subckt.cir”) and perform a transient analysis, the simulation halts at 4% and I get the following error:

“Time step too small near step number: 387  Exiting transient loop.”

The complete error message is attached (“m2x2_jog_subckt_error.txt”). I have taken the code for the subcircuit from this website.


(2) When used as a Verilog model

I have compiled the Verilog model (“joglekar.va”) using the `buildxyceplugin` tool. I am able to simulate it without errors when used in the file “memristor_sim.cir”. However, when I use the memristor in a larger circuit (“m2x2_jog_subckt.cir”) and perform a transient analysis, I get the following error:

function OneStep::rejectStep:
   Maximum number of local error test failures. 
*** Xyce Abort ***
function OneStep::rejectStep:
   Maximum number of local error test failures.  

The complete error message is attached (“m2x2_error.txt”). I have taken the code for the model from this website.


I have uploaded all the relevant files here. Any guidance on how to resolve this error, such that I can use the Joglekar model in my circuit “m2x2”, would be greatly appreciated.

Thank you for your time.
Regards,
Abitha Thyagarajan


m2x2_jog_subckt_error.txt
m2x2_error.txt

xyce-users

unread,
May 4, 2021, 5:35:48 PM5/4/21
to xyce-users
The web site you linked to for the sub circuit implementation of the joglekar memristor model only has an HP memristor model on that page (in sub-circuit form).  Can you post the sub-circuit you used?

Typically, the issue that causes these 'time step too small" errors is that the model is discontinuous in an internal variable.  One memristor on it's own isn't hard but when you try to simulate many of them the discontinuities hamper the time integrator because it's trying to resolve those discontinuities.

Xyce-Team.

xyce-users

unread,
May 4, 2021, 5:55:30 PM5/4/21
to xyce-users
I see that you did post the input files and had a link to them in your original message.  I'll take a look at those.

Thanks,
Xyce-Team

xyce-users

unread,
May 4, 2021, 7:03:43 PM5/4/21
to xyce-users
The problem with the sub-circuit implementation is that the internal variable "x" used to switch the device is not scaled. 

All of the dynamics occur in a very narrow range of values between 3.14466371e-01 and 3.14465370e-01.  The dynamic range of this switching variable is then: 1.001e-06.  The window function which helps control the switching of the device assumes that "X" never goes outside this range.  But it can during a non-linear solver iteration and that leads to the simulation ending.

To fix this you can bracket the evaluation of the window function with:

* window function, according to Joglekar
.func f(x,p) {if( x>=3.14466371e-01, 0, if( x <= 3.14465370e-01, 0, 1-(2*x-1)**(2*p)))}
 
That works but its kind of a pain.  A better solution is to use a memristor model that scales this internal variable properly.  Xyce has a few models already in the code -- you can find them in the reference guide, section 2.3.32.  Unfortunately, this model is not one of them.

Thanks,
Xyce-Team


Abitha

unread,
May 5, 2021, 12:48:05 PM5/5/21
to xyce-...@googlegroups.com
Thank you very much. This solution worked for me.
Reply all
Reply to author
Forward
0 new messages