def init_state_values(**values): """ Initialize state values """ # Imports import numpy as np from modelparameters.utils import Range # Init values # z=0.014417937837, Q_1=0, Q_2=0, Q_3=0, TRPN=0.067593139865 init_values = np.array([0.014417937837, 0, 0, 0, 0.067593139865],\ dtype=np.float_) # State indices and limit checker state_ind = dict([("z",(0, Range())), ("Q_1",(1, Range())), ("Q_2",(2,\ Range())), ("Q_3",(3, Range())), ("TRPN",(4, Range()))]) for state_name, value in values.items(): if state_name not in state_ind: raise ValueError("{0} is not a state.".format(state_name)) ind, range = state_ind[state_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(state_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_state_values(**values): """ Initialize state values """ # Imports import numpy as np from modelparameters.utils import Range # Init values # m=0.05, h=0.6, n=0.325, V=-75 init_values = np.array([0.05, 0.6, 0.325, -75], dtype=np.float_) # State indices and limit checker state_ind = dict([("m",(0, Range())), ("h",(1, Range())), ("n",(2,\ Range())), ("V",(3, Range()))]) for state_name, value in values.items(): if state_name not in state_ind: raise ValueError("{0} is not a state.".format(state_name)) ind, range = state_ind[state_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(state_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_parameter_values(**values): """ Initialize parameter values """ # Imports import numpy as np from modelparameters.utils import Range # Param values # g_Na=120, g_K=36, g_L=0.3, Cm=1, E_R=-75 init_values = np.array([120, 36, 0.3, 1, -75], dtype=np.float_) # Parameter indices and limit checker param_ind = dict([("g_Na", (0, Range())), ("g_K", (1, Range())), ("g_L",\ (2, Range())), ("Cm", (3, Range())), ("E_R", (4, Range()))]) for param_name, value in values.items(): if param_name not in param_ind: raise ValueError("{0} is not a parameter.".format(param_name)) ind, range = param_ind[param_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(param_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_state_values(**values): """ Initialize state values """ # Imports import numpy as np from modelparameters.utils import Range # Init values # intf=-4.51134525104e-06, TRPNCaL=0.0147730085064, # TRPNCaH=0.130660965615, N_NoXB=0.999999959256, # P_NoXB=4.07437173989e-08, N=0.99999783454, XBpostr=1.81017564384e-06, # XBprer=3.049496488e-07, xXBprer=3.41212828972e-08, # xXBpostr=0.00700005394874 init_values = np.array([-4.51134525104e-06, 0.0147730085064,\ 0.130660965615, 0.999999959256, 4.07437173989e-08, 0.99999783454,\ 1.81017564384e-06, 3.049496488e-07, 3.41212828972e-08,\ 0.00700005394874], dtype=np.float_) # State indices and limit checker state_ind = dict([("intf",(0, Range())), ("TRPNCaL",(1, Range())),\ ("TRPNCaH",(2, Range())), ("N_NoXB",(3, Range())), ("P_NoXB",(4,\ Range())), ("N",(5, Range())), ("XBpostr",(6, Range())),\ ("XBprer",(7, Range())), ("xXBprer",(8, Range())), ("xXBpostr",(9,\ Range()))]) for state_name, value in values.items(): if state_name not in state_ind: raise ValueError("{0} is not a state.".format(state_name)) ind, range = state_ind[state_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(state_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_parameter_values(**values): """ Initialize parameter values """ # Imports import numpy as np from modelparameters.utils import Range # Param values # P_kna=0.03, lambda_CaL=0.0, lambda_K1=0.0, lambda_Kr=0.0, # lambda_Ks=0.0, lambda_Na=0.0, lambda_NaCa=0.0, lambda_NaK=0.0, # lambda_b_Ca=0.0, lambda_b_Na=0.0, lambda_leak=0.0, lambda_p_Ca=0.0, # lambda_p_K=0.0, lambda_rel=0.0, lambda_to=0.0, lambda_up=0.0, # g_K1=5.405, g_Kr=0.096, g_Ks=0.062, g_Na=14.838, # perc_reduced_inact_for_IpNa=0, shift_INa_inact=0.0, g_bna=0.00029, # g_CaL=0.000175, g_bca=0.000592, g_to=0.294, K_mNa=40.0, K_mk=1.0, # P_NaK=1.362, K_NaCa=1000.0, K_sat=0.1, Km_Ca=1.38, Km_Nai=87.5, # alpha=2.5, gamma=0.35, K_pCa=0.0005, g_pCa=0.825, g_pK=0.0146, # Buf_c=0.15, Buf_sr=10.0, Cao=2.0, K_buf_c=0.001, K_buf_sr=0.3, # K_up=0.00025, V_leak=8e-05, V_sr=0.001094, Vmax_up=0.000425, # a_rel=0.016464, b_rel=0.25, c_rel=0.008232, tau_g=2.0, Nao=140.0, # conc_clamp=1, Cm=0.185, F=96485.3415, R=8314.472, T=310.0, # Vmyo=0.016404, stim_amplitude=-52.0, stim_duration=1.0, # stim_end=5000.0, stim_period=2000.0, stim_start=100.0, Ko=5.4 init_values = np.array([0.03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,\ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.405, 0.096, 0.062, 14.838, 0,\ 0.0, 0.00029, 0.000175, 0.000592, 0.294, 40.0, 1.0, 1.362, 1000.0,\ 0.1, 1.38, 87.5, 2.5, 0.35, 0.0005, 0.825, 0.0146, 0.15, 10.0, 2.0,\ 0.001, 0.3, 0.00025, 8e-05, 0.001094, 0.000425, 0.016464, 0.25,\ 0.008232, 2.0, 140.0, 1, 0.185, 96485.3415, 8314.472, 310.0,\ 0.016404, -52.0, 1.0, 5000.0, 2000.0, 100.0, 5.4], dtype=np.float_) # Parameter indices and limit checker param_ind = dict([("P_kna", (0, Range())), ("lambda_CaL", (1, Range())),\ ("lambda_K1", (2, Range())), ("lambda_Kr", (3, Range())),\ ("lambda_Ks", (4, Range())), ("lambda_Na", (5, Range())),\ ("lambda_NaCa", (6, Range())), ("lambda_NaK", (7, Range())),\ ("lambda_b_Ca", (8, Range())), ("lambda_b_Na", (9, Range())),\ ("lambda_leak", (10, Range())), ("lambda_p_Ca", (11, Range())),\ ("lambda_p_K", (12, Range())), ("lambda_rel", (13, Range())),\ ("lambda_to", (14, Range())), ("lambda_up", (15, Range())), ("g_K1",\ (16, Range())), ("g_Kr", (17, Range())), ("g_Ks", (18, Range())),\ ("g_Na", (19, Range())), ("perc_reduced_inact_for_IpNa", (20,\ Range())), ("shift_INa_inact", (21, Range())), ("g_bna", (22,\ Range())), ("g_CaL", (23, Range())), ("g_bca", (24, Range())),\ ("g_to", (25, Range())), ("K_mNa", (26, Range())), ("K_mk", (27,\ Range())), ("P_NaK", (28, Range())), ("K_NaCa", (29, Range())),\ ("K_sat", (30, Range())), ("Km_Ca", (31, Range())), ("Km_Nai", (32,\ Range())), ("alpha", (33, Range())), ("gamma", (34, Range())),\ ("K_pCa", (35, Range())), ("g_pCa", (36, Range())), ("g_pK", (37,\ Range())), ("Buf_c", (38, Range())), ("Buf_sr", (39, Range())),\ ("Cao", (40, Range())), ("K_buf_c", (41, Range())), ("K_buf_sr", (42,\ Range())), ("K_up", (43, Range())), ("V_leak", (44, Range())),\ ("V_sr", (45, Range())), ("Vmax_up", (46, Range())), ("a_rel", (47,\ Range())), ("b_rel", (48, Range())), ("c_rel", (49, Range())),\ ("tau_g", (50, Range())), ("Nao", (51, Range())), ("conc_clamp", (52,\ Range())), ("Cm", (53, Range())), ("F", (54, Range())), ("R", (55,\ Range())), ("T", (56, Range())), ("Vmyo", (57, Range())),\ ("stim_amplitude", (58, Range())), ("stim_duration", (59, Range())),\ ("stim_end", (60, Range())), ("stim_period", (61, Range())),\ ("stim_start", (62, Range())), ("Ko", (63, Range()))]) for param_name, value in values.items(): if param_name not in param_ind: raise ValueError("{0} is not a parameter.".format(param_name)) ind, range = param_ind[param_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(param_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_state_values(**values): """ Initialize state values """ # Imports import numpy as np from modelparameters.utils import Range # Init values # Xr1=0, Xr2=1, Xs=0, m=0, h=0.75, j=0.75, d=0, f=1, fCa=1, s=1, r=0, # g=1, Cai=0.0002, Ca_SR=0.2, Nai=11.6, V=-86.2, Ki=138.3 init_values = np.array([0, 1, 0, 0, 0.75, 0.75, 0, 1, 1, 1, 0, 1, 0.0002,\ 0.2, 11.6, -86.2, 138.3], dtype=np.float_) # State indices and limit checker state_ind = dict([("Xr1",(0, Range())), ("Xr2",(1, Range())), ("Xs",(2,\ Range())), ("m",(3, Range())), ("h",(4, Range())), ("j",(5,\ Range())), ("d",(6, Range())), ("f",(7, Range())), ("fCa",(8,\ Range())), ("s",(9, Range())), ("r",(10, Range())), ("g",(11,\ Range())), ("Cai",(12, Range())), ("Ca_SR",(13, Range())),\ ("Nai",(14, Range())), ("V",(15, Range())), ("Ki",(16, Range()))]) for state_name, value in values.items(): if state_name not in state_ind: raise ValueError("{0} is not a state.".format(state_name)) ind, range = state_ind[state_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(state_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_parameter_values(**values): """ Initialize parameter values """ # Imports import numpy as np from modelparameters.utils import Range # Param values # Qfapp=6.25, Qgapp=2.5, Qgxb=6.25, Qhb=6.25, Qhf=6.25, fapp=0.5, # gapp=0.07, gslmod=6, gxb=0.07, hb=0.4, hbmdc=0, hf=2, # hfmdc=5, sigman=1, sigmap=8, xbmodsp=1, KSE=1, PCon_c=0.02, # PCon_t=0.002, PExp_c=70, PExp_t=10, SEon=1, SL_c=2.25, # SLmax=2.4, SLmin=1.4, SLrest=1.85, SLset=1.9, fixed_afterload=0, # kxb_normalised=120, massf=50, visc=3, Ca_amplitude=1.45, # Ca_diastolic=0.09, start_time=5, tau1=20, tau2=110, TmpC=24, # len_hbare=0.1, len_thick=1.65, len_thin=1.2, x_0=0.007, # Qkn_p=1.6, Qkoff=1.3, Qkon=1.5, Qkp_n=1.6, kn_p=0.5, # koffH=0.025, koffL=0.25, koffmod=1, kon=0.05, kp_n=0.05, # nperm=15, perm50=0.5, xPsi=2, Trop_conc=70, kxb=120 init_values = np.array([6.25, 2.5, 6.25, 6.25, 6.25, 0.5, 0.07, 6, 0.07,\ 0.4, 0, 2, 5, 1, 8, 1, 1, 0.02, 0.002, 70, 10, 1, 2.25, 2.4, 1.4,\ 1.85, 1.9, 0, 120, 50, 3, 1.45, 0.09, 5, 20, 110, 24, 0.1, 1.65, 1.2,\ 0.007, 1.6, 1.3, 1.5, 1.6, 0.5, 0.025, 0.25, 1, 0.05, 0.05, 15, 0.5,\ 2, 70, 120, 0], dtype=np.float_) # Parameter indices and limit checker param_ind = dict([("Qfapp", (0, Range())), ("Qgapp", (1, Range())),\ ("Qgxb", (2, Range())), ("Qhb", (3, Range())), ("Qhf", (4, Range())),\ ("fapp", (5, Range())), ("gapp", (6, Range())), ("gslmod", (7,\ Range())), ("gxb", (8, Range())), ("hb", (9, Range())), ("hbmdc",\ (10, Range())), ("hf", (11, Range())), ("hfmdc", (12, Range())),\ ("sigman", (13, Range())), ("sigmap", (14, Range())), ("xbmodsp",\ (15, Range())), ("KSE", (16, Range())), ("PCon_c", (17, Range())),\ ("PCon_t", (18, Range())), ("PExp_c", (19, Range())), ("PExp_t", (20,\ Range())), ("SEon", (21, Range())), ("SL_c", (22, Range())),\ ("SLmax", (23, Range())), ("SLmin", (24, Range())), ("SLrest", (25,\ Range())), ("SLset", (26, Range())), ("fixed_afterload", (27,\ Range())), ("kxb_normalised", (28, Range())), ("massf", (29,\ Range())), ("visc", (30, Range())), ("Ca_amplitude", (31, Range())),\ ("Ca_diastolic", (32, Range())), ("start_time", (33, Range())),\ ("tau1", (34, Range())), ("tau2", (35, Range())), ("TmpC", (36,\ Range())), ("len_hbare", (37, Range())), ("len_thick", (38,\ Range())), ("len_thin", (39, Range())), ("x_0", (40, Range())),\ ("Qkn_p", (41, Range())), ("Qkoff", (42, Range())), ("Qkon", (43,\ Range())), ("Qkp_n", (44, Range())), ("kn_p", (45, Range())),\ ("koffH", (46, Range())), ("koffL", (47, Range())), ("koffmod", (48,\ Range())), ("kon", (49, Range())), ("kp_n", (50, Range())), ("nperm",\ (51, Range())), ("perm50", (52, Range())), ("xPsi", (53, Range())),\ ("Trop_conc", (54, Range())), ("kxb", (55, Range())), ("dSL", (56, Range()))]) for param_name, value in values.items(): if param_name not in param_ind: raise ValueError("{0} is not a parameter.".format(param_name)) ind, range = param_ind[param_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(param_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def init_parameter_values(**values): """ Initialize parameter values """ # Imports import numpy as np from modelparameters.utils import Range # Param values # beta_0=4.9, Ca_50ref=0.00105, K_z=0.15, alpha_0=0.008, alpha_r1=0.002, # alpha_r2=0.00175, beta_1=-4, n_Hill=3, n_Rel=3, z_p=0.85, # T_ref=56.2, A_1=-29, A_2=138, A_3=129, a=0.35, alpha_1=0.03, # alpha_2=0.13, alpha_3=0.625, Ca_TRPN_Max=0.07, gamma_trpn=2, # k_Ref_off=0.2, k_on=100, dExtensionRatiodt=0, lambda_=1 init_values = np.array([4.9, 0.00105, 0.15, 0.008, 0.002, 0.00175, -4, 3,\ 3, 0.85, 56.2, -29, 138, 129, 0.35, 0.03, 0.13, 0.625, 0.07, 2, 0.2,\ 100, 0, 1], dtype=np.float_) # Parameter indices and limit checker param_ind = dict([("beta_0", (0, Range())), ("Ca_50ref", (1, Range())),\ ("K_z", (2, Range())), ("alpha_0", (3, Range())), ("alpha_r1", (4,\ Range())), ("alpha_r2", (5, Range())), ("beta_1", (6, Range())),\ ("n_Hill", (7, Range())), ("n_Rel", (8, Range())), ("z_p", (9,\ Range())), ("T_ref", (10, Range())), ("A_1", (11, Range())), ("A_2",\ (12, Range())), ("A_3", (13, Range())), ("a", (14, Range())),\ ("alpha_1", (15, Range())), ("alpha_2", (16, Range())), ("alpha_3",\ (17, Range())), ("Ca_TRPN_Max", (18, Range())), ("gamma_trpn", (19,\ Range())), ("k_Ref_off", (20, Range())), ("k_on", (21, Range())),\ ("dExtensionRatiodt", (22, Range())), ("lambda_", (23, Range()))]) for param_name, value in values.items(): if param_name not in param_ind: raise ValueError("{0} is not a parameter.".format(param_name)) ind, range = param_ind[param_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(param_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value return init_values
def default_parameters(**values): """ Parameter values """ # Imports import dolfin from modelparameters.utils import Range # Param values # P_kna=0.03, g_K1=5.405, g_Kr=0.096, g_Ks=0.062, g_Na=14.838, # g_bna=0.00029, g_CaL=0.000175, g_bca=0.000592, g_to=0.294, # K_mNa=40, K_mk=1, P_NaK=1.362, K_NaCa=1000, K_sat=0.1, # Km_Ca=1.38, Km_Nai=87.5, alpha=2.5, gamma=0.35, K_pCa=0.0005, # g_pCa=0.825, g_pK=0.0146, Buf_c=0.15, Buf_sr=10, Ca_o=2, # K_buf_c=0.001, K_buf_sr=0.3, K_up=0.00025, V_leak=8e-05, # V_sr=0.001094, Vmax_up=0.000425, a_rel=0.016464, b_rel=0.25, # c_rel=0.008232, tau_g=2, Na_o=140, Cm=0.185, F=96485.3415, # R=8314.472, T=310, V_c=0.016404, stim_amplitude=52, # stim_duration=1, stim_period=1000, stim_start=1, K_o=5.4 param_values = [0.03, 5.405, 0.096, 0.062, 14.838, 0.00029, 0.000175,\ 0.000592, 0.294, 40, 1, 1.362, 1000, 0.1, 1.38, 87.5, 2.5, 0.35,\ 0.0005, 0.825, 0.0146, 0.15, 10, 2, 0.001, 0.3, 0.00025, 8e-05,\ 0.001094, 0.000425, 0.016464, 0.25, 0.008232, 2, 140, 0.185,\ 96485.3415, 8314.472, 310, 0.016404, 52, 1, 1000, 1, 5.4] # Parameter indices and limit checker param_ind = dict(P_kna=(0, Range()), g_K1=(1, Range()), g_Kr=(2,\ Range()), g_Ks=(3, Range()), g_Na=(4, Range()), g_bna=(5, Range()),\ g_CaL=(6, Range()), g_bca=(7, Range()), g_to=(8, Range()), K_mNa=(9,\ Range()), K_mk=(10, Range()), P_NaK=(11, Range()), K_NaCa=(12,\ Range()), K_sat=(13, Range()), Km_Ca=(14, Range()), Km_Nai=(15,\ Range()), alpha=(16, Range()), gamma=(17, Range()), K_pCa=(18,\ Range()), g_pCa=(19, Range()), g_pK=(20, Range()), Buf_c=(21,\ Range()), Buf_sr=(22, Range()), Ca_o=(23, Range()), K_buf_c=(24,\ Range()), K_buf_sr=(25, Range()), K_up=(26, Range()), V_leak=(27,\ Range()), V_sr=(28, Range()), Vmax_up=(29, Range()), a_rel=(30,\ Range()), b_rel=(31, Range()), c_rel=(32, Range()), tau_g=(33,\ Range()), Na_o=(34, Range()), Cm=(35, Range()), F=(36, Range()),\ R=(37, Range()), T=(38, Range()), V_c=(39, Range()),\ stim_amplitude=(40, Range()), stim_duration=(41, Range()),\ stim_period=(42, Range()), stim_start=(43, Range()), K_o=(44,\ Range())) for param_name, value in values.items(): if param_name not in param_ind: raise ValueError("{{0}} is not a param".format(param_name)) ind, range = param_ind[param_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(param_name,\ range.format_not_in(value))) # Assign value param_values[ind] = value param_values = dolfin.Constant(tuple(param_values)) return param_values
def init_values(**values): """ Init values """ # Imports import dolfin from modelparameters.utils import Range # Init values # Xr1=0, Xr2=1, Xs=0, m=0, h=0.75, j=0.75, d=0, f=1, fCa=1, s=1, r=0, # Ca_SR=0.2, Ca_i=0.0002, g=1, Na_i=11.6, V=-86.2, K_i=138.3 init_values = [0, 1, 0, 0, 0.75, 0.75, 0, 1, 1, 1, 0, 0.2, 0.0002, 1,\ 11.6, -86.2, 138.3] # State indices and limit checker state_ind = dict(Xr1=(0, Range()), Xr2=(1, Range()), Xs=(2, Range()),\ m=(3, Range()), h=(4, Range()), j=(5, Range()), d=(6, Range()), f=(7,\ Range()), fCa=(8, Range()), s=(9, Range()), r=(10, Range()),\ Ca_SR=(11, Range()), Ca_i=(12, Range()), g=(13, Range()), Na_i=(14,\ Range()), V=(15, Range()), K_i=(16, Range())) for state_name, value in values.items(): if state_name not in state_ind: raise ValueError("{{0}} is not a state.".format(state_name)) ind, range = state_ind[state_name] if value not in range: raise ValueError("While setting '{0}' {1}".format(state_name,\ range.format_not_in(value))) # Assign value init_values[ind] = value init_values = dolfin.Constant(tuple(init_values)) return init_values