Skip to content

Conversation

@glfharris
Copy link

Hi,

Not sure if it's just that I'm misinterpreting the literature, but I'm not sure the current version is accounting to the effects of the different volumes of the compartments during the one_second function.

From An Overview of TCI & TIVA - A. Absalom & M Struys:

If for drug X the rate constants k13 and k31 are 0.05 and 0.005 respectively, this means that in each unit of time 5% of the total amount of drug X in compartment 1 moves to compartment 3, whereas 0.5% of the amount of drug in compartment 3 moves into compartment 1 in each unit of time.
p. 25

The current way appears to effectively be calculating say 5% of the concentration, rather than 5% of the total mass of propofol within the compartment.

So in order to update the change in concentration per second (e.g. $\frac{\delta x_3}{dt}$) you would need to calculate the total flow of mass of propofol, then dividing that by the volume of the target compartment (e.g. self.v3).

$\frac{\delta x_3}{dt} = (k_{13} v_1 x_1 - k_{31} v_3 x_3) / v_3$

or

def one_second(self):
    # ...
    dx3dt = (self.k13 * self.v1 * self.x1 - self.k31 * self.v3 * self.x3) / self.v3

    self.x3 += dx3dt
    # ...

From what I've read the effect compartments are modeled differently, or without volume, so I think the current way works.

Apologies if I'm barking up the wrong tree, most of the papers I've read don't have enough information in them to properly implement algorithms, so haven't had much to go on.

Changed function one_second to account for the different volumes between
each compartment. Now calculates mass of drug moving via pathway:

(conc. * vol * rate constant - e.g. self.x2 * self.v2 * self.k21)

Then divides by the volume of the target compartment to calculate the
influence on concentration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant