Dividing by compartment volume automatically:

Daniel Bending on 10 Oct 2023
Latest activity Reply by Daniel Bending on 12 Oct 2023

Hello all,
I've been trying to shift my workflow more towards simbiology, it has a lot of very interesting features and it makes sense to try and do everything in one place if it works well..! Part of my hesitancy into this was some bad experiences handling units in the past, though this was almost certainly all out of my own ignorance, relatedly:
Getting onto my question.
In this model I have a species traveling around the body via blow flow, think a basic PBPK model. My species are picomolarities, if everything is already in concentrations, why is it necessary to initially divide by the compartment volume? i.e. 1/Pancreas below.
If my model dealt in molar quantities this would make a lot of sense, the division would represent the transition to concentrations. This, however, now necessitates my parameters be in units of liter/minute, which is actually correct, but I'd like clarification on why it's correct, ha!
Perhaps this is more of a modelling question than a simbiology question, but if there are answers I'd love to hear them. Thanks!
Arthur Goldsipe
Arthur Goldsipe on 11 Oct 2023
SimBiology supports constructing a model where all the species have dimensions of concentration. And most reactions can also be written with dimensions of concentration/time. But some reactions involving multiple compartments (for example, when two reactants in different compartments) must be written with dimensions of amount/time. The reason this is necessary is that SimBiology always needs to know how to compute a reaction rate in amount/time so that it can perform mass balances. Note that you will need to put units on all the components in the model in order for SimBiology to know that your reaction rates have dimensions of concentration/time. You can find more details by searching for "Reaction Rate Dimensions" on this page.
Even when you write your reactions with dimensions of concentration/time, you will still see volume terms in the equations. That's basically unavoidable when you have species in concentration. But you should be able to write reactions using rate constants with the units you want. So, for example, kipl could have units of 1/minute. (In the case you mention where the units are liter/minute, this rate constant effectively includes the volume, so you could think of this as , where the "amount" constant gives a rate in amount/time and the "conc" constant gives a rate in concentration/time).
To illustrate this approach, I'm attaching a project where I've attempt to recreate your model with reaction units in concentration/time. When you view the equations for this model, you'll see the following:
Note that the primary difference from the equation you shared is that each of the subterms are now multiplied by tjhe appropriate compartment volume. So for all the reactions that originate in the Pancreas, you'll see the multiplication by Pancreas volume cancels out with the division by Pancreas volume. But for the reaction that originates in the Aterial compartment, you'll see that the rate now depends on the ratio of the two compartment volumes (since that reaction rate was written relative to the Arterial compartment).
Hopefully that clears things up a bit.
-Arthur
Daniel Bending
Daniel Bending on 12 Oct 2023
Arthur, thank you for the incredible reply.
I've done the 1/minute experiment myself to see how it changes things. So in effect, the units of volume are necessary to reduce it down to units of amount/time, be that from an external parameter (i.e. liter/minute) or by including a multiplication by source volume (i.e. *arterial), then there is a mass balance stage here, which I assume is ensuring the same quantity leaves as enters the next compartment, assuming a 1-1 stoichiometry, then the whole equation is divided by the current volume (i.e. the 1/pancreas*)?
I'm grasping it to a degree, though I'm not finding it completely intuitive. If you don't mind another question, how does reducing it to quantity/time, then dividing it by the current volume, still ensure mass action? From one perspective we have:
1/Pancreas*(-(kipl*Pancreas.insulin))
then at the destination:
1/Liver*((kipl*Pancreas.insulin))
Actually, you know I think I've answered my own question. It's amount/time, being put into a different volume, and therefore having a different concentration.
In the alternative scenario, the *pancreas is nessicary to do the same, and the 1/pancreas and 1/liver maintain the actual variation in concentration, you would end up with.
pancreas/pancreas*(-kipl*Pancreas.insulin) = -kipl*Pancreas.insulin
And:
pancreas/liver*(kipl*Pancreas.insulin)
Which just describes the ratio change in concentration more obviously.
Amazing, thank you for the help!