-
Notifications
You must be signed in to change notification settings - Fork 2
/
ex_create_model_out.txt
50 lines (41 loc) · 1.22 KB
/
ex_create_model_out.txt
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
# Code blocks for user model function:
k1 = model_params['k1']
k2 = model_params['k2']
k3 = model_params['k3']
k_OH_wall = model_params['k_OH_wall']
k_HO2_wall = model_params['k_HO2_wall']
OH_0 =
H2O2_0 =
HO2_0 =
H2O_0 =
O2_0 =
y0 = np.array([OH_0, H2O2_0, HO2_0, H2O_0, O2_0])
def calc_dy_dt(y, t_curr):
OH = y[0]
H2O2 = y[1]
HO2 = y[2]
H2O = y[3]
O2 = y[4]
dOH = -k1*OH*H2O2 -k2*OH*HO2 -k_OH_wall*OH
dH2O2 = -k1*OH*H2O2 +k3*HO2*HO2
dHO2 = +k1*OH*H2O2 -k2*OH*HO2 -k3*HO2*HO2 -k3*HO2*HO2 -k_HO2_wall*HO2
dH2O = +k1*OH*H2O2 +k2*OH*HO2
dO2 = +k2*OH*HO2 +k3*HO2*HO2
dy_dt = np.array([dOH, dH2O2, dHO2, dH2O, dO2])
return dy_dt
# Code blocks for Jupyter notebook (model parameters setup):
k1 = 1.80000E-12
k2 = 1.11066E-10
k3 = 1.44922E-12
k_OH_wall = 15
k_HO2_wall = 4
k1_err = 2.70000E-13
k2_err = 1.66599E-11
k3_err = 2.10859E-13
k_OH_wall_err = 0
k_HO2_wall_err = 0
df_model_params['k1'] = {'val':k1, 'err':k1_err, 'fit':False}
df_model_params['k2'] = {'val':k2, 'err':k2_err, 'fit':False}
df_model_params['k3'] = {'val':k3, 'err':k3_err, 'fit':False}
df_model_params['k_OH_wall'] = {'val':k_OH_wall, 'err':k_OH_wall_err, 'fit':True}
df_model_params['k_HO2_wall'] = {'val':k_HO2_wall, 'err':k_HO2_wall_err, 'fit':True}