Skip to content

Commit 4a3aa17

Browse files
committed
added action potential diagram
1 parent f3af271 commit 4a3aa17

File tree

4 files changed

+9531
-0
lines changed

4 files changed

+9531
-0
lines changed

diagrams.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,23 @@ plot(plotA, plotB, layout=l, size=(539,250), dpi=300, margin=5Plots.mm, left_mar
6969
title=["A" "B"], titlelocation=:left)
7070
savefig("results/diagrams/possibleProblems.pdf")
7171

72+
ml = CellModel("ohara_rudy_cipa_v1_2017.cellml")
73+
ic = [7.8e-5, -88.0]
74+
prob = ODEProblem(ml.sys, [], (0,50000.0), [ml.sys.intracellular_ions₊ki=>140.0, ml.sys.intracellular_ions₊nai=>6, ml.sys.membrane₊v=>ic[2], ml.sys.intracellular_ions₊cai=>ic[1]], abstol=1e-10, reltol=1e-8)
75+
sol = solve(prob, Tsit5(), saveat=1.0, maxiters=1e9)
7276

77+
plot(sol.t.-49000.0, sol[variable_index(ml.sys, ml.sys.membrane₊v),:], color=:black, legend=nothing; plotParams...)
78+
plot!(sol.t, sol[variable_index(ml.sys, ml.sys.membrane₊v),:], color=:hotpink; plotParams...)
79+
xlims!(0.0, 400.0)
80+
xlabel!("Time (ms)")
81+
plotA = ylabel!("Membrane Voltage (mV)")
7382

83+
my_cgrad = cgrad([:hotpink, :black])
84+
plot(sol, idxs=(ml.sys.intracellular_ions₊cai,ml.sys.membrane₊v), legend=nothing; lc=my_cgrad, line_z=sol.t, plotParams...)
85+
xlabel!("Intracellular Ca²⁺ (μM)")
86+
xaxis!(xformatter=x->x*1e3)
87+
plotB = scatter!([ic[1]], [ic[2]], color=:hotpink; plotParams...)
88+
89+
plot(plotA, plotB, layout=l, size=(539,250), dpi=300, bottom_margin=2Plots.mm,
90+
title=["A" "B"], titlelocation=:left, link=:y)
91+
savefig("results/diagrams/actionPotential.pdf")

0 commit comments

Comments
 (0)