Similar to McIntyre et al., I applied a voltage to each compartment (segment) to represent extracellular stimulation.
But the source code provided by McIntyre et al. (available at modeldb.science/3810) doesn't apply "a voltage to each compartment." Instead, it uses _intracelluar_ stimulation by current injection into a single compartment, and the "out of range" message appears if the 0.1 ms duration stimulus current exceeds about 830 nA. An 825 nA current pulse drives local membrane potential to about 3.8 V after 0.01 ms, and about 6.3 V after 0.1 ms--and that's across a membrane that is only about 100 Angstroms thick (1/100th of a micron). That seems unrealistically large, since the _extracellular_ potential gradient used to induce electroporation is about 3 orders of magnitude smaller (it's about 0.8 V/um = 8 mV/100 Angstroms), and the transmembrane potential that elicits electroporation is on the order of 1 V (see
Shi J. et al.
A Review on Electroporation-Based Intracellular Delivery
Molecules 23:3044, 2018
PMID: 30469344
PMCID: PMC6278265
DOI: 10.3390/molecules23113044
).
The code you sent does not implement extracellular stimulation, and the code example in your post on the Forum doesn't disclose much, so I can't really replicate what you are observing or advise you how to deal with it. Modeling studies of peripheral nerve, spinal cord, retina, and brain that I have seen are consistent with the idea that extracellular potential gradients sufficient to trigger spikes are far below the level that would induce electroporation, or produce numerical overflow in computational simulations. If your model involves driving e_extracellular, and the resulting extracellular potential gradient is large enough to cause numerical overflow, the question is why, and the answer lies somewhere in your code that drives e_extracellular, or the values that are used to drive it, or both.
It doesn't seem likely that such extreme potential gradients are relevant in clinical or laboratory practice. For some time now, equipment used to stimulate peripheral nerves via (skin) surface electrodes, e.g. to measure nerve conduction velocity or elicit of F waves or H reflexes, has been implemented as a current source, not as a voltage source. The open circuit voltage generated by such equipment may be on the order of 100 V, but the actual delivered current is limited by the equipment itself and by the impedance at the electrode-skin interface. Furthermore, the distance between the electrodes and the nerve is generally on the order of 1 cm, so a substantial amount of that current never gets near the nerve, but instead is shunted away by the considerable volume of (highly conductive) tissue that lies between nerve and the skin under the stimulating electrodes. Consequently the extracellular potential gradients in the nerve bundle itself will be smaller than one might expect from the rough (over)estimate
(open circuit voltage generated by the stimulator)/(distance from electrode to nerve) = 100 V/cm = 0.01 V/um
Similar considerations apply to the use of sharp metal electrodes to inject current directly into tissue near a nerve bundle. The electrode tip necessarily has a small surface area, so the electrode-tissue interface presents a high series resistance that can cause a large voltage drop between the output of the stimulator and the tissue.
Revised 20240128 NTC