pydstool
pydstool copied to clipboard
step/pulse current injection shape on HH_model.
Is it possible to run the HH model with a pulse shaped current injection and what would be the syntax for doing that? I am thinking it might be possible to break the simulation into three different regimes (or simulations). For the first time block the current injection=0pA and that should be trivial. the subsequent two time blocks do not depend on the first result. It's only the third time block that is hard as it depends on the second time block. Would it be normal to somehow get the final states of the neuron in the second block, and somehow use these as initial conditions for the third time block.
It looks like this tutorial explains how to make a random sinusoidal input by using sympy functions. https://pydstool.github.io/PyDSTool/Tutorial/Tutorial_compneuro.html. I think the trick will be figuring out how to make a step function in sympy using piecewise.
Yes, you can use the syntax from that tutorial, if I recall correctly. But what you see in that tutorial is my own custom syntax, though. This was built before Sympy existed! Sympy could also be used to generate the strings, I'm sure.
I'm guessing you're trying to feed in a pre-determined form of current? If so, you can pre-calculate an array of spike up times and another of spike down times and create "up" and "down" events that cause the integrators to not alias over those times with large steps. The state update actions of those events would be to either add or subtract a value to a current parameter "constant" appearing in your RHS. I.e. it will be quasi-static except for at those event times.
Alternatively, you can build a "hybrid" system using the Model class demo'd elsewhere, but that seems like a lot of overhead cost for this simple use case.
On Sun, May 3, 2020 at 8:48 PM Russell Jarvis [email protected] wrote:
It looks like this tutorial explains how to make a random sinusoidal input by using sympy functions. https://pydstool.github.io/PyDSTool/Tutorial/Tutorial_compneuro.html. I think the trick will be figuring out how to make a step function in sympy using piecewise.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/robclewley/pydstool/issues/152#issuecomment-623213508, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFEUZLC62NY3YJWZXQIIILRPYGFPANCNFSM4MXNUNNQ .
-- Robert Clewley, Ph.D. https://robclewley.com
Hi @robclewley, thanks for your helpful comments and suggestions. It sounds like it could be a lot of work to implement all of this. Conceptually the current source I intend to model is an applied electrode current. I think you are implying, it does not matter in terms of the underlying equations if the current source is ionic, or electron-based, however, building in the square wave current injection could take more time than I have.