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.866076 seconds (65.78 k allocations: 215.070 MiB, 6.40% gc time)
retcode: Success
Interpolation: 3rd order Hermite
t: 4071-element Vector{Float64}:
0.0
0.019333123284849308
0.09098129546757994
0.20735582943983855
0.45611910276862533
1.0472562928406122
2.0342667657223696
3.451776641148454
6.733792423912806
12.450117081023194
⋮
153525.25012366346
158165.8598019807
163776.6411118618
169611.6642461836
176342.19489586214
183684.1140466068
191258.90946281631
199427.37350661293
205000.0
u: 4071-element Vector{Vector{Float64}}:
[0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113 … 0.9911, 0.61179, 0.09243, 0.00702, 0.966, 0.22156, 0.07192, 150952.75035000002, 13838.37602, -68.79268]
[0.12112999999999999, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113 … 0.9911240298625772, 0.61179209692054, 0.09242766669618695, 0.007020208561323646, 0.9660018276402699, 0.2215639938807744, 0.07192100954852718, 150952.7504077194, 13838.375711519551, -68.79732946186226]
[0.12113000000531939, 0.12113000000024629, 0.12112999999996936, 0.12112999999998814, 0.12112999999999756, 0.12112999999999959, 0.12112999999999993, 0.12112999999999999, 0.12112999999999999, 0.12113 … 0.9912126672514168, 0.6118012235185329, 0.09241901973901424, 0.00702008986027517, 0.9660085993318799, 0.2215787945110049, 0.0719247622956487, 150952.75062244057, 13838.374513299192, -68.81607005265552]
[0.12113000352486501, 0.12113000071464508, 0.12113000013259279, 0.12113000002221791, 0.12113000000324825, 0.12113000000037327, 0.12113000000001811, 0.12112999999999313, 0.12112999999999685, 0.12112999999999911 … 0.9913552605900093, 0.6118207061207029, 0.09240497563401104, 0.007017234889558555, 0.9660195931792828, 0.22160283236040595, 0.07193089713793946, 150952.7509740238, 13838.372555328333, -68.84681913285226]
[0.12113031246875829, 0.12113011855881943, 0.12113004261415268, 0.1211300145224514, 0.1211300046922744, 0.12113000143526587, 0.12113000041393686, 0.12113000011158663, 0.12113000002760377, 0.12113000000599933 … 0.9916544804172969, 0.6118814305717646, 0.0923749578279845, 0.0070030143052343926, 0.9660430731013478, 0.2216542075240971, 0.07194417536281429, 150952.7517373371, 13838.368384399068, -68.91207316777846]
[0.12113664606535107, 0.12113391404700644, 0.12113223891788369, 0.12113124406405289, 0.12113067160353039, 0.12113035232069681, 0.12113017964115647, 0.12113008904213221, 0.12113004292180056, 0.12113002016884632 … 0.9923360674037417, 0.6121262615921059, 0.09230364339951613, 0.006946470397388757, 0.9660987611411453, 0.22177624785138977, 0.07197662797870664, 150952.75361533565, 13838.358559292059, -69.06429960994137]
[0.12116110329207945, 0.12115245907382813, 0.12114597183088456, 0.12114118504637392, 0.12113771307938385, 0.12113523852752958, 0.12113350680291797, 0.1211323190247843, 0.12113152423329539, 0.1211310117677002 … 0.9933874251519441, 0.6128292434834117, 0.09218462776986637, 0.0068337541728754475, 0.9661914345949096, 0.2219798989175973, 0.07203363801526848, 150952.75694915713, 13838.34240329337, -69.31024285744343]
[0.12120423665656944, 0.12118928168345969, 0.12117695409406527, 0.12116690224321353, 0.12115880345210753, 0.12115236793976296, 0.12114734156698287, 0.12114350756515986, 0.12114068746411359, 0.12113874145120666 … 0.9947260029718878, 0.61441610851668, 0.09201383579531924, 0.006675512062656749, 0.9663239343003682, 0.22227216398019892, 0.0721216517759309, 150952.76215620188, 13838.319723120678, -69.64637448767432]
[0.1212995420290433, 0.12127783468666772, 0.1212589040374779, 0.1212425879351912, 0.12122873583441052, 0.12121721111566237, 0.12120789316717222, 0.12120067917599112, 0.12119548558727024, 0.1211922491964778 … 0.9971828595843288, 0.6201838932607627, 0.09161908329520764, 0.006355039713677859, 0.9666286957812559, 0.22294828828976576, 0.07235305497134359, 150952.77598869594, 13838.2694938995, -70.35063788657428]
[0.1214553971027536, 0.12143259661681072, 0.12141268299068807, 0.12139558631643757, 0.12138124198529929, 0.12136959056512987, 0.12136057763401646, 0.12135415355743052, 0.1213502731984364, 0.12134889555279481 … 0.9999327439121073, 0.6347673874618533, 0.09093422465365385, 0.005926150085676071, 0.9671554512230358, 0.22412560303273427, 0.07284451729172227, 150952.80529264064, 13838.18882346682, -71.35304509818071]
⋮
[0.136944495257914, 0.13694464168446063, 0.13694477927589319, 0.13694490832270664, 0.13694502909967796, 0.13694514186691303, 0.13694524687081178, 0.1369453443449584, 0.13694543451094182, 0.13694551757911558 … 1.0026877925575108, 0.6766722833255902, 0.0015108660008013646, 0.006285742961034189, 0.9997476285219717, 0.9996108819600831, 0.21502044147161872, 151185.30233112013, 13607.749833006827, -70.43082440918054]
[0.13664016534264506, 0.1366400331279381, 0.13663989917287367, 0.13663976347078083, 0.13663962601534282, 0.13663948680057011, 0.13663934582077958, 0.13663920307057698, 0.13663905854483405, 0.13663891223867514 … 1.0027051646252927, 0.6747144423902359, 0.0015226265701692074, 0.00630869251132918, 0.9997446880935223, 0.9997062624414005, 0.21356234238165345, 151213.6576494461, 13579.426508631252, -70.37723151711738]
[0.1362414605254136, 0.13624117441594705, 0.13624089059415417, 0.13624060888608422, 0.13624032912718922, 0.13624005116169596, 0.13623977484202918, 0.13623950002827942, 0.1362392265877109, 0.1362389543943081 … 1.0027275840143766, 0.6724373059628208, 0.0015363302060714499, 0.006335401714922122, 0.9997412411483091, 0.9997341725464178, 0.2118959175846982, 151247.1533714861, 13545.998515545498, -70.31510224724597]
[0.13581920216270763, 0.1358188513034548, 0.13581850453059624, 0.13581816159716312, 0.1358178222695365, 0.1358174863265588, 0.13581715355871082, 0.13581682376735918, 0.13581649676405635, 0.13581617236989735 … 1.0027511617889564, 0.6701344182004167, 0.0015502379269453598, 0.006362431269317443, 0.9997377231755967, 0.9997378359259564, 0.21023439044504946, 151281.09701808463, 13512.139339623407, -70.25249211840398]
[0.13533918755768654, 0.13533880976553916, 0.13533843694677725, 0.13533806882010846, 0.13533770511944831, 0.13533734559290653, 0.13533699000185287, 0.13533663812005645, 0.1353362897328906, 0.13533594463659865 … 1.0027778381735508, 0.6675367953217555, 0.0015660024919753083, 0.006392942940490192, 0.9997337138514424, 0.999735422516465, 0.2083826667107878, 151319.15383306387, 13474.185747617707, -70.18213292915296]
[0.13483207932686891, 0.1348316949295837, 0.13483131588740194, 0.13483094190623104, 0.13483057270787868, 0.13483020802899134, 0.13482984762008002, 0.13482949124461824, 0.13482913867821186, 0.13482878970783113 … 1.0028059363845845, 0.6647624336093093, 0.0015829377999888926, 0.00642555866251243, 0.9997293823003751, 0.9997313503264379, 0.206427932151761, 151359.36895294566, 13434.084114116045, -70.10728981816584]
[0.13432970515101228, 0.13432932255258645, 0.13432894547470195, 0.13432857361953415, 0.13432820670535936, 0.1343278444654811, 0.13432748664724223, 0.13432713301111254, 0.13432678332984782, 0.13432643738771197 … 1.002833693458643, 0.6619592743096098, 0.001600157158632393, 0.006458544300803309, 0.9997249530520707, 0.999726943082142, 0.20447531389534854, 151399.48570823882, 13394.082755688212, -70.03198079055889]
[0.13381191387915126, 0.13381153670375415, 0.13381116512874722, 0.13381079885627492, 0.1338104376045839, 0.13381008110694892, 0.1338097291106855, 0.13380938137623702, 0.13380903767633368, 0.13380869779521487 … 1.0028622311424582, 0.6590016440086386, 0.0016184463726736293, 0.006493384188983989, 0.9997202209587297, 0.9997221973027172, 0.2024385339404032, 151441.23701638906, 13352.452891572486, -69.95285215574391]
[0.13347257294853768, 0.13347220034900273, 0.13347183337487792, 0.1334714717294034, 0.1334711151318615, 0.13347076331650717, 0.13347041603158324, 0.13347007303841205, 0.13346973411055676, 0.13346939903304705 … 1.0028808984916584, 0.6570221579287225, 0.001630757442566722, 0.006516724021089381, 0.999717019859629, 0.9997189832869459, 0.20108851592438548, 151468.85017708497, 13324.92061087142, -69.90007814148863]
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.29627423352
174916.26987407374
181898.84288967986
189304.81198883272
197588.1225791665
205000.0
u: 4138-element Vector{Vector{Float64}}:
[0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113 … 0.9911, 0.61179, 0.09243, 0.00702, 0.966, 0.22156, 0.07192, 150952.75035000002, 13838.37602, -68.79268]
[0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113 … 0.9911240291173739, 0.611792089769367, 0.0924276668078433, 0.007020212947405008, 0.9660018275573545, 0.221563993694571, 0.07192100944202194, 150952.75040560117, 13838.37575462767, -68.79688468304944]
[0.1211299999978007, 0.1211299999999658, 0.12113000000002166, 0.12113000000000518, 0.12113000000000085, 0.12113000000000013, 0.12113000000000002, 0.12113, 0.12112999999999999, 0.12113000000000002 … 0.9912126667196595, 0.611801066958859, 0.0924190204915213, 0.007020182507782679, 0.9660085988422271, 0.22157879333123556, 0.07192476067797532, 150952.75061240065, 13838.374716348011, -68.81397720473576]
[0.12112999781971412, 0.12112999962313838, 0.12112999994113084, 0.12112999999189158, 0.12112999999908225, 0.1211299999999368, 0.12113000000000583, 0.12113000000000368, 0.12113000000000099, 0.12113000000000024 … 0.9913552735585923, 0.611819898290472, 0.09240497731310347, 0.007017680221388922, 0.9660195923730465, 0.22160283004278358, 0.07193088967634093, 150952.75095089723, 13838.373018773336, -68.84205163448622]
[0.12112972563319256, 0.12112990759315156, 0.12112997068409384, 0.12112999123550759, 0.12112999753371165, 0.12112999934946422, 0.12112999984067122, 0.12112999996451587, 0.12112999999317194, 0.12112999999904253 … 0.9916545845784881, 0.6118775667784718, 0.09237495857236798, 0.007004853088813848, 0.9660430748851897, 0.22165420888269807, 0.0719441422583465, 150952.7516853767, 13838.369406865842, -68.90160259182096]
[0.12112172226557849, 0.12112544864794925, 0.12112757984503172, 0.12112875509801761, 0.12112938033983175, 0.12112970144278692, 0.12112986073574183, 0.12112993711100782, 0.12112997251861213, 0.12112998839513431 … 0.9923451140963176, 0.6121101324552718, 0.09230271445722965, 0.006952675605532075, 0.9660994972023292, 0.22177785078777174, 0.07197688095549924, 150952.7535137264, 13838.360815589964, -69.0421184107563]
[0.12108320675185186, 0.12109751136797291, 0.12110783977508154, 0.12111515330966482, 0.12112023145947025, 0.1211236888390356, 0.12112599709349386, 0.12112750878014665, 0.12112848091296483, 0.12112909658467862 … 0.9934234092046006, 0.612784930526601, 0.09218048699222062, 0.0068472036120339344, 0.9661946906443825, 0.22198703092009986, 0.07203498339671345, 150952.75679928518, 13838.346581408403, -69.27157622080777]
[0.12100627398608915, 0.12103377716932152, 0.12105592412265258, 0.12107356524611505, 0.12108746617645912, 0.12109830495520997, 0.12110667284944596, 0.12111307827105494, 0.1211179531647004, 0.12112166121918473 … 0.9947990162223073, 0.6143161759192289, 0.09200417115231563, 0.0066990037339929405, 0.9663315006590419, 0.22228882452599166, 0.07212474396530921, 150952.76194966168, 13838.326681500257, -69.58534388478576]
[0.12082225740230308, 0.12086895051124522, 0.12090985289261343, 0.12094555023486525, 0.12097660749932772, 0.12100356610874986, 0.12102694182714453, 0.12104722332390591, 0.1210648713862099, 0.1210803187179404 … 0.9973271689584888, 0.6199361773339749, 0.09159274697262061, 0.0063983355059790605, 0.9666490840575152, 0.22299376432344578, 0.07236118189224293, 150952.77573103318, 13838.282994292276, -70.2425024040955]
[0.12056203576646748, 0.12062672809368212, 0.12068618564412109, 0.12074080003619954, 0.12079095457787399, 0.12083702290171043, 0.1208793676313429, 0.12091833908998409, 0.12095427405948181, 0.12098749459643647 … 1.0000973131752693, 0.6339761854481466, 0.09088324181611296, 0.006003854581032527, 0.9671939916127574, 0.22421393887512645, 0.07285328220083996, 150952.80458617522, 13838.215505646505, -71.1550700755306]
⋮
[0.1269091035059655, 0.1269091478953703, 0.12690918191057013, 0.12690920585086127, 0.12690921999936527, 0.12690922462410742, 0.1269092199790097, 0.12690920630480712, 0.12690918382989289, 0.12690915277109957 … 1.0032363778515994, 0.6825988690960976, 0.0014756873624897583, 0.006216329537690998, 0.9997563697872125, 0.9995674489205095, 0.21944855504046362, 150927.44243962396, 13855.447607237576, -70.59411328189955]
[0.12644270689218537, 0.12644274574943215, 0.12644277464927509, 0.12644279387751783, 0.12644280370451932, 0.12644280438622363, 0.1264427961651079, 0.1264427792710576, 0.12644275392217302, 0.1264427203255158 … 1.0032613036629934, 0.680292393087557, 0.0014892812418357655, 0.00624333639728582, 0.9997529999609082, 0.9997032071128534, 0.21772189979562487, 150962.49883417095, 13820.442136600703, -70.53036749029185]
[0.12597983537051569, 0.1259798691172972, 0.12597989330863052, 0.1259799082173258, 0.1259799141014521, 0.1259799112053199, 0.12597989976038673, 0.1259798799860916, 0.12597985209062568, 0.12597981627164417 … 1.0032859942362011, 0.6779542447200005, 0.001503133153741207, 0.006270727254031289, 0.9997495493507651, 0.9997381113366642, 0.21598787718713613, 150997.5851447608, 13785.40696758166, -70.46599490741585]
[0.12545020511187915, 0.12545023285321324, 0.1254502515039194, 0.12545026132186243, 0.12545026255097408, 0.12545025542218188, 0.1254502401542649, 0.12545021695464242, 0.12545018602010258, 0.125450147537475 … 1.0033141903375633, 0.6752163179377441, 0.0015194458293452875, 0.006302819980296305, 0.9997454633663904, 0.9997449540510904, 0.21397820836138284, 151038.10815449717, 13744.94321311873, -70.39092616937891]
[0.12486970350391131, 0.12486972522617236, 0.12486973834834862, 0.12486974311265439, 0.12486973974821655, 0.12486972847194712, 0.1248697094893477, 0.12486968299524859, 0.1248696491744957, 0.12486960820257982 … 1.00334502563846, 0.6721358889083349, 0.0015379203360091655, 0.006338953528048526, 0.9997408078707524, 0.9997426766643989, 0.2117434626483751, 151082.99594042654, 13700.121315694732, -70.30685771446615]
[0.12429671621113456, 0.12429673188974771, 0.1242967394639483, 0.12429673916010314, 0.124296731192349, 0.12429671576340796, 0.12429669306533843, 0.12429666328022775, 0.12429662658083133, 0.12429658313116347 … 1.0033753931250984, 0.6690087581447743, 0.0015568059542798941, 0.006375667093769877, 0.9997360201470835, 0.9997382835800526, 0.20950321339328734, 151127.8129868295, 13655.370303312957, -70.22192860931868]
[0.12371550434749742, 0.1237155143770396, 0.12371551678500632, 0.12371551178249247, 0.12371549956918754, 0.1237154803341359, 0.12371545425643725, 0.12371542150589232, 0.12371538224359924, 0.12371533662250409 … 1.0034061262070648, 0.6657442675035907, 0.0015766664531285265, 0.006414030171115832, 0.9997309526599986, 0.9997332832912293, 0.2071942081934502, 151173.81666220695, 13609.434641207697, -70.13370023408375]
[0.1230961779894367, 0.12309618224061367, 0.12309617938237978, 0.12309616960970099, 0.12309615310700832, 0.12309613004890056, 0.12309610060079097, 0.12309606491950391, 0.12309602315382545, 0.1230959754450122 … 1.0034387981044124, 0.6621575614478484, 0.0015986588419268464, 0.006456227899200938, 0.999725301014825, 0.9997276295977499, 0.20469142947864624, 151223.46657862767, 13559.85838546061, -70.03725612195733]
[0.1225682586558789, 0.12256825834962111, 0.12256825135792374, 0.12256823786249388, 0.12256821803522021, 0.12256819203882757, 0.12256816002748001, 0.12256812214733673, 0.12256807853706504, 0.12256802932831494 … 1.0034665858860294, 0.6590065479787393, 0.0016181313950653596, 0.00649334473351526, 0.9997202628390558, 0.9997225836604193, 0.20252160788615026, 151266.33084828782, 13517.057904846399, -69.9529408320586]
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.23505056446792236, 0.5781214777886924)
ca_iso = sol2(tspan[1]:1:tspan[2], idxs=sys.Cai_mean)
println(extrema(ca_iso))
(0.19033626526983535, 0.7110939450938599)
savefig("iso-caT.pdf")
savefig("iso-caT.png")
"/home/runner/work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/.cache/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/.cache/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/.cache/docs/iso-exp.pdf"
This notebook was generated using Literate.jl.