Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/NikVard/memstim-hh
03 January 2024, 01:25:48 UTC
  • Code
  • Branches (12)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/NewOpt_6Hz
    • refs/heads/PRC_new_params
    • refs/heads/backup_working_june_2022
    • refs/heads/cuda
    • refs/heads/master
    • refs/heads/minimodel
    • refs/heads/revision
    • refs/heads/working_on_figures
    • refs/tags/v1.0
    • refs/tags/v1.0a
    • refs/tags/v1.0b
    • refs/tags/v1.0c
    No releases to show
  • c9ea75c
  • /
  • extracell_stim.txt
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:b9ad27f497260f761c2aebde282535f1e1b77a75
origin badgedirectory badge
swh:1:dir:c9ea75c6b374ab8ae9f7b5eae95cc73c0e9e065e
origin badgerevision badge
swh:1:rev:3db0e522a6c40a756534723c3f127da7b7d19860
origin badgesnapshot badge
swh:1:snp:c2e27ce82d59e51c3aa0d7aaece24f9f6f9a2889

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 3db0e522a6c40a756534723c3f127da7b7d19860 authored by NikVard on 09 June 2022, 17:36:36 UTC
[RESULTS] opt inp EC fin
Tip revision: 3db0e52
extracell_stim.txt
Calculates the transfer resistances between
extracellular stimulating|recording electrode(s) and a
model neuron.  Relies on the principle of reciprocity,
which assumes that the intervening bath and tissue can
be treated as linear.  Suppose a stimulus current of
amplitude Is, applied to a particular configuration of
extracellular electrode(s), produces a potential Vext(x,y,z)
at location (x,y,z).  Then the transfer resistance between
the electrode(s) and (x,y,z) is

        |===============================|
        |   rx(x,y,z) = Vext(x,y,z)/Is  |
        |===============================|

According to the principle of reciprocity, a transmembrane
current Im(x,y,z) generated by membrane at (x,y,z) will
produce a potential Vel that can be recorded at the
extracellular electrode(s) and is given by

        |===============================|
        |   Vel = rx(x,y,z) Im(x,y,z)   |
        |===============================|


-----------------------------------------
How to simulate extracellular stimulation
-----------------------------------------

Insert the extracellular and xtra mechanisms in all sections that are
subject to the extracellular field.
Compute the transfer resistance rx for every section that contains
xtra, as illustrated below.
Construct a stimulus waveform template and copy it to a Vector.
For each internal node along the axon, use this Vector to drive
is_xtra(x).  The xtra mechanism uses the rx values to convert the
stimulus current waveform into the proper amplitude and sign of the
local extracellular field.

If rho, b, or c is changed, new_elec() must be invoked
to make the changes take effect.


-----------------------------------------
Monopolar electrode in an infinite medium
-----------------------------------------

A conductive sphere of radius r0 is suspended in an infinite
volume of solution that has resistivity rho [ohm cm].  Ignoring
electrochemical effects at the electrode|solution interface,
what is the resistance between the surface of the sphere and
an infinitely distant ground electrode?

The surface area of a sphere with radius r is 4 PI r^2.
The resistance of a shell with thickness dr is

        |=======================|
        |   rho dr / 4 PI r^2   |
        |=======================|

and the resistance is therefore

        |===============================================|
        |    inf                                        |
        |  INTEGRAL rho dr / 4 PI r^2                   |
        |    r0                                         |
        |                     inf                       |
        |   = - rho / 4 PI r |     = rho / 4 PI r0      |
        |                     r0                        |
        |===============================================|

So to a first approximation, a monopolar stimulating electrode
that delivers current I produces a field in which potential V
is given by

        |=======================|
        |   V = I rho / 4 PI r  |
        |=======================|

where r is the distance from the center of the electrode.

The principle of superposition may be applied to deal with an
arbitrary number of monopolar electrodes, or even surface
electrodes with different shapes and areas, which are located
at arbitrary positions, and deliver arbitrary stimulus currents.
However, there are some noteworthy special cases.


---------------------------------------------
Special case:  bipolar stimulation of an axon
---------------------------------------------

Imagine a pair of stimulating electrodes that lie along
a line parallel to an axon, like so:

=====================   ---
                         c
       o     o          ---
       |  b  |
       1     2

where b is the separation between the electrodes
and c is the perpendicular distance from them to the axon.

For the sake of this example, assume that the electrodes
straddle the midpoint of the axon.

The extracellular potential at location x produced by electrode
1 is
        |===========================|
        |   V1 = I rho / 4 PI r1    |
        |===========================|
where r1 is the distance from electrode 1 to x.  This distance is

        |===============================================|
        |   r1 = sqrt( ((x-0.5)*L) + 0.5*b)^2 + c^2 )   |
        |===============================================|

Likewise the potential at x produced by electrode 2 is

        |===========================|
        |   V2 = -I rho / 4 PI r2   |
        |===========================|

where r2 is the distance from electrode 2 to x, i.e.

        |===============================================|
        |   r2 = sqrt( ((x-0.5)*L) - 0.5*b)^2 + c^2 )   |
        |===============================================|

The net extracellular potential at x is V1 + V2, i.e.

        |===========================================|
        | Vnet = (I rho / 4 PI)*((1/r1) - (1/r2))   |
        |===========================================|

so the transfer resistance that converts the stimulus current I to
an extracellular potential Vnet is simply

        |=======================================|
        |   rx = (rho / 4 PI)*((1/r1) - (1/r2)) |
        |=======================================|

--------------------------------------------------------
Special case:  uniform field between two parallel plates
--------------------------------------------------------

A uniform field has the same intensity and orientation at all
points in space, and the extracellular potential at any point
is a linear function of displacement in the direction of the
orientation of the field.

If an entire neuron lies in such a field, then without loss of
generality we may assert that the extracellular potential is 0
for all points that lie on some plane that is perpendicular to
the field.  For this "zero potential surface" it is convenient
to choose the plane that passes through a particular location
in the cell, such as the 0 end of the soma.




--------------------------------------------------------
Conventional current flow in a cell
--------------------------------------------------------
https://www.gatsby.ucl.ac.uk/~lmate/biblio/dayanabbott.pdf
--------------------------------------------------------

By convention, current that enters the neuron through an electrode is
defined as positive-inward, whereas membrane current is defined as
positive-outward

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API