How to use a fixed time-step in Python?
Moderator: hines
How to use a fixed time-step in Python?
How do you use a run method with a fixed time-step in python?
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: How to use a fixed time-step in Python?
I like to use NEURON's own standard run library, instead of trying to reinvent it in Python. Also, even though I may be using NEURON as a Python module, I still like to use NEURON's GUI tools for model development and debugging. Consequently, my scripts typically start withImporting NEURON's gui module loads the standard run library and automatically brings up the NEURON Main Menu toolbar. If I don't want to see the toolbar, I start with these two lines instead
Then, after my model specification, instrumentation, and simulation flow control code has been executed, I can
Code: Select all
from neuron import h, gui
Code: Select all
from neuron import h
h.load_file("stdgui.hoc") # doesn't bring up the NEURON Main Menu toolbar
Code: Select all
h.dt = whatever_time_step_I_want
h.tstop = whatever_simulation_duration_I_want
h.run() # execute a simulation with my specified time step and simulation duration
Re: How to use a fixed time-step in Python?
Thank you Ted!