path = path.replace('[', '') path = path[:-1] # remove trailing zero from the name of the voltage table primApicalPlotTableNames.append(path) # Define variables to be used for the simulation simTime = 1000e-3 simdt = 10e-6 plotdt = 0.1e-3 for i in range(10): moose.setClock(i, simdt) moose.setClock(8, plotdt) # Use the hsolve method and run the simulation, and then plot the results for the soma and representative # primary apical dendritic compartments u.hsolve(CA1_cell[0], simdt) moose.reinit() moose.start(simTime) plt.figure() t = np.linspace(0, simTime, len(CA1_soma_Vm.vector)) plt.plot(t, CA1_soma_Vm.vector * 1e3, 'r', label='CA1_soma_Vm (mV)') plt.plot(t, primApicalPlotTables[0].vector * 1e3, 'k', label=primApicalPlotTableNames[0] + ' (mV)') plt.plot(t, primApicalPlotTables[1].vector * 1e3, 'b', label=primApicalPlotTableNames[1] + ' (mV)') plt.plot(t, primApicalPlotTables[2].vector * 1e3,
MS_soma_pulse = u.createPulse(MS_cell[0], 'rollingWave', pulse_dur, pulse_amp, pulse_delay1, pulse_delay2) # Create a neutral object to store the data in MS_data = moose.Neutral('/MS_data') MS_tables = [] for comp in MS_cell: MS_tables.append(u.createDataTables(comp,MS_data,MS_soma_pulse)) # Create a variable for the table recording the voltage for the MS cell's soma MS_soma_Vm = MS_tables[0][0] # Define variables needed for running the simulation, and set the clocks for all the channels, compartments, # and tables recording voltage and current during the simulation simTime = 400e-3 simdt = 10e-6 plotdt = 0.2e-3 for i in range(10): moose.setClock(i, simdt) moose.setClock(8, plotdt) # Run the experiment using the hsolve method and plot the voltage for the MS cell soma u.hsolve(MS_cell[0], simdt) moose.reinit() moose.start(simTime) t = np.linspace(0,simTime,len(MS_soma_Vm.vector)) plt.figure() plt.plot(t,MS_soma_Vm.vector, 'r',label = 'soma_Vm') plt.legend()
MS_soma_pulse = u.createPulse(MS_cell[0], 'rollingWave', pulse_dur, pulse_amp, pulse_delay1, pulse_delay2) # Create a neutral object to store the data in MS_data = moose.Neutral('/MS_data') MS_tables = [] for comp in MS_cell: MS_tables.append(u.createDataTables(comp, MS_data, MS_soma_pulse)) # Create a variable for the table recording the voltage for the MS cell's soma MS_soma_Vm = MS_tables[0][0] # Define variables needed for running the simulation, and set the clocks for all the channels, compartments, # and tables recording voltage and current during the simulation simTime = 400e-3 simdt = 10e-6 plotdt = 0.2e-3 for i in range(10): moose.setClock(i, simdt) moose.setClock(8, plotdt) # Run the experiment using the hsolve method and plot the voltage for the MS cell soma u.hsolve(MS_cell[0], simdt) moose.reinit() moose.start(simTime) t = np.linspace(0, simTime, len(MS_soma_Vm.vector)) plt.figure() plt.plot(t, MS_soma_Vm.vector, 'r', label='soma_Vm') plt.legend()
l23_soma_Vm = l23_tables[0][0] l23_soma_Iex = l23_tables[0][1] l23_seg2_dend4_121_Vm = l23_tables[100][0] l23_seg2_dend4_121_Iex = l23_tables[100][1] # Plot the simulation simTime = 0.5 simdt = 2.5e-5 plotdt = 0.25e-3 for i in range(10): moose.setClock(i, simdt) moose.setClock(8, plotdt) # Use the hsolve method for the experiment u.hsolve(l23_cell[0].parent.path, l23_cell[0].path, simdt) moose.reinit() moose.start(simTime) t = np.linspace(0, simTime, len(l23_soma_Vm.vector)) plt.plot(t, l23_soma_Vm.vector * 1e3, 'r', label='l23_soma_Vm (mV)') plt.plot(t, l23_seg2_dend4_121_Vm.vector * 1e3, 'b', label='l23_seg2_dend4_121_Vm (mV)') plt.plot(t, l23_soma_Iex.vector * 1e9, label='l23_soma_Iex (nA)') plt.plot(t, l23_seg2_dend4_121_Iex.vector * 1e9, label='l23_seg2_dend4_121_Iex (nA)') plt.xlabel('time (ms)') plt.legend() plt.show()