I am stimulating a model via a point source, which is located above (z-direction)-- to be able to compute the impact of the stimulation i need to compute the eucledian distance from this point power source to each mid of compartment (see picute).
I tried it this way, but the results are strange -- maybe the computation of the distance is wrong...
x_Mid = np.zeros(nComp)
y_Mid = np.zeros(nComp)
z_Mid = np.zeros(nComp)
for i in range(0, nComp):
y_Mid[i] = 0.
if i == 0:
x_Mid[i] = (lComp[i] / 2.)
z_Mid[i] = 1*elecShift
compDist[i] = distance.euclidean(x_Mid,y_Mid,z_Mid)*10**(-4)
else:
x_Mid[i] = x_Mid[i - 1] + (lComp[i - 1] / 2.) + (lComp[i] / 2.)
z_Mid[i] = 1*elecShift
compDist[i] = distance.euclidean(x_Mid,y_Mid,z_Mid)*10**(-4)
lcomp is the length of the compartment. y - direction is zero, because its a 2D Model. elecshift is the distance of the point source in z-direction and the units are micrometer (therefore then its multiplied by 10^-4 to give it in centimeter). nComp is the number of compartments.
Is the computation of the eucledean distance from the source to each compartment center correct?
