Changing the result of a simulation with changing the units

1 view (last 30 days)
Hi,
If the injected amount in model compartments is in mole and the transfer rates are in 1/hour. I set the domensional analysis and unit conversion to be on. I used a nonlinear uptake rate as a repeated assignment rule in the model as follows:
k_ass = (kon/volume) * free_receptors
free_receptors is in nanomole, kon is in liter/(mole*hour) and volume iis in liter.
If I change the value of kon to be in liter/(nanomole*hour) and keep other units as they are, I will get different simulation results than that when I keep it as before in liter/(mole*hour).
Could you please explain the reason?
Thank you
  9 Comments
Arthur Goldsipe
Arthur Goldsipe on 18 Oct 2024
Without more details (ideally a way to reproduce the issue), it's difficult for me to say exactly what's going on. But if you turn on unit conversion and change the units of kon from liter/(mole*hour) to liter/(nanomole*hour), then you would need to multiply the numeric value of kon by 1e-9 to to preserve the same numeric behavior. If you've made such a change and you get different results, then I am surprised. My guess is that you changed something else without realizing it. It is also possible that you've run into a bug, but I think that's unlikely given the extensive testing that we've done of this functionality.
If you can provide reproduction steps, the community can more easily help you. If you can't provide reproduction steps, here are some suggestions.
  • You can double check that you correctly converted the numeric value of kon when you change the units by using sbiounitcalculator. For example:
sbiounitcalculator('liter/(mole*hour)', 'liter/(nanomole*hour)', 1)
  • You can compare two models exactly what's different by using the functionality described here.
  • You can inspect your model equations and initial conditions as described here.
  • You can use the SimBiology Model Debugger to step through your simulations to try to figure out where things go wrong.
Good luck!
Day
Day on 18 Oct 2024
Edited: Day on 18 Oct 2024
@Arthur Goldsipe Thank you Arthur, I appreciate your help.
The conversion of units was done correctly. However, all your suggestions will be taken into consideration.
Thank you very much

Sign in to comment.

Answers (1)

Umar
Umar on 18 Oct 2024

Hi @Day ,

The discrepancy in simulation results arises from the dimensional analysis and the inherent relationships between the units involved. When you define k_{ass} as:

k_ass = (kon/volume) * free_receptors

where ( kon ) is in liter/(mole*hour), the units of k_{ass} become consistent with the other parameters in the model. However, when you change ( kon ) to liter/(mole*hour), you effectively alter the scale of the rate constant without adjusting the units of ( free_receptors ) (which remains in nanomoles). This change leads to a different interpretation of the uptake rate, as the conversion factor between moles and nanomoles (1 mole = ( 10^9 ) nanomoles) must be accounted for. Consequently, the rate of receptor binding and the overall dynamics of the model will differ, resulting in varied simulation outcomes. It is crucial to maintain consistent units across all parameters to ensure accurate modeling and interpretation of results. To illustrate this, consider the following MATLAB code snippet:

% Parameters
volume = 1; % in liters
kon_mole = 0.1; % in liter/(mole*hour)
kon_nanomole = kon_mole * 1e-9; % converting to liter/(nanomole*hour)
free_receptors = 50; % in nanomoles
% Nonlinear uptake rate calculation
k_ass_mole = (kon_mole / volume) * (free_receptors * 1e-9); % in moles
k_ass_nanomole = (kon_nanomole / volume) * free_receptors; % in nanomoles
disp(['Uptake rate (mole): ', num2str(k_ass_mole)]);
disp(['Uptake rate (nanomole): ', num2str(k_ass_nanomole)]);

In this example, the uptake rates calculated using different units for k_on will yield different results, demonstrating the importance of consistent unit usage in simulations.

Please see attached.

Hope this helps.

  4 Comments
Umar
Umar on 19 Oct 2024
Hi @Sam Chak,
Thank you for your insightful feedback regarding the use of the interactive SimBiology Model Analyzer app. I appreciate your observations about the potential application of compartment models and transfer rates in our analysis. Your point about the duality of pharmacokinetic and pharmacodynamic modeling—whether through SimBiology or standard MATLAB scripts—is well taken. It is indeed crucial to clarify our approach to ensure consistency and accuracy in our findings. Thank you once again for your valuable input.

Sign in to comment.

Categories

Find more on Scan Parameter Ranges in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!