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)
12.771041 seconds (18.02 M allocations: 870.290 MiB, 2.11% gc time, 94.58% compilation 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.4801103698
191261.3478353637
199430.11091792677
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.12180447948880582, 0.12174768443532359, 0.1216934018408597, 0.12164180995533562, 0.1215930492007203, 0.12154722283384187, 0.12150439833798554 … 0.26041507667541997, 0.009786689200123853, 0.0016855899094922325, 0.09161908329520764, 0.22294828828976576, 0.9666286957812559, 0.006355039713677859, 829.9689941817725, 829.8589858006806, 0.00231065572773434]
[150952.80529264064, 13838.18882346682, -71.35304509818071, 0.12196378364408145, 0.12191937753328307, 0.12187579038290325, 0.1218331857334072, 0.12179171693004393, 0.12175152667167352, 0.12171274673876355 … 0.26104417804603025, 0.009873892913308327, 0.0015688568862426042, 0.09093422465365385, 0.22412560303273427, 0.9671554512230358, 0.005926150085676071, 829.923524981244, 829.7704141396295, 0.00222899504022452]
⋮
[151185.63271996303, 13607.420744770343, -70.43023481619123, 0.1369413989427565, 0.13694144304553288, 0.13694148299241213, 0.13694151871211363, 0.13694155013046036, 0.136941577170231, 0.1369415997510036 … 0.0011158719218732633, 0.0015675922007132197, 0.002426545340782379, 0.001510994095442744, 0.9996108920527998, 0.9997475964480621, 0.006285994984106787, 784.9288194951702, 784.5651195685392, 0.0020423892478284448]
[151213.9820514865, 13579.103378371117, -70.3766480890724, 0.13663059206120204, 0.1366307819959751, 0.13663097008021605, 0.13663115631566897, 0.1366313407041419, 0.13663152324750866, 0.1366317039477139 … 0.0011252549536625441, 0.0015738540818361103, 0.002436228688784805, 0.0015227542972159533, 0.9997062441329826, 0.9997446559840225, 0.0063089428039140106, 784.9703548384739, 784.6110483772328, 0.0020255963480356708]
[151247.4707859165, 13545.682346719857, -70.31452638300331, 0.13622842540355629, 0.1362286933745822, 0.1362289608279193, 0.1362292278063917, 0.13622949435455348, 0.13622976051877575, 0.1362300263473413 … 0.0011361321403865322, 0.00158113912937753, 0.002447502236028158, 0.0015364573949931957, 0.999734143949801, 0.9997412090259151, 0.006335649801800993, 784.7108150355575, 784.3576255889838, 0.0019962840840800546]
[151281.40730833143, 13511.830273770103, -70.25192438941004, 0.1358048308522309, 0.13580512917630277, 0.1358054276044316, 0.13580572619739736, 0.13580602501843692, 0.13580632413336916, 0.13580662361072815 … 0.001147236323743849, 0.001588516574456395, 0.0024589152269768196, 0.0015503644345189766, 0.9997378046102858, 0.9997376910754708, 0.00636267688824293, 784.2818300688931, 783.93525860278, 0.001961977321008763]
[151319.45625159066, 13473.88453339642, -70.18157444536455, 0.13532440598845927, 0.1353247137455541, 0.13532502194084553, 0.13532533064353816, 0.135325639925635, 0.1353259498620803, 0.1353262605309109 … 0.0011597793011240856, 0.0015968436474588857, 0.002471803445566157, 0.0015661281800649293, 0.9997353905272033, 0.9997336817909146, 0.006393185710784546, 783.7084117185257, 783.3693899274932, 0.0019216578451953462]
[151359.6636014564, 13433.790651928626, -70.10674037188218, 0.1348173720105013, 0.13481767822142982, 0.13481798504572717, 0.1348182925557591, 0.13481860082681701, 0.13481890993726625, 0.13481921996870627 … 0.0011733154716591623, 0.00160575008787891, 0.0024855863007755617, 0.001583062763524414, 0.9997313181920524, 0.9997293502453579, 0.006425798714812286, 783.0506636234213, 782.7195820613114, 0.0018786735809550425]
[151399.77083953563, 13393.798788195536, -70.03144391590398, 0.1343152892288876, 0.13431558953312167, 0.1343158905559066, 0.13431619237052272, 0.13431649505321386, 0.13431679868333732, 0.13431710334352545 … 0.001187067766951786, 0.0016147617721444035, 0.002499531304577821, 0.0016002805619497501, 0.9997269111334658, 0.9997249212173884, 0.006458780056793415, 782.3654997696613, 782.0422251020203, 0.0018362177223469748]
[151441.51334232368, 13352.177709046624, -69.9523265494586, 0.1337978682483451, 0.1337981605864559, 0.13379845372231544, 0.13379874772921538, 0.1337990426834102, 0.1337993386642689, 0.13379963575443554 … 0.00120169369347998, 0.0016242834829210673, 0.0025142670258704617, 0.0016185685361272647, 0.9997221654724046, 0.9997201892558032, 0.006493616233573965, 781.6311749893209, 781.3158711019668, 0.001792764323841505]
[151469.1062615606, 13324.66561378553, -69.89958776916238, 0.13345896964315243, 0.13345925626329166, 0.13345954372360172, 0.13345983209711543, 0.13346012145981767, 0.13346041189079588, 0.13346070347240002 … 0.0012115351890458874, 0.001630661749326255, 0.0025241374523564714, 0.0016308722640777657, 0.999718953243787, 0.999716989943244, 0.0065169412833881646, 781.1359820718984, 780.8258558611363, 0.001764501530437107]
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.81131705493
197588.12178364221
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.0018527422088444533, 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.0018222096890642778, 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.0017811002406865242, 0.09200417115231563, 0.22228882452599166, 0.9663315006590419, 0.006699003733992941, 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.006398335505979061, 830.4298664467993, 829.9364424528658, 0.00224983154100249]
[150952.80458617522, 13838.215505646505, -71.1550700755306, 0.12146599978828736, 0.12145339981894909, 0.1214396064156145, 0.12142480441004658, 0.1214091612631607, 0.1213928257229324, 0.1213759266451737 … 0.2607890677215021, 0.009862701804147046, 0.00159160449109497, 0.09088324181611296, 0.22421393887512645, 0.9671939916127574, 0.006003854581032526, 830.6928613527689, 829.9982399691283, 0.0021239182944550353]
⋮
[150927.44243964486, 13855.44760721516, -70.59411328185959, 0.12690624823440375, 0.12690644090795866, 0.12690662803537978, 0.1269068095429152, 0.12690698535383768, 0.1269071553882931, 0.12690731956313878 … 0.0010878271778462629, 0.0015486035494283476, 0.00239716711687076, 0.0014756873624981871, 0.9995674489205048, 0.9997563697872098, 0.006216329537707853, 922.8372442674411, 921.3111350426185, 0.007314687500378451]
[150962.49883419136, 13820.442136578782, -70.53036749025355, 0.12643983697099206, 0.12644002611565391, 0.12644020991348828, 0.1264403882940616, 0.12644056118409938, 0.1264407285073409, 0.12644089018438529 … 0.00109855609007869, 0.0015559585586874829, 0.0024085528978150953, 0.0014892812418439837, 0.9997032071128507, 0.9997529999609059, 0.006243336397302032, 922.9973924319756, 921.4901697336342, 0.007222908185584581]
[150997.5851447807, 13785.406967560233, -70.46599490737594, 0.12597695883211735, 0.12597714433989318, 0.1259773246936492, 0.1259774998261284, 0.1259776696673624, 0.1259778341445328, 0.12597799318182448 … 0.0011095708614214368, 0.001563424183313399, 0.0024201048896056163, 0.0015031331537498738, 0.9997381113366625, 0.9997495493507629, 0.006270727254048309, 923.1505571859311, 921.6620339612501, 0.0071321086277895025]
[151038.1081545165, 13744.943213097878, -70.39092616933695, 0.12544731802971074, 0.1254474994072467, 0.12544767585454866, 0.1254478473080412, 0.12544801370158598, 0.12544817496635083, 0.1254483310306707 … 0.0011225355991225066, 0.0015721723973324234, 0.002433645223038344, 0.001519445829354611, 0.9997449540510894, 0.9997454633663883, 0.006302819980314354, 923.3186796524577, 921.8514954088434, 0.007028583082892758]
[151082.99594044525, 13700.121315674525, -70.30685771442826, 0.12486681627358771, 0.12486699293594235, 0.1248671649061315, 0.12486733212443689, 0.12486749452873275, 0.12486765205436326, 0.12486780463401143 … 0.0011372511426383002, 0.001582025128386009, 0.002448897114682002, 0.0015379203360177576, 0.9997426766643972, 0.9997408078707501, 0.006338953528064957, 923.4938704460986, 922.050006752374, 0.006915552382403408]
[151127.81298684754, 13655.370303293366, -70.22192860927966, 0.12429382999461625, 0.12429400186163785, 0.12429416927678007, 0.12429433218421551, 0.1242944905258673, 0.12429464424129406, 0.12429479326756815 … 0.001152306521536151, 0.0015920469986004698, 0.0024644027648662984, 0.001556805954288391, 0.9997382835800489, 0.9997360201470813, 0.006375667093786818, 923.6570847388133, 922.2361636602303, 0.006804459843892744]
[151173.81665812136, 13609.434645285612, -70.13370024196674, 0.12371262761683535, 0.1237127945278281, 0.12371295722318736, 0.12371311565086184, 0.12371326975670212, 0.12371341948435374, 0.12371356477514343 … 0.0011680748508234727, 0.0016025195294372806, 0.002480613059633831, 0.001576666451342601, 0.999733283291682, 0.9997309526604555, 0.006414030167677887, 923.8125540137186, 922.4148307355821, 0.00669224174316096]
[151223.4665739653, 13559.858390114443, -70.03725613107062, 0.12309331860231157, 0.12309348001987308, 0.12309363747356575, 0.12309379091532292, 0.12309394029514012, 0.12309408556097615, 0.12309422665864812 … 0.0011856577953655483, 0.0016140477936525694, 0.0024984529958109215, 0.0015986588398342685, 0.9997276295982896, 0.9997253010153645, 0.006456227895200551, 923.9665888621072, 922.5934983498383, 0.006573203267324507]
[151266.33084832682, 13517.057904805864, -69.95294083197592, 0.12256542139076239, 0.12256557800392963, 0.1225657308632589, 0.12256587992395379, 0.12256602513941178, 0.12256616646113216, 0.1225663038386181 … 0.001201230182199704, 0.0016241926698933845, 0.002514153213865367, 0.001618131395084189, 0.9997225836604148, 0.9997202628390508, 0.00649334473355177, 924.0880576543755, 922.7358937570392, 0.006472169342803762]
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.23504331833749922, 0.5781129229554962)
ca_iso = sol2(tspan[1]:1:tspan[2], idxs=sys.Cai_mean)
println(extrema(ca_iso))
(0.1903362652693955, 0.7110939450930367)
savefig("iso-caT.pdf")
savefig("iso-caT.png")
"/home/github/actions-runner-2/_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/github/actions-runner-2/_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/github/actions-runner-2/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/.cache/docs/iso-exp.pdf"
This notebook was generated using Literate.jl.