how is this for a start ....i made changes in calcrxc.hoc. I is the stimulating current emitted by the elctrode. The analytical fromula of the current through electorde has been derived from simple current electricity equations of electric field for a disc and relation between current density and electric field.

.

Code: Select all

```
proc setis() {
forall {
if (ismembrane("xtra")) {
Vnet = (I rho / 4 PI)*(1/r)
I = (2σαπa^2)⁄(4πε[ 1- r/(√(r^2+a^2 ) ) ])
// where α is the charge density and a is the radius
// σ is the conductivity and r is the distance of electrode from soma
{
$1= a
$2= r }
proc setrx() { // now expects xyc coords as arguments
forall {
if (ismembrane("xtra")) {
// avoid nodes at 0 and 1 ends, so as not to override values at internal nodes
for (x,0) {
r = sqrt((x_xtra(x) - xe)^2 + (y_xtra(x) - ye)^2 + (z_xtra(x) - ze)^2)
// r = sqrt((x_xtra(x) - $1)^2 + (y_xtra(x) - $2)^2 + (z_xtra(x) - $3)^2)
// 0.01 converts rho's cm to um and ohm to megohm
rx_xtra(x) = (rho / 4 / PI)*(1/r)*0.01
}
}
}
}
create sElec // bogus section to show extracell stim/rec electrode location
objref pElec // bogus PointProcess just to show stim location
objref gElec // will be a Shape that shows extracellular electrode location
gElec = new Shape(0) // create it but don't map it to the screen yet
// gElec.size(-245.413,275.413,-250,270)
gElec.view(-245.413, -250, 520.827, 520, 629, 104, 201.6, 201.28)
proc drawelec() {
sElec {
// make it 1 um long
pt3dclear()
pt3dadd($1-0.5, $2, $3, 1) // PROBLEM : HOW TO DESCRIBE THE SHAPE OF THE DISC ELECTRODE
pt3dadd($1+0.5, $2, $3, 1)
pElec = new IClamp(0.5)
}
gElec.point_mark(pElec, 2) // make it red
}
[/quote]
proc setelec() {
xe = $1
ye = $2
ze = $3
α = $4
setrx(xe, ye, ze)
drawelec(xe, ye, ze, α ) // to vary the charge density
}
// setrx(50, 0, 0) // put stim electrode at (x, y, z)
setelec(XE, YE, ZE, Q) // put stim electrode at (x, y, z)
xpanel("Extracellular Electrode Location", 0)
xlabel("xyz coords in um")
xvalue("x", "XE", 1, "setelec(XE,YE,ZE,Q)", 0, 1)
xvalue("y", "YE", 1, "setelec(XE,YE,ZE,Q)", 0, 1)
xvalue("z", "ZE", 1, "setelec(XE,YE,ZE,Q)", 0, 1)
xvalue("α", "Q", 1, "setelec(XE,YE,ZE,Q)", 0, 1)
xpanel(855,204)
```