-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
512 lines (512 loc) · 18.5 KB
/
.Rhistory
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
Q_muscle = 86.1 + 70.5,
Q_bone = 15.2 + 12.4,
Q_skin = 27.8 + 22.8,
Q_adipose = 13.4 + 11.0,
Q_si = 58.1 + 47.5,
Q_li = 17.3 + 14.1,
Q_spleen = 8.18 + 6.70,
Q_liver = 10.3 + 8.40,
Q_pancreas = 6.24 + 5.10,
Q_others = 10.9 + 8.91,
#' Shah and Betts 2012, total Lymph flow was .2% of plasma flow, so this is an estimate of what the
#' parameters might be
L_lungs = 373/500,
L_heart = 36.5/500,
L_kidney = 68.5/500,
L_brain = 11.8/500,
L_muscle = 86.1/500,
L_bone = 15.2/500,
L_skin = 27.8/500,
L_adipose = 13.4/500,
L_si = 58.1/500,
L_li = 17.3/500,
L_spleen = 8.18/500,
L_liver = 10.3/500,
L_pancreas = 6.24/500,
L_others = 10.9/500,
#' assumed here that plasma vol + blood cell vol = V_vascular
#' no documentation on whether that assumption is correct
V_v_lungs = 0.0295 + 0.0241,
V_v_heart = 0.00585 + 0.00479,
V_v_kidney = 0.0289 + 0.0236,
V_v_brain = 0.0107 + 0.00873,
V_v_muscle = 0.249 + 0.204,
V_v_bone = 0.0621 + 0.0508,
V_v_skin = 0.188 + 0.154,
V_v_adipose = 0.0218 + 0.0178,
V_v_si = 0.0116 + 0.00950,
V_v_li = 0.0050 + 0.00409,
V_v_spleen = 0.0154 + 0.0126,
V_v_liver = 0.164 + 0.134,
V_v_pancreas = 0.00534 + 0.00437,
V_v_others = 0.0195 + 0.0160,
#' never explicitely indicated by the paper what V_ev is
#' used interestitial + endosomal + cellular because that neatly subdivides
#' the tissue volume from shah/betts into two compartments
#' on 2/13/2020, I tried just using the interstitial space, but it did not
#' improve model performance
V_ev_lungs = 0.0384 + 0.00102 + 0.111,
V_ev_heart = 0.0217 + 0.000760 + 0.119,
V_ev_kidney = 0.0788 + 0.00263 + 0.391,
V_ev_brain = 0.0873 + 0.00243 + 0.376,
V_ev_muscle = 1.47 + 0.0566 + 9.34,
V_ev_bone = 0.525 + 0.0141 + 2.17,
V_ev_skin = 1.66 + 0.0251 + 3.00,
V_ev_adipose = 0.337 + 0.00991 + 1.60,
V_ev_si = 0.127 + 0.00364 + 0.577,
V_ev_li = 0.0545 + 0.00157 + 0.248,
V_ev_spleen = 0.0254 + 0.000635 + 0.0730,
V_ev_liver = 0.385 + 0.00963 + 1.23,
V_ev_pancreas = 0.0169 + 0.000485 + 0.0699,
V_ev_others = 0.0797 + 0.00233 + 0.348,
F_lungs = 1,
F_heart = 1,
F_kidney = 1,
F_brain = 1,
F_muscle = 1,
F_bone = 1,
F_tumor = 1,
F_skin = 1,
F_adipose = 1,
F_si = 1,
F_li = 1,
F_spleen = 1,
F_liver = 1,
F_pancreas = 1,
F_others = 1,
R_kidney = 3.9,
R_spleen = 9.8,
R_liver = 2.5,
E_lungs = 0.84,
#' This isn't very well explained in either 2012 or 2019 paper, so there is a bit of guessing going on
#' Shah and Betts' model only uses a single lymph node with volume = 0.133
#' All lymph node volumes are arbitrarily set to 1/3 the volume of the single lymph node from
#' shah and betts's parameterization because it produces a stable simulation
V_lymph_node = 0.113/3,
V_IGLN = 0.113/3,
V_TDLN = 0.113/3,
#' Adding the plasma and blood cells volumes together
V_whole_blood = 0.944 + 0.773,
#' Lymph flow was .2% of plasma flow
L_lymph_node = 1.65/500,
L_IGLN = 1.65/500,
L_TDLN = 1.65/500,
J_tumor = 0.6, # pulled directly from Khot et. al
Q_tumor = 6, # pulled directly from Khot et. al
#' 12.7 l/h/l tumor plasma flow
#' volume of tumor is 0.45 ml i.e. 0.45e-3 liters
#' 12.7*4.5E-4 = 0.005715 l/h
#' 0.005715*1E3 = 5.7... ml/h
#' finally, divide by 500 - i.e. 0.2% of plasma - to get lymph flow
L_tumor = 12.7*(4.5E-1)/500,
V_v_tumor = 0.45,
#' In shah/betts they claim that vascular volume is 7% of toal volume
#' working backward, I can then get total volume = 0.45/0.07
#' Then from total volume I can get interstitial and endosomal volume, 55% and 0.5%
#' of the total respectively. Unfortunately, no estimates on cellular volume for
#' tumors in shah/betts
V_ev_tumor = (0.45/0.07)*(.55+.005)
)
#The tumor parameters have to be specifically rethought. See https://cancerres.aacrjournals.org/content/54/6/1517.long
#and ctrl+F tumor in the shah and betts paper to see how they arrived at various values
parameters_mod_lymph <- c(
J_lungs = 1843.0,
J_heart = 34.9,
J_kidney = 87.3,
J_brain = 1.4,
J_muscle = 0.5,
J_bone = 82.6,
J_skin = 0.6,
J_adipose = 1.6,
J_si = 12.9,
J_li = 5.2,
J_spleen = 114.0,
J_liver = 126.9,
J_pancreas = 10.0,
J_others = 86.8,
# Q from Shah and Betts 2012, plasma + blood cell flow
Q_lungs = 373 + 305,
Q_heart = 36.5 + 29.9,
Q_kidney = 68.5 + 56.1,
Q_brain = 11.8 + 9.64,
Q_muscle = 86.1 + 70.5,
Q_bone = 15.2 + 12.4,
Q_skin = 27.8 + 22.8,
Q_adipose = 13.4 + 11.0,
Q_si = 58.1 + 47.5,
Q_li = 17.3 + 14.1,
Q_spleen = 8.18 + 6.70,
Q_liver = 10.3 + 8.40,
Q_pancreas = 6.24 + 5.10,
Q_others = 10.9 + 8.91,
#' Shah and Betts 2012, total Lymph flow was .2% of plasma flow
L_lungs = 373/500,
L_heart = 36.5/500,
L_kidney = 68.5/500,
L_brain = 11.8/500,
L_muscle = 86.1/500,
L_bone = 15.2/500,
L_skin = 27.8/500,
L_adipose = 13.4/500,
L_si = 58.1/500,
L_li = 17.3/500,
L_spleen = 8.18/500,
L_liver = 10.3/500,
L_pancreas = 6.24/500,
L_others = 10.9/500,
#' assumed here that plasma vol + blood cell vol = V_vascular
V_v_lungs = 0.0295 + 0.0241,
V_v_heart = 0.00585 + 0.00479,
V_v_kidney = 0.0289 + 0.0236,
V_v_brain = 0.0107 + 0.00873,
V_v_muscle = 0.249 + 0.204,
V_v_bone = 0.0621 + 0.0508,
V_v_skin = 0.188 + 0.154,
V_v_adipose = 0.0218 + 0.0178,
V_v_si = 0.0116 + 0.00950,
V_v_li = 0.0050 + 0.00409,
V_v_spleen = 0.0154 + 0.0126,
V_v_liver = 0.164 + 0.134,
V_v_pancreas = 0.00534 + 0.00437,
V_v_others = 0.0195 + 0.0160,
#' never explicitely indicated by the paper what V_ev is
#' used interestitial + endosomal + cellular because that neatly subdivides
#' the tissue volume from shah/betts into two compartments
#' on 2/13/2020, I tried just using the interstitial space, but it did not
#' improve model performance
V_ev_lungs = 0.0384 + 0.00102 + 0.111,
V_ev_heart = 0.0217 + 0.000760 + 0.119,
V_ev_kidney = 0.0788 + 0.00263 + 0.391,
V_ev_brain = 0.0873 + 0.00243 + 0.376,
V_ev_muscle = 1.47 + 0.0566 + 9.34,
V_ev_bone = 0.525 + 0.0141 + 2.17,
V_ev_skin = 1.66 + 0.0251 + 3.00,
V_ev_adipose = 0.337 + 0.00991 + 1.60,
V_ev_si = 0.127 + 0.00364 + 0.577,
V_ev_li = 0.0545 + 0.00157 + 0.248,
V_ev_spleen = 0.0254 + 0.000635 + 0.0730,
V_ev_liver = 0.385 + 0.00963 + 1.23,
V_ev_pancreas = 0.0169 + 0.000485 + 0.0699,
V_ev_others = 0.0797 + 0.00233 + 0.348,
F_lungs = 1,
F_heart = 1,
F_kidney = 1,
F_brain = 1,
F_muscle = 1,
F_bone = 1,
F_tumor = 1,
F_skin = 1,
F_adipose = 1,
F_si = 1,
F_li = 1,
F_spleen = 1,
F_liver = 1,
F_pancreas = 1,
F_others = 1,
R_kidney = 3.9,
R_spleen = 9.8,
R_liver = 2.5,
E_lungs = 0.84,
#' This isn't very well explained in either 2012 or 2019 paper, so there is a bit of guessing going on
#' Shah and Betts' model only uses a single lymph node with volume = 0.133
#' All lymph node volumes are arbitrarily set to 1/3 the volume of the single lymph node from
#' shah and betts's parameterization
V_lymph_node = 0.113/3,
V_IGLN = 0.113/3,
V_TDLN = 0.113/3,
#' Adding the plasma and blood cells volumes together
V_whole_blood = 0.944 + 0.773,
#' Lymph flow was .2% of plasma flow
L_lymph_node = 1.65,
L_IGLN = 1.65,
L_TDLN = 1.65,
J_tumor = 0.6, # pulled directly from Khot et. al
Q_tumor = 6, # pulled directly from Khot et. al
#' 12.7 l/h/l tumor plasma flow
#' volume of tumor is 0.45 ml i.e. 0.45e-3 liters
#' 12.7*4.5E-4 = 0.005715 l/h
#' 0.005715*1E3 = 5.7... ml/h
#' finally, divide by 500 - i.e. 0.2% of plasma - to get lymph flow
L_tumor = 12.7*(4.5E-1)/500,
V_v_tumor = 0.45,
#' In shah/betts they claim that vascular volume is 7% of toal volume
#' working backward, I can then get total volume = 0.45/0.07
#' Then from total volume I can get interstitial and endosomal volume, 55% and 0.5%
#' of the total respectively. Unfortunately, no estimates on cellular volume for
#' tumors in shah/betts
V_ev_tumor = (0.45/0.07)*(.55+.005)
)
which(!(parameters == parameters_mod_lymph))
unlist(unname(which(!(parameters == parameters_mod_lymph))))
parameters[unlist(unname(which(!(parameters == parameters_mod_lymph))))]
parameters_mod_lymph[unlist(unname(which(!(parameters == parameters_mod_lymph))))]
0.0033**-1
#' Author: Benjamin K Schneider
#' Date: 12.19.2019.... First Major update on 02.07.2020
#' Notes =========================================================
#'
#' General form for the vascular tissu.e =========================
# dC_v_TISSU.E =
# (Q_TISSU.E*C_v_lungs - (Q_TISSU.E - L_TISSU.E)*C_v_TISSU.E)*V_v_TISSU.E -
# J_TISSU.E*C_v_TISSU.E
#' General form for the vascular tissu.e 02.07.2020 update =======
# #' Typical tissue
# dC_v_TISSU.E =
# (Q_TISSU.E*C_v_lungs - (Q_TISSU.E - L_TISSU.E)*C_v_TISSU.E -
# J_TISSU.E*C_v_TISSU.E*V_v_TISSU.E)/V_v_TISSU.E
#' General form for the vascular tissu.e with retention 02.07.2020 update
# dC_v_TISSU.E =
# (Q_TISSU.E*C_v_lungs - (Q_TISSU.E - L_TISSU.E)*C_v_TISSU.E -
# J_TISSU.E*C_v_TISSU.E*V_v_TISSU.E)/V_v_TISSU.E
#' General form for the Evascular tissu.e ========================
# dC_ev_TISSU.E =
# (J_TISSU.E*C_v_TISSU.E*V_v_TISSU.E - L_TISSU.E*C_ev_TISSU.E*F_TISSU.E)/V_ev_TISSU.E
#'
#' General form for the Evascular tissu.e with retention =========
# dC_ev_TISSU.E =
# (J_TISSU.E*C_v_TISSU.E*V_v_TISSU.E - L_TISSU.E*(C_ev_TISSU.E/R_TISSU.E)*F_TISSU.E)/V_ev_TISSU.E
source("ini.R") ;
#source("cmt_names.R") ;
source("parameters.R")
library(deSolve)
times = seq(0, 30, by = .1)
mod = function(t, state_mod_lymph, parameters_mod_lymph) {
with(as.list(c(state_mod_lymph, parameters_mod_lymph)), {
# C_lymph_node ========================================================
{ #' Unique compartment dynamics. These were modified on 02/11/2020 to reflect that there
#' is lymph flow from vascular and ev sources. But, this differs from the paper
#' where only extravascular volume lymph flow is considered.
#' The kidney line is slightly different than the paper, but I think there was possibly
#' a typo in the original paper? they report L_ev_kidney/R_kidney instead of
#' C_ev_kidney/R_kidney for some reason...
#' On 2.13.2020 I'm making a 3rd revision where
#' F_tissue x L_tissue x (C_ev_tissue + C_v_tissue) + is reverted back to
#' F_tissue x L_tissue x (C_ev_tissue + C_v_tissue)
dC_lymph_node =
(F_lungs *L_lungs *C_ev_lungs +
F_heart *L_heart *C_ev_heart +
F_brain *L_brain *C_ev_brain +
F_skin *L_skin *C_ev_skin +
F_adipose *L_adipose *C_ev_adipose +
F_si *L_si *C_ev_si +
F_li *L_li *C_ev_li +
F_pancreas *L_pancreas *C_ev_pancreas +
F_others *L_others *C_ev_others +
F_kidney *L_kidney *((C_ev_kidney)/R_kidney) +
F_spleen *L_spleen *((C_ev_spleen)/R_spleen) +
F_liver *L_liver *((C_ev_liver)/R_liver) +
L_TDLN *C_TDLN +
L_IGLN *C_IGLN -
L_lymph_node*C_lymph_node) /V_lymph_node}
# C_whole_blood ========================================================
{ #' Unique comparment dynamics
dC_whole_blood =
(-1*(Q_lungs +L_lungs) *C_whole_blood +
(Q_heart -L_heart) *C_v_heart +
(Q_kidney -L_kidney) *C_v_kidney +
(Q_brain -L_brain) *C_v_brain +
(Q_muscle -L_muscle) *C_v_muscle +
(Q_bone -L_bone) *C_v_bone +
(Q_skin -L_skin) *C_v_skin +
(Q_adipose -L_adipose) *C_v_adipose +
(Q_others -L_others) *C_v_others +
((Q_si -L_si) +
(Q_li -L_li) +
(Q_spleen -L_spleen) +
(Q_pancreas -L_pancreas) +
(Q_liver -L_liver)) *C_v_liver +
0) }#/V_whole_blood}
# C_v_tumor ========================================================
#' Typical tissue
dC_v_tumor =
(Q_tumor*C_v_lungs - (Q_tumor - L_tumor)*C_v_tumor -
J_tumor*C_v_tumor*V_v_tumor)#/V_v_tumor
# C_v_liver ========================================================
#' Unique compartment
dC_v_liver =
(Q_liver*C_v_lungs +
(Q_si - L_si) *C_v_si +
(Q_li - L_li) *C_v_li +
(Q_spleen - L_spleen) *C_v_spleen +
(Q_pancreas - L_pancreas)*C_v_pancreas -
((Q_si - L_si) + (Q_li - Q_li) + (Q_spleen - L_spleen) +
(Q_pancreas - L_pancreas) + (Q_liver - L_liver))*C_v_liver -
J_liver*C_v_liver*V_v_liver)#/V_v_liver
# C_v_lungs ========================================================
#' Unique compartment
dC_v_lungs = ((Q_lungs + L_lungs)*C_whole_blood -
Q_lungs*C_v_lungs -
J_lungs*C_v_lungs*V_v_lungs -
E_lungs*C_v_lungs*V_v_lungs)#/V_v_lungs
# C_v_adipose ========================================================
#' Typical tissue
dC_v_adipose =
(Q_adipose*C_v_lungs - (Q_adipose - L_adipose)*C_v_adipose -
J_adipose*C_v_adipose*V_v_adipose)#/V_v_adipose
# C_v_heart ========================================================
#' Typical tissue
dC_v_heart =
(Q_heart*C_v_lungs - (Q_heart - L_heart)*C_v_heart -
J_heart*C_v_heart*V_v_heart)#/V_v_heart
# C_v_kidney ========================================================
#' Kidney spleen and liver have retention
dC_v_kidney =
(Q_kidney*C_v_lungs - (Q_kidney - L_kidney)*C_v_kidney -
J_kidney*C_v_kidney*V_v_kidney)#/V_v_kidney
# C_v_brain ========================================================
#' Typical tissue
dC_v_brain =
(Q_brain*C_v_lungs - (Q_brain - L_brain)*C_v_brain -
J_brain*C_v_brain*V_v_brain)#/V_v_brain
# C_v_others ========================================================
#' Typical tissue
dC_v_others =
(Q_others*C_v_lungs - (Q_others - L_others)*C_v_others -
J_others*C_v_others*V_v_others)#/V_v_others
# C_v_skin ========================================================
#' Typical tissue
dC_v_skin =
(Q_skin*C_v_lungs - (Q_skin - L_skin)*C_v_skin -
J_skin*C_v_skin*V_v_skin)#/V_v_skin
# C_v_si ========================================================
#' Typical tissue
dC_v_si =
(Q_si*C_v_lungs - (Q_si - L_si)*C_v_si -
J_si*C_v_si*V_v_si)#/V_v_si
# C_v_li ========================================================
#' Typical tissue
dC_v_li =
(Q_li*C_v_lungs - (Q_li - L_li)*C_v_li -
J_li*C_v_li*V_v_li)#/V_v_li
# C_v_spleen ========================================================
#' Kidney spleen and liver have retention
dC_v_spleen =
(Q_spleen*C_v_lungs - (Q_spleen - L_spleen)*C_v_spleen -
J_spleen*C_v_spleen*V_v_spleen)#/V_v_spleen
# C_v_pancreas ========================================================
#' Typical tissue
dC_v_pancreas =
(Q_pancreas*C_v_lungs - (Q_pancreas - L_pancreas)*C_v_pancreas -
J_pancreas*C_v_pancreas*V_v_pancreas)#/V_v_pancreas
# C_v_muscle ========================================================
#' Typical tissue
dC_v_muscle =
(Q_muscle*C_v_lungs - (Q_muscle - L_muscle)*C_v_muscle -
J_muscle*C_v_muscle*V_v_muscle)#/V_v_muscle
# C_v_bone ========================================================
#' Typical tissue
dC_v_bone =
(Q_bone*C_v_lungs - (Q_bone - L_bone)*C_v_bone -
J_bone*C_v_bone*V_v_bone)#/V_v_bone
# C_TDLN ========================================================
#' Unique compartment
dC_TDLN = (L_bone*(F_bone/2)*C_ev_bone + L_muscle*(F_muscle/2)*C_ev_muscle +
F_tumor*L_tumor*C_ev_tumor - C_TDLN*L_TDLN)#/V_TDLN
# C_IGLN ========================================================
#' Unique compartment
dC_IGLN =(L_bone*(F_bone/2)*C_ev_bone + L_muscle*(F_muscle/2)*C_ev_muscle -
C_IGLN*L_IGLN)#/V_IGLN
# C_ev_tumor ========================================================
#' typical ev compartment
dC_ev_tumor =
(J_tumor*C_v_tumor*V_v_tumor - L_tumor*C_ev_tumor*F_tumor)#/V_ev_tumor
# C_ev_liver ========================================================
#' Unique compartment
dC_ev_liver =
(J_liver*C_v_liver*V_v_liver - L_liver*(C_ev_liver/R_liver)*F_liver)#/V_ev_liver
# C_ev_lungs ========================================================
#' Unique ev cmt
dC_ev_lungs = (J_lungs*C_v_lungs*V_v_lungs -
L_lungs*C_ev_lungs*F_lungs)#/V_ev_lungs
# C_ev_adipose ========================================================
#' typical ev compartment
dC_ev_adipose =
(J_adipose*C_v_adipose*V_v_adipose - L_adipose*C_ev_adipose*F_adipose)#/V_ev_adipose
# C_ev_heart ========================================================
#' typical ev compartment
dC_ev_heart =
(J_heart*C_v_heart*V_v_heart - L_heart*C_ev_heart*F_heart)#/V_ev_heart
# C_ev_kidney ========================================================
#' typical ev compartment with retention
dC_ev_kidney =
(J_kidney*C_v_kidney*V_v_kidney - L_kidney*(C_ev_kidney/R_kidney)*F_kidney)#/V_ev_kidney
# C_ev_brain ========================================================
#' typical ev compartment
dC_ev_brain =
(J_brain*C_v_brain*V_v_brain - L_brain*C_ev_brain*F_brain)#/V_ev_brain
# C_ev_others ========================================================
#' typical ev compartment
dC_ev_others =
(J_others*C_v_others*V_v_others - L_others*C_ev_others*F_others)#/V_ev_others
# C_ev_skin ========================================================
#' typical ev compartment
dC_ev_skin =
(J_skin*C_v_skin*V_v_skin - L_skin*C_ev_skin*F_skin)#/V_ev_skin
# C_ev_si ========================================================
#' typical ev compartment
dC_ev_si =
(J_si*C_v_si*V_v_si - L_si*C_ev_si*F_si)#/V_ev_si
# C_ev_li ========================================================
#' typical ev compartment
dC_ev_li =
(J_li*C_v_li*V_v_li - L_li*C_ev_li*F_li)#/V_ev_li
# C_ev_spleen ========================================================
#' typical ev compartment with retention
dC_ev_spleen =
(J_spleen*C_v_spleen*V_v_spleen - L_spleen*(C_ev_spleen/R_spleen)*F_spleen)#/V_ev_spleen
# C_ev_pancreas ========================================================
#' typical ev compartment
dC_ev_pancreas =
(J_pancreas*C_v_pancreas*V_v_pancreas - L_pancreas*C_ev_pancreas*F_pancreas)#/V_ev_pancreas
# C_ev_muscle ========================================================
#' typical ev compartment
dC_ev_muscle =
(J_muscle*C_v_muscle*V_v_muscle - L_muscle*C_ev_muscle*F_muscle)#/V_ev_muscle
# C_ev_bone ========================================================
#' typical ev compartment
dC_ev_bone =
(J_bone*C_v_bone*V_v_bone - L_bone*C_ev_bone*F_bone)#/V_ev_bone
# elimination ========================================================
#' Basically an AUC type parameter
delimination = E_lungs*C_v_lungs - 1E3*elimination
# return ========================================================
return(list(c(dC_lymph_node=dC_lymph_node,
dC_whole_blood=dC_whole_blood,
dC_v_tumor=dC_v_tumor,
dC_v_liver=dC_v_liver,
dC_v_lungs=dC_v_lungs,
dC_v_adipose=dC_v_adipose,
dC_v_heart=dC_v_heart,
dC_v_kidney=dC_v_kidney,
dC_v_brain=dC_v_brain,
dC_v_others=dC_v_others,
dC_v_skin=dC_v_skin,
dC_v_si=dC_v_si,
dC_v_li=dC_v_li,
dC_v_spleen=dC_v_spleen,
dC_v_pancreas=dC_v_pancreas,
dC_v_muscle=dC_v_muscle,
dC_v_bone=dC_v_bone,
dC_TDLN=dC_TDLN,
dC_IGLN=dC_IGLN,
dC_ev_tumor=dC_ev_tumor,
dC_ev_liver=dC_ev_liver,
dC_ev_lungs=dC_ev_lungs,
dC_ev_adipose=dC_ev_adipose,
dC_ev_heart=dC_ev_heart,
dC_ev_kidney=dC_ev_kidney,
dC_ev_brain=dC_ev_brain,
dC_ev_others=dC_ev_others,
dC_ev_skin=dC_ev_skin,
dC_ev_si=dC_ev_si,
dC_ev_li=dC_ev_li,
dC_ev_spleen=dC_ev_spleen,
dC_ev_pancreas=dC_ev_pancreas,
dC_ev_muscle=dC_ev_muscle,
dC_ev_bone=dC_ev_bone,
delimination=delimination)))
})
}
#an example of how to simulate and plot
o = ode(y = state_mod_lymph, times = times, func = mod, parms = parameters_mod_lymph, events = events, method = "lsoda")
plot(o, col='red')