Nice try but doomed to fail. Why? Because this
Code: Select all
setpointer ex_xtra(x), e_extracellular(x)
setpointer exap_xtra(x), e_extracellular(x)
cannot work. e_extracellular(x) can only have a single value. Linking it to two other variables only means that it will get its value from one of them--but which one? The second one to which a value is assigned, of course--as you discovered.
So you're going to have to accomplish superposition of the two stimuli inside the xtra mechanism itself, and then use a single setpointer statement to communicate the resulting value to e_extracellular(x).
Start by copying the original xtra.mod to a file called xtra2.mod, and edit xtra2.mod to make the following changes:
In the NEURON block change the SUFFIX, RANGE, and GLOBAL declarations that involve xtra, rx, er, and is to
SUFFIX xtra2 : so you won't ever confuse this with the original xtra.mod
RANGE rx1, rx2, er1, er2
GLOBAL is1, is2
Don't do anything to the declarations of x,y,z, im, or ex.
In the PARAMETER block replace
rx = 1 (megohm)
with
rx1 = 1 (megohm)
rx2 = 1 (megohm)
In the ASSIGNED block replace
er (microvolts)
with
er1 (microvolts)
er2 (microvolts)
Change the INITIAL block's contents to
ex = (is1*rx1 + is2*rx2)*(1e6) : superposition!
er1 = (10)*rx1*im*area
er2 = (10)*rx2*im*area
Change the BEFORE BREAKPOINT block's contents to
ex = (is1*rx1 + is2*rx2)*(1e6) : superposition!
Change the AFTER SOLVE block's contents to
er1 = (10)*rx1*im*area
er2 = (10)*rx2*im*area
Check with modlunit to make sure things are OK, and reexamine the NMODL code to make sure it makes sense.
Make appropriate revisions to all the hoc files that involve statements that refer to xtra and you should be good to go. But test with a toy model to make sure that simulation results make sense.