-
Notifications
You must be signed in to change notification settings - Fork 1
/
SimulationFunctionsOnly.py
62 lines (46 loc) · 1.84 KB
/
SimulationFunctionsOnly.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# simulation_functions.py
import numpy as np
def MMConstant(kf, kb, kcat):
kM = (kb + kcat) / kf
return kM
def Full_Model(x, t, kf, kb, kcat, St, Et):
C, P = x
dC_dt = kf * (St - C - P) * (Et - C) - kb * C - kcat * C
dP_dt = kcat * C
return dC_dt, dP_dt
def QSSA(P, t, kcat, kM, St, Et):
S = St - P
dP_dt = (kcat * Et * S) / (S + kM)
return dP_dt
def tQSSA(P, t, kcat, kM, St, Et):
S_hat = St - P
square_Root_arg = (Et + S_hat + kM) ** 2 - (4 * Et * S_hat)
dP_dt = (2 * kcat * Et * S_hat) / (Et + S_hat + kM + np.sqrt(square_Root_arg))
return dP_dt
# SWITCH ----------------------------------------------------------------
# -----------------------------------------------------------------------
def Constants_Switch(kfe, kbe, ke, kfd, kbd, kd):
kME = (kbe + ke) / kfe
kMD = (kbd + kd) / kfd
return kME, kMD
def Full_Model_Switch(x, t, St, Et, Dt, kfe, kbe, ke, kfd, kbd, kd):
Sp, C, Cp = x
dSp_dt = -kfd * (Dt - Cp) * Sp + kbd * Cp + ke * C
dC_dt = kfe * (Et - C) * (St - Sp - C - Cp) - kbe * C - ke * C
dCp_dt = kfd * (Dt - Cp) * Sp - kbd * Cp - kd * Cp
return dSp_dt, dC_dt, dCp_dt
def QSSA_Switch(Sp, t, St, Et, Dt, ke, kd, kME, kMD):
S = St - Sp
dSp_dt = (ke * Et * S) / (S + kME) - (kd * Dt * Sp) / (Sp + kMD)
return dSp_dt
def deltaFunctions(Sp_hat, St, Et, Dt, kME, kMD):
S_hat = St - Sp_hat
delta = (Et + S_hat + kME)**2 - (4 * Et * S_hat)
deltap = (Dt + Sp_hat + kMD)**2 - (4 * Dt * Sp_hat)
return delta, deltap
def tQSSA_Switch(Sp_hat, t, St, Et, Dt, ke, kd, kME, kMD):
S_hat = St - Sp_hat
delta, deltap = deltaFunctions(Sp_hat, St, Et, Dt, kME, kMD)
dSp_dt = (2 * ke * Et * S_hat) / (Et + S_hat + kME + np.sqrt(delta))
dSp_dt = dSp_dt - (2 * kd * Dt * Sp_hat) / (Dt + Sp_hat + kMD + np.sqrt(deltap))
return dSp_dt