I am trying to model the dynamics of a hypothetical factor (tfact) throughout a cell using RXD. To make what I believe to be the simplest possible model have made a two section cell, with 101 segments in each. I have linked them to one another. I added an "enzyme" rate reaction to one half (the right) not the other. I finally initialise with a high concentration of factor right in the middle and then watch the species travel through the cell. I expect to see that it spreads freely by diffusion into the left of the cell, but fails to get far into the right because of the rate reaction.
I don't get that, it seems my rate reaction is constant throughout this two-segment cell? (y=concentation, x =cell distance, initial red, blue is time-lapse snapshots, basically copied from the Tutorial on the Neuron website).

Can anybody help? thank you.
The code I used in its entirety (sorry, I don't have a clue where I went wrong):
Code: Select all
from neuron import h, rxd
import numpy
from matplotlib import pyplot
# needed for standard run system
h.load_file('stdrun.hoc')
cellLEFT=h.Section()
cellRIGHT=h.Section()
cellLEFT.nseg=100
cellRIGHT.nseg=100
cellLEFT.connect(cellRIGHT(0))
#cellRIGHT.connect(cellMID(1))
tfact0=137
cytosol=rxd.Region([cellLEFT])
enzymerich=rxd.Region([cellRIGHT])
#d=diffusion constant
tfact = rxd.Species([cytosol,enzymerich],d=1, initial=0)
#start just with diffusion so blank these
reaction = rxd.Rate(tfact, 100000,regions=enzymerich)
h.finitialize()
for node in tfact.nodes:
if node.x > .45 and node.x < .55: node.concentration = tfact0
print('Nodes=',len(tfact.nodes.concentration))
def plot_it(color='b'):
y = tfact.nodes.concentration
x = tfact.nodes.x
# convert x from normalized position to microns
x = (cellLEFT.L+cellRIGHT.L) * numpy.array(x)
pyplot.scatter(x,y,marker='o',color=color,s=5)
#plot the initial situation
plot_it('r')
#We will plot every 25ms 5 up to 100ms
for i in range(1, 5):
#I presume this is h.continuerun(ms)
h.continuerun(i * 25)
plot_it()
pyplot.show()