Caffeine Effects

Caffeine Effects#

Caffeine increase RyR opening sensitivity to luminal and subspace calcium In this model, we decrease the mid saturation sub-SR calcium concentration for the opening rate

using ModelingToolkit
using OrdinaryDiffEq
using DiffEqCallbacks
using Plots
using CaMKIIModel
using CaMKIIModel: second, metre, Farad
Plots.default(lw=1.5)
sys = build_neonatal_ecc_sys(simplify=true, reduce_iso=true, reduce_camk=true)
tend = 500.0second
prob = ODEProblem(sys, [], tend)
stimstart = 100.0second
stimend = 300.0second
alg = TRBDF2()
function add_coffee_affect!(integrator)
    integrator.ps[sys.RyRsensitivity] = 10
end

@unpack Istim = sys
callback = build_stim_callbacks(Istim, stimend; period=1second, starttime=stimstart)
SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}, SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}}}((), (SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}(DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}(100000.0:1000.0:300000.0), CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}(-80.0, 1, Istim), DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}}(SciMLBase.INITIALIZE_DEFAULT, true, 100000.0:1000.0:300000.0, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}(-80.0, 1, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing), SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}(DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}(100000.5:1000.0:300000.5), CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}(0.0, 1, Istim), DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}}(SciMLBase.INITIALIZE_DEFAULT, true, 100000.5:1000.0:300000.5, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}(0.0, 1, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing)))

Add caffeine at t = 200 econd

callback_caf = CallbackSet(build_stim_callbacks(Istim, stimend; period=1second, starttime=stimstart), PresetTimeCallback(200.0second, add_coffee_affect!))
SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}, SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}, SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{Vector{Float64}}, typeof(Main.var"##230".add_coffee_affect!), DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, Vector{Float64}, typeof(Main.var"##230".add_coffee_affect!)}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}}}((), (SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}(DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}(100000.0:1000.0:300000.0), CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}(-80.0, 1, Istim), DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}}(SciMLBase.INITIALIZE_DEFAULT, true, 100000.0:1000.0:300000.0, CaMKIIModel.var"#13#15"{Float64, Int64, Symbolics.Num}(-80.0, 1, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing), SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}(DiffEqCallbacks.var"#115#117"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}(100000.5:1000.0:300000.5), CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}(0.0, 1, Istim), DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}}(SciMLBase.INITIALIZE_DEFAULT, true, 100000.5:1000.0:300000.5, CaMKIIModel.var"#14#16"{Float64, Int64, Symbolics.Num}(0.0, 1, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing), SciMLBase.DiscreteCallback{DiffEqCallbacks.var"#115#117"{Vector{Float64}}, typeof(Main.var"##230".add_coffee_affect!), DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, Vector{Float64}, typeof(Main.var"##230".add_coffee_affect!)}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing}(DiffEqCallbacks.var"#115#117"{Vector{Float64}}([200000.0]), Main.var"##230".add_coffee_affect!, DiffEqCallbacks.var"#116#118"{typeof(SciMLBase.INITIALIZE_DEFAULT), Bool, Vector{Float64}, typeof(Main.var"##230".add_coffee_affect!)}(SciMLBase.INITIALIZE_DEFAULT, true, [200000.0], Main.var"##230".add_coffee_affect!), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing)))
@time sol = solve(prob, alg; callback)
@time sol_caf = solve(prob, alg; callback=callback_caf)
 10.049190 seconds (21.47 M allocations: 1.005 GiB, 4.10% gc time, 74.06% compilation time)
  4.783404 seconds (3.98 M allocations: 245.006 MiB, 1.44% gc time, 42.99% compilation time)
retcode: Success
Interpolation: 3rd order Hermite
t: 22255-element Vector{Float64}:
      0.0
      0.00037376965588217846
      0.004111466214703963
      0.03981907054375368
      0.06090491262855715
      0.1655435225566852
      0.2409336011179059
      0.5227875405036884
      1.0858597487365014
      2.388889121726196
      ⋮
 486612.6617039646
 488740.25414558785
 490410.81760149135
 492522.9781453525
 494113.7000322476
 496241.0658518241
 497855.4062649577
 499776.4840116451
 500000.0
u: 22255-element Vector{Vector{Float64}}:
 [0.0026, 830.0, 830.0, 0.00702, 0.966, 0.22156, 0.09243, 0.00188, 0.00977, 0.26081  …  0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, -68.79268, 13838.37602, 150952.75035000002]
 [0.0025999722040421203, 829.9999902796054, 829.9999993331091, 0.007020004989170199, 0.9660000353355825, 0.22156007721482085, 0.09242995488968388, 0.0018799969383422777, 0.009769997724445615, 0.2608099143344817  …  0.12113, 0.12113, 0.12113, 0.12113, 0.12113000000000289, 0.12113000000167641, 0.12113000088893845, -68.79276368828553, 13838.376014261732, 150952.7503511151]
 [0.002599694403132185, 829.9998930912919, 829.9999926601315, 0.007020052852203506, 0.9660003886880141, 0.2215608493616932, 0.09242950378712296, 0.001879965695351556, 0.00976997499090465, 0.2608090581211949  …  0.12113, 0.12113000000000013, 0.12113000000000858, 0.12113000000055028, 0.12113000003391475, 0.12113000196534932, 0.12113010213116475, -68.79361851040093, 13838.375956226279, 150952.75036226763]
 [0.0025970540837836013, 829.9989660442994, 829.9999284703065, 0.007020317408788777, 0.9660037640747009, 0.2215682258389346, 0.09242519428713569, 0.0018796068140212517, 0.009769759976889867, 0.2608009220796936  …  0.12113000002884419, 0.12113000024542142, 0.12113000204735136, 0.12113001662717256, 0.1211301299299577, 0.12113095641447905, 0.12113634992793865, -68.8025264544508, 13838.375374805612, 150952.75046898014]
 [0.0025955058666166115, 829.9984198218226, 829.9998901444599, 0.00702030935044612, 0.966005757011449, 0.22157258164004917, 0.0924226495075652, 0.0018793435797837084, 0.009769634913190547, 0.2607961562482531  …  0.12113000016866177, 0.12113000131087216, 0.12113000976147185, 0.12113006862041213, 0.12113044540549034, 0.12113257965026794, 0.12114263371357109, -68.80807075533095, 13838.375021123176, 150952.75053214436]
 [0.0025879285397901147, 829.9957223730446, 829.9996943632078, 0.007018630287275856, 0.9660156439130673, 0.22159419607659525, 0.09241002145284741, 0.001877559117288867, 0.00976903523890109, 0.2607729421504298  …  0.12113004935055226, 0.12113018010628349, 0.12113063273968475, 0.12113211161381009, 0.12113657158715925, 0.12114860583327054, 0.12117652595466133, -68.83575072020419, 13838.373259639946, 150952.7508472945]
 [0.002582571145852477, 829.9937923939375, 829.9995471212803, 0.00701592369079187, 0.9660227641003213, 0.2216097675784518, 0.09240092362867286, 0.0018758714847454457, 0.009768624210181659, 0.2607566648960162  …  0.12113024326075361, 0.1211307502406234, 0.12113218550388928, 0.12113594251344088, 0.12114488158032216, 0.12116387111038732, 0.12119939012901638, -68.85564804966069, 13838.37199181475, 150952.75107611093]
 [0.002563220542096413, 829.9866743979147, 829.9989475390704, 0.006998097330745275, 0.9660493610162236, 0.22166797415611358, 0.09236691378604592, 0.0018679384237350956, 0.009767233651450798, 0.26069906023032124  …  0.1211345511685702, 0.12113905570282098, 0.1211473005088212, 0.121161551591973, 0.1211846631341102, 0.12121970697706758, 0.12126943143386476, -68.92937968582093, 13838.367272493979, 150952.75194459775]
 [0.0025274511385383024, 829.9728942569965, 829.9975152384703, 0.006942930386866817, 0.9661023923982736, 0.2217842153930329, 0.09229898719097207, 0.0018493158699612237, 0.009765106917158232, 0.2605987293089182  …  0.12116011855975432, 0.12117558659040728, 0.1211971892146648, 0.12122634301778801, 0.12126437969981868, 0.12131243130810888, 0.12137132990552897, -69.07404146936263, 13838.357924241376, 150952.75374091472]
 [0.0024571024140966876, 829.9430246600219, 829.9930651563966, 0.006793945627676893, 0.966224644350509, 0.2220530369627137, 0.09214188544158235, 0.0018064864243286108, 0.009763330551452168, 0.26043481866136947  …  0.12124849189953911, 0.1212797972795032, 0.12131692953907361, 0.1213603007104879, 0.12141021796295101, 0.12146686381610994, 0.1215302791809503, -69.3955791347726, 13838.336695544232, 150952.75820448835]
 ⋮
 [0.10663093135463968, 51.833801958757114, 53.0831993210324, 0.006901842226983083, 0.9996605144226226, 0.9996622974178471, 0.0018405994875986573, 0.002687443187870654, 0.0017361824504691775, 0.001380481506037249  …  0.12945705151790865, 0.1294570664987434, 0.12945707856515815, 0.1294570877782385, 0.12945709419665336, 0.12945709787677315, 0.12945709887278137, -69.0553855310065, 12949.024033726864, 151928.75467423777]
 [0.10643885116990626, 51.87549006528016, 53.123627147569415, 0.006908893707096595, 0.9996594128661092, 0.9996611883786465, 0.0018445632902003796, 0.0026904427523523505, 0.0017381205089287604, 0.0013836514341786029  …  0.12938825775525153, 0.12938827281738402, 0.12938828500982053, 0.1293882943927021, 0.12938830102378895, 0.12938830495857742, 0.12938830625040976, -69.04035993493962, 12942.320602238815, 151935.45907051273]
 [0.10628973397938898, 51.90783185362664, 53.15499283126936, 0.006914399286499663, 0.9996585512250947, 0.9996603208735387, 0.00184766086758371, 0.0026927843686354903, 0.0017396327399653395, 0.0013861630585513748  …  0.12933493798079992, 0.1293349528407408, 0.1293349648588889, 0.12933497409483447, 0.1293349806058088, 0.12933498444679983, 0.12933498567066085, -69.02863845769879, 12937.102122439861, 151940.67829526716]
 [0.10610358408507392, 51.948360286918245, 53.19429918578168, 0.00692132172358208, 0.9996574655650745, 0.9996592279588303, 0.0018515594875548646, 0.0026957294079961443, 0.0017415369219800252, 0.0013893178668121899  …  0.12926822294574672, 0.12926823777742788, 0.12926824979501675, 0.12926825905751665, 0.12926826562159482, 0.12926826954169693, 0.1292682708701551, -69.01391440903629, 12930.560313441345, 151947.22103515454]
 [0.10596501075880334, 51.97855451658163, 53.223584827618296, 0.0069265032978953625, 0.9996566514266632, 0.9996584080059048, 0.0018544809264779522, 0.0026979333108602286, 0.0017429595345154914, 0.0013916904187558667  …  0.12921853537548347, 0.12921855004128055, 0.12921856192578657, 0.12921857108733523, 0.12921857758195182, 0.12921858146346657, 0.12921858278362114, -69.0029018142884, 12925.67456270784, 151952.10747551025]
 [0.10578180676741612, 52.018593629560065, 53.2624198294863, 0.006933398132095497, 0.999655566084218, 0.999657315384611, 0.0018583705726966599, 0.002700867171646529, 0.0017448575104082762, 0.0013948518527983431  …  0.129152792830961, 0.12915280753265945, 0.12915281947311918, 0.12915282871028377, 0.12915283529980162, 0.12915283929513843, 0.1291528407476833, -68.98826217076741, 12919.195183004853, 151958.58776429592]
 [0.10564452602439627, 52.048658380925744, 53.29158325159198, 0.006938596503916651, 0.9996547460849325, 0.9996564894233124, 0.001861307395580847, 0.0027030784645465894, 0.00174628406203988, 0.0013972247724001042  …  0.1291034545603215, 0.1291034690971862, 0.12910348091144952, 0.1291034900602346, 0.12910349659840573, 0.1291035005786787, 0.12910350205172527, -68.9772327682269, 12914.319727631375, 151963.4638947677]
 [0.10548273649593036, 52.08415629238879, 53.326017022214515, 0.006944757955381729, 0.9996537729134001, 0.9996555098500471, 0.0018647883341431572, 0.0027057006798709756, 0.0017479824497694464, 0.0014000906305733781  …  0.12904533500799173, 0.12904534959424513, 0.12904536147126938, 0.12904537069597646, 0.12904537732302235, 0.1290453814049178, 0.12904538299213233, -68.9641723574042, 12908.560844942285, 151969.22357277526]
 [0.10546411454131159, 52.08825892944785, 53.329998054434434, 0.006945469597429997, 0.9996536599760798, 0.9996553961331668, 0.0018651922266818334, 0.002706002809387078, 0.0017481743518270062, 0.001400392445667644  …  0.12903861482880713, 0.1290386292124471, 0.12903864090298628, 0.12903864995681527, 0.12903865642810103, 0.1290386603688958, 0.12903866182923984, -68.9626635601953, 12907.894306232236, 151969.89020297062]
i = (sys.t/1000, sys.vm)
plot(sol, idxs=i, title="Action potential", lab="Ctl", tspan=(198second, 205second))
plot!(sol_caf, idxs=i, lab="Caf", tspan=(198second, 205second), ylabel="Voltage (mV)", xlabel="Time (s)")
_images/7b912de1277829a6fa48c00cdc1e785939b85a115f28100aa6f534ed9010b65c.png
i = (sys.t/1000, sys.Cai_sub_SR * 1000)
plot(sol, idxs=i, title="Calcium transient (During caffeine addition)", lab="Ctl", tspan=(198second, 205second))
plot!(sol_caf, idxs=i, tspan=(198second, 205second), lab="Caf", ylabel="Subspace calcium (nM)", xlabel="Time (s)")
_images/0a57e3c8baea2aa2af17916f8049e16fe7e14161eb13930d0787bfea8447153c.png
i = (sys.t/1000, sys.PO1RyR)
plot(sol, idxs=i, title="RyR open (During caffeine addition)", lab="Ctl", tspan=(198second, 205second))
plot!(sol_caf, idxs=i, tspan=(198second, 205second), lab="Caf", ylabel="Open probability", ylims=(0, 1), xlabel="Time (s)")
_images/775a8b814fd27553b9e0e2c174c817ce081d70c3ce4a4b2901f403e1974c14d9.png
i = (sys.t/1000, sys.Cai_sub_SR * 1000)
plot(sol, idxs=i, title="Calcium transient (After caffeine addition)", lab="Ctl", ylabel="Subspace calcium (nM)", tspan=(198second, 205second))
plot!(sol_caf, idxs=i, lab="Caf", xlabel="Time (s)", tspan=(198second, 205second))
_images/f1a430deb66006e53a5f34a4eb4d4819548785b33924e5bb3fab0e87573d44d4.png
i = (sys.t/1000, sys.CaJSR)
plot(sol, idxs=i, title="SR Calcium (During caffeine addition)", lab="Ctl", ylabel="SR calcium (μM)", tspan=(198second, 205second))
plot!(sol_caf, idxs=i, tspan=(198second, 205second), lab="Caf", ylims=(0, 850), xlabel="Time (s)")
_images/fa9f56410f6cebe81ea96780d018af5127576ea1e0d557526f9313580c595044.png
i = (sys.t/1000, sys.Jrel)
plot(sol, idxs=sys.Jrel, title="Ca flux", lab="Ctl  (Jrel)", tspan=(198second, 205second))
plot!(sol_caf, idxs=sys.Jrel, lab="Caf (Jrel)", tspan=(198second, 205second), ylabel="μM/ms", xlabel="Time (s)")
_images/61d093aa57f549ff46508c93eea8ffeb9be63804e81684e27a59dbf94a386e0a.png
i = (sys.t/1000, sys.CaMKAct*100)
plot(sol, idxs=i, title="Active CaMKII", lab="Ctl")
plot!(sol_caf, idxs=i, lab="Caf", ylabel="CaMKII activity (%)", xlabel="Time (s)")
_images/860d980d4dd4ecd002fc74603114e03140ed689eede3aa2c01b6987a4fceb9a7.png

Add caffeine in the beginning of the simulation Add caffeine and nifedipine in the beginning of the simulation (nifedipine blocks 90% of L-type calcium channel)

prob = ODEProblem(sys, [], tend)
prob_caf = ODEProblem(sys, [sys.RyRsensitivity => 10], tend)
prob_nif_caf = ODEProblem(sys, [sys.RyRsensitivity => 10, sys.GCaL => 6.3e-6 * (metre^3 / second / Farad)], tend)
@time sol = solve(prob, alg; callback)
@time sol_caf = solve(prob_caf, alg; callback)
@time sol_nif_caf = solve(prob_nif_caf, alg; callback)
  2.583087 seconds (181.24 k allocations: 45.042 MiB)
  2.792333 seconds (180.24 k allocations: 44.797 MiB, 1.78% gc time)
  1.963091 seconds (131.62 k allocations: 32.928 MiB)
retcode: Success
Interpolation: 3rd order Hermite
t: 16155-element Vector{Float64}:
      0.0
      0.00036475171141220293
      0.0040122688255342315
      0.04002730220813219
      0.06107844755187036
      0.1668983916346115
      0.24249368910866453
      0.5251299051276579
      0.9022279165786617
      1.4954385373044485
      ⋮
 436720.0038013915
 445297.82828101015
 451990.2195297975
 461048.46857879194
 468119.9009713256
 477565.21371905616
 484800.21770803235
 494503.53485934966
 500000.0
u: 16155-element Vector{Vector{Float64}}:
 [0.0026, 830.0, 830.0, 0.00702, 0.966, 0.22156, 0.09243, 0.00188, 0.00977, 0.26081  …  0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, -68.79268, 13838.37602, 150952.75035000002]
 [0.002881414080688233, 829.9999900007011, 829.9999993491982, 0.007020004868481778, 0.9660000344830407, 0.22156007535185795, 0.09242995597806056, 0.0018799970119809143, 0.009769997779353121, 0.2608099164014243  …  0.12113, 0.12113, 0.12113, 0.12113, 0.12113000000000237, 0.12113000000141301, 0.12113000076773925, -68.79276560477784, 13838.376014400332, 150952.75035108818]
 [0.0056903371180321355, 829.9998336327583, 829.9999928348275, 0.007020051540249714, 0.9660003793101553, 0.22156082886912407, 0.0924295157592094, 0.001879966495895616, 0.009769975594908279, 0.2608090808564513  …  0.12113, 0.1211300000000001, 0.12113000000000675, 0.12113000000044309, 0.12113000002796506, 0.12113000165956452, 0.12113008831340845, -68.79363878362669, 13838.3759577802, 150952.75036197167]
 [0.032934099095573155, 829.9928691663874, 829.999925379402, 0.007020309265302052, 0.9660037837501684, 0.2215682688502424, 0.09242516915306638, 0.001879600285250946, 0.009769758851464522, 0.26080087707274063  …  0.12113000002734017, 0.12113000023107437, 0.12113000191500475, 0.12113001545253044, 0.12113012000652665, 0.1211308783265025, 0.1211358031591632, -68.80301122940901, 13838.375371387816, 150952.75046961164]
 [0.04845954062434818, 829.9843099930077, 829.9998809706561, 0.0070202888803573334, 0.9660057733969225, 0.2215726174771995, 0.092422628557034, 0.0018793318811433102, 0.009769634159822276, 0.2607961222598588  …  0.12113000015694668, 0.12113000121394736, 0.12113000899953864, 0.12113006301082618, 0.12113040756825297, 0.12113235368422906, 0.1211415008629613, -68.80877438190502, 13838.3750182532, 150952.75053268392]
 [0.12249340194671875, 829.8938808274231, 829.9994935105087, 0.007018454535795249, 0.966015771783877, 0.22159447585212536, 0.09240985789413826, 0.0018774698016990696, 0.009769029658558939, 0.2607726843364273  …  0.1211300466703991, 0.12113016924229485, 0.1211305909225847, 0.12113196051942055, 0.12113606794649627, 0.1211470940033699, 0.12117255712944325, -68.8379060332804, 13838.373236887359, 150952.75085153757]
 [0.1715930670872126, 829.783280710597, 829.9989422934403, 0.007015579198270167, 0.9660229111809449, 0.22161008963759207, 0.0924007352519633, 0.0018757132204526082, 0.009768619958763226, 0.2607564120441743  …  0.12113022711192183, 0.12113069722094749, 0.12113202217234244, 0.12113547576279987, 0.12114366044302344, 0.12116098489185753, 0.12119328842802841, -68.85866724382264, 13838.371965688524, 150952.75108116557]
 [0.33135908238275885, 829.0772990100361, 829.9926277627656, 0.006996827028508365, 0.9660495808706687, 0.22166845711540134, 0.09236663063619181, 0.0018674374022966747, 0.009767241235264462, 0.2606989741713034  …  0.12113418133148192, 0.12113830310107347, 0.1211458310881784, 0.1211588160045623, 0.12117983312332559, 0.12121164601699083, 0.12125671988919788, -68.93560684206878, 13838.36723381244, 150952.7519533319]
 [0.4942785209264842, 827.5511018321371, 829.9674290341039, 0.006959796991612045, 0.9660851091624832, 0.22174630990118804, 0.0923211357302274, 0.001854550976859026, 0.009765759408367882, 0.26063044296696103  …  0.12114818970467729, 0.12115917322872678, 0.12117532988808091, 0.12119817430421628, 0.12122923378521067, 0.12126990013747838, 0.12132127480868056, -69.0367777434646, 13838.360964207946, 150952.7531503815]
 [0.6617658258109778, 824.2569967941822, 829.8692786368507, 0.006891099399353022, 0.9661408795709098, 0.22186873309829802, 0.09224958752109774, 0.0018337658395346254, 0.009764219016141242, 0.2605403542577031  …  0.12118128446541485, 0.1212010381606475, 0.121226437667901, 0.12125834265281407, 0.12129752004113319, 0.12134458053000763, 0.1213999195522129, -69.19255122058674, 13838.35120081545, 150952.75510990858]
 ⋮
 [0.07963251411545524, 59.00174086721622, 60.06381808240351, 0.007152709860849698, 0.9996197155329946, 0.9996203827995135, 0.0019848646863217297, 0.0027942953532360142, 0.0018052683084231907, 0.0014982397799254941  …  0.11895383234456797, 0.11895384433769421, 0.11895385518712524, 0.11895386491805907, 0.118953873554696, 0.11895388112028775, 0.11895388763718338, -68.52996987433409, 12448.44557885437, 152430.31244369433]
 [0.07941752222747896, 59.07399045848713, 60.13448173599073, 0.007162447445454122, 0.9996180700186968, 0.9996187090845868, 0.0019905546480690874, 0.0027984493395031506, 0.001807953015007052, 0.0015028943598807162  …  0.11886179002528356, 0.11886180158412138, 0.11886181204390364, 0.11886182142885078, 0.11886182976222436, 0.11886183706637393, 0.11886184336278155, -68.50994758015761, 12439.501236094113, 152439.25564099714]
 [0.07925603499507897, 59.12842256863578, 60.18772131333837, 0.007169815577884025, 0.9996168217998433, 0.9996174478424958, 0.0019948651784746584, 0.0028015928749739265, 0.0018099846637225328, 0.0015064218837849334  …  0.1187925524954564, 0.11879256375013485, 0.11879257393898239, 0.11879258308549746, 0.11879259121224812, 0.11879259834091777, 0.11879260449234796, -68.49481340498399, 12432.755162706899, 152446.0008439461]
 [0.07904586925877806, 59.19954776593662, 60.25729307126008, 0.007179482067911173, 0.9996151797861818, 0.999615780550362, 0.0020005280411907484, 0.002805717325316124, 0.0018126502974262259, 0.001511056925424752  …  0.11870230396977006, 0.1187023147921485, 0.11870232459276955, 0.11870233339416515, 0.11870234121797527, 0.11870234808499154, 0.11870235401519837, -68.47498378393762, 12423.936546021221, 152454.8183024981]
 [0.07888819650311568, 59.25306084116173, 60.309639408651236, 0.007186786913639246, 0.9996139359057818, 0.9996145247027721, 0.0020048121783723147, 0.002808834461384831, 0.0018146648913290647, 0.0015145648450641414  …  0.11863450051656654, 0.11863451104150553, 0.11863452057697181, 0.11863452914479575, 0.11863453676594345, 0.11863454346055906, 0.11863454924800473, -68.46001507015009, 12417.293933337529, 152461.46003722618]
 [0.07868603611382788, 59.32195249511549, 60.377033854363376, 0.007196227817579798, 0.9996123239649437, 0.999612887610269, 0.0020103567242217542, 0.002812863449533888, 0.0018172688397119392, 0.001519105549943053  …  0.11854743224445081, 0.11854744234168466, 0.11854745149212226, 0.11854745971665615, 0.11854746703535173, 0.1185474734674878, 0.11854747903159472, -68.44069328782211, 12408.739230826302, 152470.01358859148]
 [0.07853737008129463, 59.372746380819954, 60.42672548783, 0.007203218543670386, 0.9996111275864002, 0.9996116801334681, 0.002014466639593038, 0.002815847111437858, 0.0018191971766866192, 0.0015224726650136093  …  0.11848331748916352, 0.11848332730570718, 0.11848333620585481, 0.11848334420983835, 0.11848335133708877, 0.11848335760627528, 0.1184833630353423, -68.42640084300201, 12402.42419866878, 152476.32776703654]
 [0.07834613136526897, 59.43834759729166, 60.49090771584751, 0.007212281187977291, 0.9996095725862264, 0.9996101005771788, 0.0020198018133044415, 0.0028197153924245768, 0.0018216972708281366, 0.0015268442307947614  …  0.11840072021184463, 0.11840072961294802, 0.11840073813822363, 0.1184007458070101, 0.11840075263788043, 0.11840075864867937, 0.1184007638565591, -68.4078948192607, 12394.265585301884, 152484.48525786275]
 [0.0782417131465239, 59.474226488971645, 60.526011009435194, 0.00721725638654073, 0.9996087173712063, 0.9996092407082391, 0.002022732978410147, 0.0028218392023337292, 0.0018230698833654614, 0.0015292470417554791  …  0.11835557283317254, 0.11835558204752844, 0.11835559040715138, 0.11835559793092457, 0.11835560463698362, 0.1183556105427532, 0.11835561566498153, -68.39774305667318, 12389.797352751797, 152488.95287629392]
i = (sys.t/1000, sys.vm)
tspan = (198second, 205second)
plot(sol, idxs=i, title="Action potential", lab="Ctl"; tspan)
plot!(sol_caf, idxs=i, lab="Caf"; tspan)
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", tspan=tspan, ylabel="Voltage (mV)", xlabel="Time (s)")
_images/ee4b2fc7c30e4b28f26c087f558f6c7b5215b66942f20e0dcde7b3ff29fe654f.png
i = (sys.t/1000, sys.Cai_sub_SR * 1000)
tspan=(198second, 205second)
plot(sol, idxs=i, title="Calcium transient", lab="Ctl";tspan)
plot!(sol_caf, idxs=i, lab="Caf", ylabel="Subspace calcium (nM)";tspan)
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", ylabel="Subspace calcium (nM)", xlabel="Time (s)";tspan)
_images/c5b1f9b904c42ee8be592d3e3fa36477558b5967fd35cc3ec42e2539044b09f9.png
i = (sys.t/1000, sys.CaJSR)
tspan=(198second, 205second)
plot(sol, idxs=i, title="SR Calcium", lab="Ctl", ylabel="SR calcium (μM)"; tspan)
plot!(sol_caf, idxs=i, lab="Caf"; tspan)
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", ylims=(0, 850), xlabel="Time (s)"; tspan)
_images/ee2617534eadfa0c4e84461e39f95e2c52b57ba77040d78ccd04a812a72f8f13.png
i = (sys.t/1000, sys.CaMKAct*100)
plot(sol, idxs=i, title="CaMKII", lab="Ctl")
plot!(sol_caf, idxs=i, lab="Caf")
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", ylabel="Active fraction (%)", xlabel="Time (s)")
_images/a96c121a6ed9223e2d0560e8be8352a5478c523fcdce9586dc37c6a37254ba6a.png

This notebook was generated using Literate.jl.