Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

"SOLVE kinetic STEADYSTATE sparse" is not solving for steady state.  #1394

@nrnhines

Description

@nrnhines

It appears that the implementation contains terms involving nt->dt
nocmodl makes use of _ss_sparse_thread which iterative solves a nonlinear system using auto const ss_dt = 1e9;
(ideally the solution should use the conservation constraints in place of an equal number of ODE to avoid trying to solve a singular matrix, but that is not directly relevant to this issue). This issue was observed when comparing NMODL and nocmodl results for nrn/share/examples/nrniv/nmodl/capmp.mod when launching nrngui capmp.hoc.
The left column is for NMODL, the right is for nocmodl. (note: I'm using NMODL branch 1uc/fix-cadifpmp-shift).
The top row shows calcium concentration as a function of time for three cell diameters. In every case the intention was to initialize the concentration to 0.01 mM (single compartment) The NMODL 100diam (black line) case calculated an initial steady state of approximately 0.0076 instead of the correct 0.01.

image

Ignore the bottom row. I'm showing it because the missing beginning and ending of the steady state calcium current vs constant calcium concentration for the NMODL simulation is a puzzle (but likely not relevant to the initialization issue for the large diameter case.)

I believe the steady state initialization issue is due to using the value of nt->dt in the steady state equations of the NMODL generated capmp.cpp file. Evidence for this is

oc>diam = 100
oc>init()
oc>cai
	0.0076215222 
oc>dt
	0.025 
oc>dt=10
oc>init()
oc>cai
	0.0099921471 

but my naive expectations are dashed with

oc>dt=1e9
oc>init()
special: /home/hines/neuron/temp/share/examples/nrniv/nmodl/x86_64/capmp.cpp:824: void neuron::nrn_init_capr(const {anonymous}::_nrn_model_sorted_token&, NrnThread*, Memb_list*, int): Assertion `false && "Newton solver did not converge!"' failed.
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions