示例#1
0
文件: hh.py 项目: vogdb/nrn
somaB.pt3dclear()
somaB.pt3dadd(60, 0, 0, 1)
somaB.pt3dadd(90, 0, 0, 1)
somaB.nseg = 11

# mod version
somaB.insert('hh')

# rxd version

# Where?
# intracellular
cyt = rxd.Region(h.allsec(), name='cyt', nrn_region='i')

# membrane
mem = rxd.Region(h.allsec(), name='cell_mem', geometry=rxd.membrane())

# extracellular
ecs = rxd.Extracellular(-100, -100, -100, 100, 100, 100, dx=100)


# Who?
def init(ics, ecs):
    return lambda nd: ecs if isinstance(nd, rxd.node.NodeExtracellular
                                        ) else ics


# ions
k = rxd.Species([cyt, mem, ecs],
                name='k',
                d=1e3,
示例#2
0
cyt = rxd.Region(
    h.allsec(),
    name="cyt",
    nrn_region="i",
    geometry=rxd.FractionalVolume(0.9, surface_fraction=1.0),
)

org = rxd.Region(h.allsec(), name="org", geometry=rxd.FractionalVolume(0.1))

cyt_org_membrane = rxd.Region(h.allsec(),
                              name="mem",
                              geometry=rxd.ScalableBorder(
                                  pi / 2.0, on_cell_surface=False))
cyt_ecs_membrane = rxd.Region(h.allsec(),
                              name="cell_mem",
                              geometry=rxd.membrane())

# the extracellular space
ecs = rxd.Extracellular(-55,
                        -55,
                        -55,
                        55,
                        55,
                        55,
                        dx=10,
                        volume_fraction=0.2,
                        tortuosity=1.6)

# Who?
x = rxd.Species(
    [cyt, org, cyt_org_membrane, cyt_ecs_membrane, ecs],
示例#3
0
cell1.nseg = 11

# create cell2 where `x` will be pumped in and accumulate
cell2 = h.Section('cell2')
cell2.pt3dclear()
cell2.pt3dadd(10,0,0,10)
cell2.pt3dadd(20,0,0,10)
cell2.nseg = 11
# Where?
# the intracellular spaces
cyt = rxd.Region(h.allsec(), name='cyt', nrn_region='i', geometry=rxd.FractionalVolume(0.9, surface_fraction=1.0))

org = rxd.Region(h.allsec(), name='org', geometry=rxd.FractionalVolume(0.1))

cyt_org_membrane = rxd.Region(h.allsec(), name='mem', geometry = rxd.ScalableBorder(pi/2.0, on_cell_surface=False))
cyt_ecs_membrane = rxd.Region(h.allsec(), name='cell_mem', geometry = rxd.membrane())

# the extracellular space
ecs = rxd.Extracellular(-55, -55, -55, 55, 55, 55, dx=10, volume_fraction=0.2, tortuosity=1.6)

# Who?
x = rxd.Species([cyt, org, cyt_org_membrane, cyt_ecs_membrane, ecs], name='x', d=1.0, charge=1, initial=0)
Xcyt = x[cyt]
Xorg = x[org]
Xecs = x[ecs]


# What? - produce X in cell 1
# parameter to limit production to cell 1
cell1_param = rxd.Parameter(org, initial=lambda node: 1.0 if node.segment.sec == cell1 else 0)