Exemplo n.º 1
0
# convert P type calcium current data to calcium influx profile

ca_curr_data = data_presets.readData(CA_P_CURR_DATA_FILE)
ca_influx_profile = data_presets.genCaInfluxProfile(
    ca_curr_data, roi_areas, roi_vols, PRESET_DATA_START_TIME,
    PRESET_DATA_START_TIME + SIM_TIME, INFLUX_UPDATE_INTERVAL)

# load preset background calcium concerntrations
ca_conc_preset_file = open(CA_CONC_PRESET, 'r')
ca_conc_preset = cPickle.load(ca_conc_preset_file)
ca_conc_preset_file.close()

########################### SIMULATION INITIALIZATION ###########################

r = srng.create_mt19937(512)
r.initialize(int(time.time()))

sim = ssolver.Tetexact(mdl, mesh, r)

sim.setCompConc('cyto', 'Mg', Mg_conc)

surfarea = sim.getPatchArea('memb')
pumpnbs = 6.022141e12 * surfarea

sim.setPatchCount('memb', 'Pump', round(pumpnbs))
sim.setPatchCount('memb', 'CaPump', 0)

sim.setCompConc('cyto', 'iCBsf', iCBsf_conc)
sim.setCompConc('cyto', 'iCBCaf', iCBCaf_conc)
sim.setCompConc('cyto', 'iCBsCa', iCBsCa_conc)
Exemplo n.º 2
0
    # Make the diff boundary tris with the intersection and convert to list
    tris_DB = tris_compA.intersection(tris_compB)
    tris_DB = list(tris_DB)

    # Create the diffusion boundary between compA and compB
    diffb = sgeom.DiffBoundary('diffb', mesh, tris_DB)

    return mesh, tets_compA, tets_compB


########################################################################

mdl = gen_model()
mesh, tets_compA, tets_compB = gen_geom()

rng = srng.create_mt19937(256)
rng.initialize(432)

sim = solvmod.Tetexact(mdl, mesh, rng)
sim.reset()

tpnts = numpy.arange(0.0, 0.101, 0.001)
ntpnts = tpnts.shape[0]

# And fetch the total number of tets to make the data structures
ntets = mesh.countTets()

# Create the data structures: time points x tetrahedrons
resX = numpy.zeros((ntpnts, ntets))
resY = numpy.zeros((ntpnts, ntets))
Exemplo n.º 3
0
    
    # Make the diff boundary tris with the intersection and convert to list
    tris_DB = tris_compA.intersection(tris_compB)
    tris_DB = list(tris_DB)
    
    # Create the diffusion boundary between compA and compB
    diffb = sgeom.DiffBoundary('diffb', mesh, tris_DB)
    
    return mesh, tets_compA, tets_compB

########################################################################

mdl = gen_model()
mesh, tets_compA, tets_compB = gen_geom()

rng = srng.create_mt19937(256) 
rng.initialize(432) 

sim = solvmod.Tetexact(mdl, mesh, rng)
sim.reset()

tpnts = numpy.arange(0.0, 0.101, 0.001)
ntpnts = tpnts.shape[0]

# And fetch the total number of tets to make the data structures
ntets = mesh.countTets()

# Create the data structures: time points x tetrahedrons
resX = numpy.zeros((ntpnts, ntets))
resY = numpy.zeros((ntpnts, ntets))
Exemplo n.º 4
0
memb_stoch = sgeom.TmPatch('memb_stoch', mesh_stoch, memb_tris, cyto_stoch)
memb_stoch.addSurfsys('ssys_stoch')

# Determinsitic sim:

memb_det = sgeom.TmPatch('memb_det', mesh_det, memb_tris, cyto_det)
memb_det.addSurfsys('ssys_det')

# For EField calculation
print "Creating membrane.."
membrane = sgeom.Memb('membrane', mesh_stoch, [memb_stoch])
print "Membrane created."

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # SIMULATION  # # # # # # # # # # # # # # # # # # # # # #

r = srng.create_mt19937(512)
r.initialize(7)

r_dummy = srng.create_mt19937(512)
r_dummy.initialize(7)

print "Creating Tet exact solver"

#Creating two solvers
sim_stoch = ssolver.Tetexact(mdl_stoch, mesh_stoch, r, True)

print "Creating Tet ODE solver"

sim_det = ssolver.TetODE(mdl_det, mesh_det, r_dummy)

sim_det.setTolerances(1.0e-3, 1.0e-3)