Location: Simon-Chica et al. (2021) Novel insights into the electrophysiology of murine cardiac macrophages @ 720af1d0b332 / myokit / type0.mmt

Author:
Eike Moritz Wuelfers <eike@wuelfers.com>
Date:
2021-03-02 19:50:02+01:00
Desc:
Switch to CellML v1 ...
Permanent Source URI:
https://models.fieldml.org/workspace/638/rawfile/720af1d0b33241ab2d3f7395b6588746e794218e/myokit/type0.mmt

[[model]]
name: Simon-Chica-2021
desc: """
Murine resident cardiac maacrophage model [1].

** Type 0 **


[1] Simon-Chica et al. (2021) Circ Res
"""


# Initial values
cell.V = -39.55 [mV]

[mac]
Cm = 18.32e-6 in [uF]

[Environment]
time = 0 bind time
pace = 0 bind pace

#MACROPHAGE MODEL
# Background current
[ib]
use cell.V as V 
use mac.Cm as Cm
gb = 1.6e-7 in [mS]
Eb = -10 in [mV]
Ib = (gb/Cm * (V - Eb)) in [pA/pF]


[ik1]
use cell.V as V
F = 96487 [C/mol]
R = 8314 [mJ/K/mol]
T = 275+22 [K]
K_e = 5.4 # is actually mM but should be dimensionless here because of the sqrt below
GKir = 4.2e-7 [mS]
aKir = 0.91
bKir = 1.09
EK = -79.362 [mV]
IK1=((GKir/mac.Cm * sqrt(K_e) * (V - (EK))) / (aKir + exp((bKir * (V - (EK)) * F)/(R * T)))) in [pA/pF]


[cell]
i_diff = 0 bind diffusion_current 
dot(V) = -(ib.Ib + ik1.IK1 + (i_diff)/mac.Cm) in [mV] label membrane_potential

[[protocol]]
# Level  Start    Length   Period   Multiplier
1.0      0.0      2        1000.0   10

[[script]]
import matplotlib.pyplot as plt
import myokit
import numpy as np
from mpl_toolkits.mplot3d import axes3d
import math
from scipy.signal import find_peaks, peak_prominences
from scipy import signal


numstim = 0 #5 #50 #for prestimulation 
bcl = 200

# Get model and protocol, create simulation
   
dt = 0.005
sim_time = bcl*5
n_stim = 1
#g_vec= [(0,1,2,8)]

n_end = 1
n_mid = 1
n_epi = 0
n = n_end + n_mid + n_epi
m = get_model()
m.resolve_interdependent_components()
p = myokit.Protocol()
p.schedule(level = 1, start = 0, duration = 2, period=bcl, multiplier=10)
s = myokit.SimulationOpenCL(m, p, ncells=n)
s.set_step_size(dt)
s.set_paced_cells(n_stim)
s.pre(numstim*bcl)
    
#CONNECTIONS
g= 167e-6 #mS/uF
g_NM = 0 #5e-6 #mS/uF
#connections = [(i, i+1, g_NM if n_end-1<= i <=n_end+n_mid-1 else g) for i in range(n-1)]
connections = [(0, i+1, g_NM) for i in range(n-1)]
s.set_connections(connections)
  
#DEFINE CABLE
types = [0] * n_end + [2] * n_mid + [1] * n_epi
s.set_field('cell2.type', types)
    
d = s.run(sim_time, log_interval=0.01, log=['Environment.time', 'remaining.V','ecc.na_m','ecc.na_h','ecc.na_j'],report_nan=False) #maybe sim_time can be smaller for checking amp?
#d.save_csv('mouse_type0_NOinward_5Cm_5nS_1Macs_5g.txt')

numts=(d['remaining.V',0])
vm=np.zeros((len(numts),n))
t = d['Environment.time']   
#voltage vector         
for j in range(0, n):
    vm[:,j]=d['remaining.V', j]

plt.figure()
plt.plot(t,vm[:,-1])
plt.title(' sim_time={}, t={}'.format(sim_time, t[-1]))
plt.plot(t,vm[:,0],'r')