‘’’
def g(v,n):
return (1.0 - (1.0 - exp(-Re)) * n ) / (1.0 - exp(-Re)) *
conditional(ge(v,vn),1.0,0.0)
- (1.0 - conditional(ge(v,vn),1.0,0.0))*n
def f(v,n):
return (-v+(vstar-pow(n,M))*(1.0-ufl.tanh(v-vh))*pow(v,2)*0.5)
def hr(xi,n):
return K1 * xi*xi / (1 + n) - K2 * n
Magnetic field
def mg(v,mf):
return Km1*v - Km2 * mf +mfe
def In(v,mf):
return Km0pow(alp,mfbet)lamln(alp)* v
def varAngle(s):
return ((thetaEpi - thetaEndo) * s + thetaEndo)/ 180.0 * pi
def normalizeAndProj_vec(u):
return project(u/sqrt(dot(u,u)),FiberSpace)
def normalize_vec(u):
return u/sqrt(dot(u,u))
def comptauv(T,Ta,beta,tauv):
return tauv/(1+beta*(T-Ta))
def comptaun(T,Q10,Ta,taun):
return taun*pow(Q10,(Ta-T)/10.0)
def comptauxi(T,Q10,Ta,tauxi):
return tauxi*pow(Q10,(Ta-T)/10.0)
def comptaumf(T,Q10,Ta,taumf):
return taumf*pow(Q10,(Ta-T)/10.0)
t = 0.0; dt = 0.1; Tfinal=750;
freqSave = 1; inc = 0
stim_t0 = dt; stim_t2 = 350; stim_dur = 2.0; stim_amp = 2.0
******* Create mesh and define function spaces **********
mesh = Mesh(“square.xml”)
bdry = MeshFunction(“size_t”, mesh, “square_facet_region.xml”)
ds = Measure(“ds”, subdomain_data=bdry)
nn = FacetNormal(mesh)
‘’’