-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefs.py
160 lines (138 loc) · 3.89 KB
/
defs.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import numpy as np
import collections
solute_id = {
'Na' : 0,
'K' : 1,
'Cl' : 2,
'HCO3' : 3,
'H2CO3' : 4,
'CO2' : 5,
'HPO4' : 6,
'H2PO4' : 7,
'urea' : 8,
'NH3' : 9,
'NH4' : 10,
'H' : 11,
'HCO2' : 12,
'H2CO2' : 13,
'glucose' : 14
}
# valence
solute_val = collections.OrderedDict()
solute_val['Na'] = 1
solute_val['K'] = 1
solute_val['Cl'] = -1
solute_val['HCO3'] = -1
solute_val['H2CO3'] = 0
solute_val['CO2'] = 0
solute_val['HPO4'] = -2
solute_val['H2PO4'] = -1
solute_val['urea'] = 0
solute_val['NH3'] = 0
solute_val['NH4'] = 1
solute_val['H'] = 1
solute_val['HCO2'] = -1
solute_val['H2CO2'] = 0
solute_val['glucose'] = 0
# extract valence values only as an array for convenience
zval = np.asarray(list(solute_val.values()))
compart_id = {
'Lumen' : 0,
'Cell' : 1,
'ICA' : 2,
'ICB' : 3,
'LIS' : 4,
'Bath' : 5
}
# number of compartments
NC = len(compart_id.keys())
# number of solutes
NS = len(solute_id.keys())
class coupled_transport:
def __init__(self):
# permeability
self.perm = 0.0
# solute id
self.solute_id = []
# membrane interface
self.membrane_id = []
# coefficient
self.coef = []
class transporter:
def __init__(self):
# activity
self.act = 0.0
# which transporter
self.type = []
# membrane interface
self.membrane_id = []
class membrane:
def __init__(self):
# number of cells
self.total = 200
# segment of cell
self.segment = 'PT'
# diabete status
self.diabete = 'Non'
# unx status
self.unx = 'N'
# hypertension status
self.HT = 'N'
# pregnancy status
self.preg = 'non'
# tubule length
self.len = 0.0
# luminal diameter
self.diam = 0
# surface area
self.area = np.zeros(NC*NC).reshape((NC,NC))
# initial surface area
self.area_init = np.zeros(NC*NC).reshape((NC,NC))
# reference volume
self.volref = np.zeros(NC)
# actual volume
self.vol = np.zeros(NC)
# initial volume
self.vol_init = np.zeros(NC)
# initial pH
self.pH = np.zeros(NC)
# water permeability
self.dLPV = np.zeros(NC*NC).reshape((NC,NC))
# solute reflection coefficient
self.sig = np.ones(NC*NC*NS).reshape((NS,NC,NC))
# solute permeability
self.h = np.zeros(NS*NC*NC).reshape((NS,NC,NC))
# coupled transporters
self.dLA = []
# specific transporters
self.trans = []
# solute concentrations
self.conc = np.zeros(NC*NS).reshape((NS,NC))
# membrane potential
self.ep = np.zeros(NC) #[0 for i in range(NC)]
# reference impermeate concentrations in each compartment
# denote oncotic pressure in lumen and bath
self.cimpref = np.zeros(NC)
# Impermeant Properties
self.zimp = np.zeros(NC)
# reference buffer concentrations in each compartment: (concentrations in cell, ICA and ICB are only needed)
self.cbuftot = np.zeros(NC)
# pressure
self.pres = np.zeros(NC)
# rates used in HCO3/H2CO3 reaction
self.dkd = np.zeros(NC)
self.dkh = np.zeros(NC)
# default sex is male
self.sex = 'male'
# default type of nephron is superficial (sup). Another type is juxtamedullary (jux1,jux2,jux3,jux4,jux5)
self.type = 'sup'
# inhibition
self.inhib = ''
# default is human
self.species = 'hum'
self.flag=0
# interstitial concentration parameters of solutes
# CM: cortico-medullary boundary; OI: outer-inner stripe boundary; Pap: papillary tip
self.cm = []
self.oi = []
self.pap = []