Effects of isoproterenol#
using ModelingToolkit
using OrdinaryDiffEq, SteadyStateDiffEq, DiffEqCallbacks
using Plots
using CSV
using DataFrames
using Dates
using CaMKIIModel
using CaMKIIModel: second, μM
Plots.default(lw=1.5)
Setup model#
sys = build_neonatal_ecc_sys(simplify=true, reduce_iso=true, reduce_camk=true)
tend = 205second
prob = ODEProblem(sys, [], tend)
stimstart = 30second
stimend = 120second
alg = KenCarp47()
KenCarp47(; linsolve = nothing, nlsolve = OrdinaryDiffEqNonlinearSolve.NLNewton{Rational{Int64}, Rational{Int64}, Rational{Int64}, Nothing}(1//100, 10, 1//5, 1//5, false, true, nothing), precs = DEFAULT_PRECS, smooth_est = true, extrapolant = linear, controller = PI, autodiff = ADTypes.AutoForwardDiff(),)
Without isoproterenol#
@unpack Istim = sys
callback = build_stim_callbacks(Istim, stimend; period=1second, starttime=stimstart)
@time sol = solve(prob, alg; callback)
0.861708 seconds (61.80 k allocations: 208.078 MiB, 5.66% gc time)
retcode: Success
Interpolation: 3rd order Hermite
t: 4019-element Vector{Float64}:
0.0
0.019333123284849308
0.09098129546757994
0.20735582943983855
0.45611910276862533
1.0472562928406122
2.0342667657223696
3.451776641148454
6.733792423912806
12.450117081023194
⋮
153526.44479175328
158167.1977440829
163778.17055260652
169613.39023539683
176344.17440754455
183686.48082236035
191261.34859840476
199430.11235309625
205000.0
u: 4019-element Vector{Vector{Float64}}:
[150952.75035000002, 13838.37602, -68.79268, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113 … 0.26081, 0.00977, 0.00188, 0.09243, 0.22156, 0.966, 0.00702, 830.0, 830.0, 0.0026]
[150952.7504077194, 13838.375711519551, -68.79732946186226, 0.1211319185255175, 0.1211301421535992, 0.12113000811850358, 0.12113000037367234, 0.12113000001389383, 0.12113000000038378, 0.12113000000000405 … 0.2608055799112056, 0.009769882842069916, 0.001879826176081169, 0.09242766669618695, 0.2215639938807744, 0.9660018276402699, 0.007020208561323646, 829.9999654017583, 829.9994975880693, 0.0025985659590295374]
[150952.75062244057, 13838.374513299192, -68.81607005265552, 0.12115248970210647, 0.12113624253259858, 0.12113143375871602, 0.12113027926811751, 0.12113004704056851, 0.12113000693481112, 0.12113000089551408 … 0.26078941009382306, 0.009769459049732313, 0.0018789042446514422, 0.09241901973901424, 0.2215787945110049, 0.9660085993318799, 0.00702008986027517, 829.9998348635061, 829.9976422525165, 0.002593310524681686]
[150952.7509740238, 13838.372555328333, -68.84681913285226, 0.12118951551963696, 0.12115723910142134, 0.12114109135582982, 0.12113403405679991, 0.12113131833063846, 0.12113038966346883, 0.12113010483012127 … 0.2607638707001999, 0.009768805322556195, 0.0018766436937193197, 0.09240497563401104, 0.22160283236040595, 0.9660195931792828, 0.007017234889558555, 829.9996133960318, 829.9946506157202, 0.0025849478335103777]
[150952.7517373371, 13838.368384399068, -68.91207316777846, 0.12125418995384041, 0.12120713813483534, 0.12117519662647316, 0.12115494411090462, 0.12114295934422187, 0.12113633873395535, 0.12113292110288301 … 0.2607122383588733, 0.00976754294689657, 0.0018699196262940568, 0.0923749578279845, 0.2216542075240971, 0.9660430731013478, 0.0070030143052343926, 829.9990964774663, 829.9883445519497, 0.00256770780104998]
[150952.75361533565, 13838.358559292059, -69.06429960994137, 0.12136450208851983, 0.1213063255235844, 0.12125925929399752, 0.12122229800810434, 0.12119414515426227, 0.1211733598588045, 0.12115849269665879 … 0.26060507831375035, 0.009765228548607825, 0.001850533769446942, 0.09230364339951613, 0.22177624785138977, 0.9660987611411453, 0.006946470397388757, 829.9976227528975, 829.9738229154025, 0.0025298083713907005]
[150952.75694915713, 13838.34240329337, -69.31024285744343, 0.1214919651325424, 0.12142927821043338, 0.12137426379919636, 0.12132672249013034, 0.12128628091507473, 0.12125242557826561, 0.12122454121844703 … 0.26047114911179464, 0.009763403076884485, 0.0018178174419014683, 0.09218462776986637, 0.2219798989175973, 0.9661914345949096, 0.0068337541728754475, 829.9944193668179, 829.9509077855928, 0.0024748079782158957]
[150952.76215620188, 13838.319723120678, -69.64637448767432, 0.12162015426876954, 0.12155743299711902, 0.12149988983034497, 0.1214475947100359, 0.12140052118634262, 0.12135855488207907, 0.12132150441596071 … 0.2603648729749554, 0.009765046552800477, 0.001773815690753224, 0.09201383579531924, 0.22227216398019892, 0.9663239343003682, 0.006675512062656749, 829.9883533251192, 829.9205247545176, 0.0024106893964811324]
[150952.77598869594, 13838.2694938995, -70.35063788657428, 0.12180447948880577, 0.12174768443532356, 0.12169340184085964, 0.12164180995533558, 0.12159304920072024, 0.12154722283384184, 0.12150439833798556 … 0.26041507667541997, 0.009786689200123853, 0.0016855899094922325, 0.09161908329520764, 0.22294828828976576, 0.9666286957812559, 0.006355039713677859, 829.9689941817725, 829.8589858006806, 0.002310655727734339]
[150952.80529264064, 13838.18882346682, -71.35304509818071, 0.12196378364408163, 0.12191937753328325, 0.12187579038290339, 0.12183318573340735, 0.12179171693004404, 0.12175152667167365, 0.12171274673876366 … 0.26104417804603025, 0.009873892913308327, 0.0015688568862426045, 0.09093422465365385, 0.22412560303273427, 0.9671554512230358, 0.005926150085676071, 829.923524981244, 829.7704141396295, 0.002228995040224517]
⋮
[151185.63271996303, 13607.420744770307, -70.4302348161884, 0.13694139894280224, 0.1369414430455787, 0.13694148299245812, 0.1369415187121598, 0.13694155013050666, 0.13694157717027744, 0.1369415997510502 … 0.001115871921876425, 0.0015675922007142185, 0.0024265453407829604, 0.0015109940954433508, 0.9996108920527997, 0.9997475964480619, 0.006285994984107984, 784.9288194951782, 784.5651195685464, 0.0020423892478309735]
[151213.9820514865, 13579.10337837109, -70.37664808907236, 0.13663059206119085, 0.1366307819959641, 0.13663097008020497, 0.13663115631565806, 0.13663134070413072, 0.13663152324749733, 0.1366317039477027 … 0.001125254953659146, 0.0015738540818366188, 0.00243622868878491, 0.0015227542972160739, 0.9997062441329826, 0.9997446559840227, 0.006308942803914026, 784.9703548384922, 784.6110483772512, 0.002025596348036255]
[151247.4707859165, 13545.68234671984, -70.31452638300428, 0.1362284254035464, 0.1362286933745724, 0.1362289608279094, 0.1362292278063819, 0.1362294943545435, 0.1362297605187657, 0.1362300263473313 … 0.0011361321403911167, 0.0015811391293773418, 0.0024475022360279115, 0.0015364573949932635, 0.9997341439498009, 0.999741209025915, 0.006335649801800576, 784.710815035578, 784.3576255890041, 0.0019962840840810135]
[151281.40730833143, 13511.830273770078, -70.25192438941401, 0.13580483085222794, 0.13580512917629972, 0.1358054276044284, 0.13580572619739376, 0.1358060250184332, 0.13580632413336516, 0.13580662361072404 … 0.0011472363237895954, 0.0015885165744541265, 0.0024589152269754292, 0.001550364434517967, 0.9997378046102854, 0.9997376910754708, 0.006362676888241235, 784.2818300688846, 783.9352586027717, 0.0019619773210087735]
[151319.45625159066, 13473.884533396398, -70.18157444536577, 0.1353244059884437, 0.13532471374553853, 0.1353250219408299, 0.1353253306435225, 0.1353256399256193, 0.13532594986206453, 0.1353262605308951 … 0.0011597793011454969, 0.0015968436474590466, 0.002471803445565834, 0.0015661281800644661, 0.9997353905272031, 0.9997336817909146, 0.006393185710784011, 783.7084117185095, 783.3693899274774, 0.0019216578451939253]
[151359.66360529108, 13433.790648104885, -70.10674036471407, 0.13481737196226234, 0.1348176781731903, 0.13481798499748754, 0.1348182925075189, 0.13481860077857613, 0.134818909889025, 0.13481921992046414 … 0.0011733154729265834, 0.0016057500887353387, 0.002485586302099891, 0.0015830627651549326, 0.9997313181916418, 0.9997293502449399, 0.006425798717944091, 783.0506635590584, 782.7195819977018, 0.0018786735768644713]
[151399.77084350708, 13393.798784235552, -70.03144390841193, 0.13431528917939028, 0.13431558948362363, 0.134315890506408, 0.13431619232102354, 0.13431649500371398, 0.13431679863383686, 0.13431710329402427 … 0.001187067768281088, 0.001614761773043737, 0.0024995313059696035, 0.0016002805636723776, 0.9997269111330217, 0.9997249212169445, 0.006458780060083448, 782.3654997007137, 782.0422250338386, 0.0018362177181686947]
[151441.51334952313, 13352.177701868211, -69.95232653574367, 0.1337978681595882, 0.1337981604976976, 0.13379845363355583, 0.13379874764045427, 0.13379904259464773, 0.13379933857550513, 0.1337996356656704 … 0.0012016936960388958, 0.0016242834845776393, 0.002514267028432434, 0.0016185685393151157, 0.9997221654715737, 0.999720189254976, 0.006493616239628955, 781.6311748610767, 781.3158709750832, 0.0017927643164167015]
[151469.1062615606, 13324.665613785515, -69.8995877691637, 0.1334589696431362, 0.1334592562632754, 0.13345954372358543, 0.1334598320970991, 0.13346012145980135, 0.1334604118907795, 0.13346070347238362 … 0.001211535189043991, 0.0016306617493256203, 0.002524137452356147, 0.0016308722640776022, 0.9997189532437869, 0.999716989943244, 0.006516941283387565, 781.1359820718887, 780.825855861127, 0.0017645015304355055]
i = (sys.t / 1000, sys.vm)
plot(sol, idxs=i, tspan=(100second, 101second), title="Action potential", xlabel="Time (s)")
plot(sol, idxs=(sys.t / 1000, [sys.Cai_sub_SR, sys.Cai_sub_SL, sys.Cai_mean]), tspan=(100second, 101second), title="Calcium transient", xlabel="Time (s)", ylabel="Conc. (μM)", label=["Ca (SR)" "Ca (SL)" "Ca (avg)"])
plot(sol, idxs=(sys.t / 1000, sys.CaMKAct * 100), title="Active CaMKII", label=false, ylabel="Active fraction (%)", xlabel="Time (s)")
0.1uM isoproterenol#
prob2 = remake(prob, p=[sys.ISO => 0.1μM])
sol2 = solve(prob2, alg; callback)
retcode: Success
Interpolation: 3rd order Hermite
t: 4138-element Vector{Float64}:
0.0
0.019332211071584192
0.09097534627605569
0.20734339686524408
0.4561200538541287
1.0549952720719427
2.0687580593126613
3.5324261824253345
6.954473747659736
12.881140201769806
⋮
152270.482708526
157174.07587050938
162194.01343084572
168138.2968837292
174916.2711785474
181898.8442590588
189304.8126535323
197588.12308332036
205000.0
u: 4138-element Vector{Vector{Float64}}:
[150952.75035000002, 13838.37602, -68.79268, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113 … 0.26081, 0.00977, 0.00188, 0.09243, 0.22156, 0.966, 0.00702, 830.0, 830.0, 0.0026]
[150952.75040560117, 13838.37575462767, -68.79688468304944, 0.1211309809540452, 0.12113006189494423, 0.12113000299821446, 0.1211300001166239, 0.12113000000364073, 0.12113000000008267, 0.12113000000000056 … 0.2608055790255411, 0.009769882789165586, 0.0018798283012559313, 0.0924276668078433, 0.221563993694571, 0.9660018275573545, 0.007020212947405008, 830.0014907812235, 829.9994983969723, 0.002598561776347308]
[150952.75061240065, 13838.374716348011, -68.81397720473576, 0.12114238287990785, 0.12113303174274752, 0.12113060640007198, 0.12113010200803158, 0.12113001474369577, 0.12113000185234848, 0.12113000020174947 … 0.26078938725640693, 0.009769457815727975, 0.0018789474208576141, 0.0924190204915213, 0.22157879333123556, 0.9660085988422271, 0.007020182507782679, 830.0069923279007, 829.9976597572193, 0.0025932333906583892]
[150952.75095089723, 13838.373018773336, -68.84205163448622, 0.12116438512395096, 0.12114443083154028, 0.1211353044921302, 0.12113171992467786, 0.12113049616083325, 0.12113012844945044, 0.12113003007199945 … 0.26076374828883014, 0.009768798977675412, 0.0018768406238241547, 0.09240497731310347, 0.22160283004278358, 0.9660195923730465, 0.007017680221388922, 830.0158577065781, 829.9947407323419, 0.002584621446261353]
[150952.7516853767, 13838.369406865842, -68.90160259182096, 0.12120393253792845, 0.1211735958345763, 0.12115399268330548, 0.12114231020892302, 0.12113588865795849, 0.12113262872712134, 0.12113109689132587 … 0.26071163727178975, 0.009767513260722714, 0.0018706615190431774, 0.09237495857236798, 0.22165420888269807, 0.9660430748851897, 0.007004853088813848, 830.0345419613458, 829.9887756080547, 0.0025665030871097365]
[150952.7535137264, 13838.360815589964, -69.0421184107563, 0.12127164038451914, 0.12123369231137104, 0.12120363670655872, 0.12118067468437907, 0.12116376521507281, 0.12115176909538257, 0.12114357362996761 … 0.26060065813180305, 0.009765055027054551, 0.0018527422088444536, 0.09230271445722965, 0.22177785078777174, 0.9660994972023292, 0.006952675605532075, 830.07814410011, 829.9758982053276, 0.002524878616001687]
[150952.75679928518, 13838.346581408403, -69.27157622080777, 0.12134675555621606, 0.12130680044052823, 0.12127196546348169, 0.12124217405786958, 0.12121718646328616, 0.12119663497761278, 0.12118006281992985 … 0.26045565430474177, 0.009762833375314839, 0.0018222096890642774, 0.09218048699222062, 0.22198703092009986, 0.9661946906443825, 0.0068472036120339344, 830.1479502978362, 829.9585434198331, 0.0024610999647757185]
[150952.76194966168, 13838.326681500257, -69.58534388478576, 0.12141446087873138, 0.12137666702212292, 0.12134186045923348, 0.12131020885887851, 0.1212817846915382, 0.12125657408666768, 0.12123448815456439 … 0.26032881924894974, 0.009763716676849107, 0.0017811002406865244, 0.09200417115231563, 0.22228882452599166, 0.9663315006590419, 0.0066990037339929405, 830.2409658671871, 829.9422438990155, 0.002382758683301368]
[150952.77573103318, 13838.282994292276, -70.2425024040955, 0.12148370617698102, 0.12145532836849142, 0.12142753330789133, 0.1214005690310996, 0.1213746427688511, 0.12134992079665144, 0.12132652897086685 … 0.2603166532077402, 0.009783000857592001, 0.0016985405358012685, 0.09159274697262061, 0.22299376432344578, 0.9666490840575152, 0.0063983355059790605, 830.4298664467993, 829.9364424528658, 0.00224983154100249]
[150952.80458617522, 13838.215505646505, -71.1550700755306, 0.12146599978828725, 0.12145339981894898, 0.12143960641561441, 0.1214248044100465, 0.12140916126316065, 0.12139282572293233, 0.12137592664517359 … 0.2607890677215021, 0.009862701804147046, 0.0015916044910949695, 0.09088324181611296, 0.22421393887512645, 0.9671939916127574, 0.006003854581032525, 830.6928613527689, 829.9982399691283, 0.0021239182944550353]
⋮
[150927.44243964477, 13855.447607215145, -70.59411328185895, 0.12690624823440044, 0.12690644090795533, 0.12690662803537645, 0.12690680954291184, 0.12690698535383435, 0.1269071553882897, 0.12690731956313536 … 0.0010878271778290123, 0.001548603549428628, 0.00239716711687104, 0.0014756873624983105, 0.9995674489205066, 0.9997563697872104, 0.0062163295377081875, 922.8372442674187, 921.3111350425961, 0.007314687500374733]
[150962.49883419127, 13820.44213657877, -70.53036749025269, 0.1264398369710111, 0.12644002611567304, 0.12644020991350743, 0.12644038829408089, 0.12644056118411875, 0.12644072850736035, 0.1264408901844048 … 0.0010985560900902895, 0.0015559585586877257, 0.002408552897815156, 0.0014892812418440288, 0.9997032071128493, 0.9997529999609057, 0.006243336397302364, 922.9973924319316, 921.4901697335883, 0.007222908185591536]
[150997.5851447806, 13785.406967560213, -70.46599490737681, 0.12597695883210386, 0.12597714433987964, 0.12597732469363562, 0.12597749982611486, 0.1259776696673488, 0.1259778341445192, 0.12597799318181083 … 0.0011095708614233474, 0.0015634241833132202, 0.0024201048896054177, 0.0015031331537495249, 0.9997381113366618, 0.9997495493507628, 0.006270727254047917, 923.1505571859647, 921.6620339612839, 0.007132108627788957]
[151038.10815861556, 13744.943209004718, -70.39092616170531, 0.12544731797638883, 0.12544749935392432, 0.1254476758012258, 0.12544784725471791, 0.12544801364826227, 0.12544817491302668, 0.12544833097734623 … 0.0011225356004051332, 0.0015721723982217782, 0.002433645224418589, 0.0015194458310223596, 0.9997449540511318, 0.9997454633659696, 0.0063028199835851, 923.3186796689696, 921.851495427501, 0.007028583072486959]
[151082.99594895166, 13700.121307180501, -70.306857698407, 0.12486681616419355, 0.12486699282654704, 0.12486716479673533, 0.12486733201503969, 0.12486749441933476, 0.12486765194496427, 0.12486780452461169 … 0.0011372511454749783, 0.0015820251302674998, 0.0024488971175969793, 0.0015379203395594822, 0.9997426766636632, 0.9997408078698541, 0.006338953534970249, 923.4938704783773, 922.0500067890449, 0.006915552361146806]
[151127.8129954979, 13655.370294655708, -70.22192859279492, 0.12429382988461675, 0.12429400175163735, 0.12429416916677857, 0.12429433207421312, 0.12429449041586403, 0.12429464413129, 0.12429479315756331 … 0.0011523065245155216, 0.0015920470005518002, 0.0024644027678849675, 0.0015568059579758827, 0.9997382835791332, 0.9997360201461427, 0.006375667100933208, 923.6570847693672, 922.2361636951808, 0.006804459822620999]
[151173.8166662841, 13609.4346371349, -70.13370022621129, 0.12371262751436539, 0.12371279442535736, 0.12371295712071585, 0.1237131155483896, 0.1237132696542292, 0.1237134193818802, 0.1237135646726693 … 0.001168074853677619, 0.001602519531316489, 0.0024806130625384818, 0.001576666454910846, 0.9997332832907693, 0.9997309526595424, 0.006414030174549411, 923.8125540402093, 922.4148307661555, 0.00669224172342064]
[151223.4665816097, 13559.858382481325, -70.03725611612131, 0.12309331850759361, 0.12309347992515425, 0.1230936373788461, 0.12309379082060246, 0.1230939402004189, 0.12309408546625425, 0.12309422656392555 … 0.0011856577980904393, 0.0016140477954454193, 0.002498452998586146, 0.0015986588432663127, 0.9997276295974037, 0.9997253010144797, 0.0064562279017628624, 923.9665888847152, 922.5934983762071, 0.006573203249159422]
[151266.33084829495, 13517.057904837635, -69.9529408320393, 0.12256542139115316, 0.1225655780043204, 0.12256573086364972, 0.1225658799243446, 0.12256602513980258, 0.12256616646152295, 0.12256630383900885 … 0.0012012301821887608, 0.0016241926698856934, 0.0025141532138535172, 0.0016181313950702932, 0.9997225836604181, 0.9997202628390546, 0.006493344733523782, 924.0880576542421, 922.7358937568908, 0.006472169342874703]
plot(sol2, idxs=(sys.t / 1000, sys.vm), tspan=(100second, 101second), title="Action potential", xlabel="Time (s)")
plot(sol2, idxs=(sys.t / 1000, [sys.Cai_sub_SR, sys.Cai_sub_SL, sys.Cai_mean]), tspan=(100second, 101second), title="Calcium transcient", xlabel="Time (s)", ylabel="Conc. (μM)", label=["Ca (SR)" "Ca (SL)" "Ca (avg)"])
plot(sol2, idxs=(sys.t / 1000, sys.CaMKAct * 100), title="Active CaMKII", label=false, ylabel="Active fraction (%)", xlabel="Time (s)")
Comparison#
i = (sys.t / 1000, sys.Cai_mean)
tspan = (100second, 101second)
plot(sol, idxs=i, title="Calcium transcient", lab="ISO (-)"; tspan)
plot!(sol2, idxs=i, lab="ISO (0.1uM)", xlabel="Time (s)", ylabel="Concentration (μM)"; tspan)
Compare the numbers
ca_ctl = sol(tspan[1]:1:tspan[2], idxs=sys.Cai_mean)
println(extrema(ca_ctl))
(0.23504331833749528, 0.5781129229554989)
ca_iso = sol2(tspan[1]:1:tspan[2], idxs=sys.Cai_mean)
println(extrema(ca_iso))
(0.19033626526939293, 0.7110939450930591)
savefig("iso-caT.pdf")
savefig("iso-caT.png")
"/home/runner/work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/iso-caT.png"
i = (sys.t / 1000, sys.CaMKAct * 100)
plot(sol, idxs=i, title="Active CaMKII", lab="ISO (-)")
plot!(sol2, idxs=i, lab="ISO (0.1uM)", ylabel="Active fraction (%)", xlabel="Time (s)")
savefig("iso-camkact.pdf")
savefig("iso-camkact.png")
"/home/runner/work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/iso-camkact.png"
i = (sys.t / 1000, sys.vm)
tspan = (100second, 101second)
plot(sol, idxs=i, title="Action potential", lab="ISO (-)"; tspan)
plot!(sol2, idxs=i, lab="ISO (0.1uM)", xlabel="Time (ms)", ylabel="Voltage (mV)"; tspan)
Experimental data#
chemicaldf = CSV.read(joinpath(@__DIR__, "data/CaMKAR-chemical.csv"), DataFrame)
ts = Dates.value.(chemicaldf[!, "Time"]) ./ 10^9
ctl = chemicaldf[!, "Ctrl Mean"]
ctl_error = chemicaldf[!, "Ctrl SD"] ./ sqrt.(chemicaldf[!, "Ctrl N"])
iso = chemicaldf[!, "isoproterenol 100nM Mean"]
iso_error = chemicaldf[!, "isoproterenol 100nM SD"] ./ sqrt.(chemicaldf[!, "isoproterenol 100nM N"])
plot(ts, ctl, yerr=ctl_error, lab="Control", color=:blue, markerstrokecolor=:blue)
plot!(ts, iso, yerr=iso_error, lab="ISO 100nM", color=:red, markerstrokecolor=:red)
plot!(xlabel="Time (sec.)", ylabel="CaMKII activity (A.U.)")
savefig("iso-exp.pdf")
"/home/runner/work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/iso-exp.pdf"
This notebook was generated using Literate.jl.