Skip to content
Snippets Groups Projects
Commit d3f81690 authored by Sam Yates's avatar Sam Yates
Browse files

Merge branch 'feature/cable-computation' into feature/cable-computation-wip

parents 8e24b2bb 2139d66d
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,12 @@ export cable_normalize, cable, rallpack1
# ∂g/∂x (0, t) = 1
# ∂g/∂x (L, t) = 0
#
# (This implementation converges slowly for small t)
# Parameters:
# x, t, L: as described above
# tol: absolute error tolerance in result
#
# Return:
# g(x, t)
function cable_normalized(x, t, L; tol=1e-8)
if t<=0
......@@ -32,7 +37,7 @@ function cable_normalized(x, t, L; tol=1e-8)
break
end
end
return ginf+sum
return ginf+sum
end
end
......@@ -56,18 +61,37 @@ end
#
# L: length of cable
# r: linear axial resistivity
# g: linear membrane conductance
# c: linear membrane capacitance.
# g: linear membrane conductivity
# c: linear membrane capacitance
# V: membrane reversal potential
# I: injected current on the left end (x = 0) of the cable.
# I: injected axial current on the left end (x = 0) of the cable.
#
# Note that r, g and c are specific 1-d quantities that differ from
# the cable resistivity r_L, specific membrane conductivity ḡ and
# specific membrane capacitance c_m as used elsewhere. If the
# cross-sectional area is A and cable circumference is f, then
# these quantities are related by:
#
# r = r_L/A
# g = ḡ·f
# c = c_m·f
#
# Parameters:
# x: displacement along cable
# t: time
# L, lambda, tau, r, V, I: as described above
# tol: absolute error tolerance in result
#
# Return:
# computed potential at (x,t) on cable.
function cable(x, t, L, lambda, tau, r, V, I; tol=1e-8)
scale = -I*r*lambda;
if scale == 0
return V
return V
else
tol_n = abs(tol/scale)
return scale*cable_normalized(x/lambda, t/tau, L/lambda, tol=tol_n) + V
return scale*cable_normalized(x/lambda, t/tau, L/lambda, tol=tol_n) + V
end
end
......@@ -82,8 +106,21 @@ end
# d = 1 µm cable diameter
# EM = -65 mV reversal potential
# I = 0.1 nA injected current
# L = 1 mm cable length
# L = 1 mm cable length.
#
# (This notation aligns with that used in the Rallpacks paper.)
#
# Note that the injected current as described in the Rallpack model
# is trans-membrane, not axial. Consequently we need to swap the
# sign on I when passing to the cable function.
#
# Parameters:
# x: displacement along cable [m]
# t: time [s]
# tol: absolute tolerance for reported potential.
#
# Return:
# computed potential at (x,t) on cable.
function rallpack1(x, t; tol=1e-8)
RA = 1
......@@ -101,4 +138,4 @@ function rallpack1(x, t; tol=1e-8)
return cable(x, t, L, lambda, tau, r, EM, I, tol=tol)
end
end #module
end # module PassiveCable
tsplot
======
#tsplot
The `tsplot` script is a wrapper around matplotlib for displaying a collection of
time series plots.
......@@ -78,8 +77,7 @@ of the timeseries data.
Use the `-o` or `--output` option to save the plot as an image, instead of
displaying it interactively.
profstats
=========
#profstats
`profstats` collects the profiling data output from multiple MPI ranks and performs
a simple statistical summary.
......@@ -92,8 +90,7 @@ are reported instead.
Output is in CSV format.
PassiveCable.jl
===============
#PassiveCable.jl
Compute analytic solutions to the simple passive cylindrical dendrite cable
model with step current injection at one end from t=0.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment