I am using XPPAUT/MATLAB to apply bifurcation analysis on a model with soma, dendrite and axon hillock. Then, I will compare/validate the results with ones in NEURON. So, I should use the current-balance equations in XPPAUT/MATLAB same as ones use in NEURON.
As XPPAUT/MATLAB are kinds of advanced calculators in which all equations should be defined, I've tried to follow the NEURON approach in dealing with current-balance equations (Chapter 5 of book and discussions in this forum), but I got different results for XPPAUT and NEURON. For XPPAUT, I use following current-balance equations:

The ODEs that govern membrane potential are correct as far as they go, but I don't see any scale factors related to the facts that, for NEURON, time is in ms and membrane potential is in mV. Also, what units do you plan to use for the injected current Iinj, and do they agree with the units of the other terms in that equation? How did you calculate the axial resistances, what are the units (and value) that you assume for cytoplasmic resistivity, are the resulting values in megohms, and do the axial currents agree with the units of the other terms? Finally, are any of your parameters temperature sensitive, and if so, what temperature are you assuming and have you made sure that NEURON's celsius has the same value?

ted wrote: How did you calculate the axial resistances, what are the units (and value) that you assume for cytoplasmic resistivity, are the resulting values in megohms, and do the axial currents agree with the units of the other terms?

Well, here's one problem: LHS of your ODEs is in pA (because pF*mV/ms = pF*V/s = pA). 1st term of the 1st ODE is in 1e3*nA = pA, which is good, but 2nd term is in 1e3*uS*V = nA.

Be sure to check the other terms as well and fix as necessary.

When you think everything is fixed, try these simple tests. Compare your simulation results with the analytic solutions and with the results produced by NEURON.
1. Assume a single compartment model cell with 100 um2 surface area and specific membrane capacitance 1 uF/cm2. No ion channels. Initial membrane potential = 0 mV. At t=1 ms inject a 1 nA current that lasts 1 ms. What is membrane potential at t=2 ms?
2. Assume same model cell and injected current, but now include an ion channel with conductance density 1 S/cm2 and reversal potential 0 mV. What is membrane potential at t=2 ms?

ted wrote:Well, here's one problem: LHS of your ODEs is in pA (because pF*mV/ms = pF*V/s = pA). 1st term of the 1st ODE is in 1e3*nA = pA, which is good, but 2nd term is in 1e3*uS*V = nA.

Be sure to check the other terms as well and fix as necessary.

Thanks for reply.
Actually, the initial conditions of membrane potentials are in mV (Vs = Vd = Vah = -70 mV). So, the 2nd term is also in 1e3*uS*mV=pA.

One more thing, for two-compartmental model (including soma and dendrite) using same method,

I get similar results for XPPAUT and NEURON. But for three-compartmental model, the results from XPPAUT and NEURON are different.
I checked all units and parameters. So, I think, the problem might be in axial resistance. Are following expressions correct?

Bob02 wrote:Actually, the initial conditions of membrane potentials are in mV (Vs = Vd = Vah = -70 mV). So, the 2nd term is also in 1e3*uS*mV=pA.

Then I misinterpreted

I’ve multiplied the right side of the current-balance equations to 1000 to have membrane potentials (Vs, Vd, and VAH) in millivolts.

for three-compartmental model, the results from XPPAUT and NEURON are different.
I checked all units and parameters. So, I think, the problem might be in axial resistance.

Maybe. Exactly what statements did you use to connect the compartments of your NEURON model to each other?

Are following expressions correct?

Only if nseg is 1.

Then,
coupling resistance between soma and dendrite . . .

True if connections are made only at the ends of neurites, not to internal nodes.

There are two ODEs for Vs, and none for Vah.

Suggest you reduce the problem to its simplest form. No voltage-gated currents--make everything as simple as possible so you can derive analytic results and use that to diagnose what's wrong with the numbers XPPAUT is generating from your model implementation.

With those anatomical sizes, that thing is for all practical purposes isopotential--unless cytoplasmic resistivity is at least 3000 ohm cm, i.e. 30 times larger than the typical 100 ohm cm that is usually assumed. But then this is really a mathematician's model anyway, so Ra can be whatever is needed to produce the desired result.

ted wrote:With those anatomical sizes, that thing is for all practical purposes isopotential--unless cytoplasmic resistivity is at least 3000 ohm cm, i.e. 30 times larger than the typical 100 ohm cm that is usually assumed. But then this is really a mathematician's model anyway, so Ra can be whatever is needed to produce the desired result.

Yes. The original model has nseg=1 for soma with L=diam=48.8. For AH, nseg=11, L=20, diam1=13 (soma side), and diam2=3 (IS side)..........

I am trying to start from a simple model and then get to the original one. So, the model I discussed here is only a mathematical one.