Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
d3f81690
Commit
d3f81690
authored
8 years ago
by
Sam Yates
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/cable-computation' into feature/cable-computation-wip
parents
8e24b2bb
2139d66d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/PassiveCable.jl
+46
-9
46 additions, 9 deletions
scripts/PassiveCable.jl
scripts/README.md
+3
-6
3 additions, 6 deletions
scripts/README.md
with
49 additions
and
15 deletions
scripts/PassiveCable.jl
+
46
−
9
View file @
d3f81690
...
...
@@ -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 conduct
ance
# c: linear membrane capacitance
.
# g: linear membrane conduct
ivity
# 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
This diff is collapsed.
Click to expand it.
scripts/README.md
+
3
−
6
View file @
d3f81690
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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment