Simbiology in app model simulation

5 次查看(过去 30 天)
Hello team and community,
I am currently working on a pharmacokinetic project that involves using a transit compartment model (DOI: 10.1007/s10928-007-9066-0) to describe drug absorption.
I have constructed the model using the Simbiology app and have written a script for a specific function usede in the model (attached in the files).
For the solver type, I have selected Sundials.
However, I have encountered some strange results when carrying out simulations using the in-app model simulation functionality.
I noticed that when I set the stop time from 1 to 7 hours, the simulation results appear to be fine.
However, when I set the stop time to 8 hours or above, the simulation results show some unexpected behavior that I cannot comprehend.
[stop time = 7 hour]
[stop time = 8 hour]
[stop time = 48 hour]
I would greatly appreciate it if you could provide me with some insights into this problem.
Thank you very much.
Jesse

采纳的回答

Arthur Goldsipe
Arthur Goldsipe 2023-7-12
I think the problem comes down to the way that calculate_KTC depends on time. This function has a maximum around a time of 1. If you are not careful with the solver options, the initial time steps result in a KTC that is so small that the solver might take a large time step that overshoots the large values in KTC and instead once again results in KTC values that are very small. So the solver never steps through a time range where KTC is large enough to cause a significant change.
There are several solver options you could change to fix this. But for this specific situation I would probably set MaxStep to something like 0.1 or 1. The exact value probably doesn't matter too much, but I wanted to pick something that would ensure the solver steps to to a time where KTC is significantly large. As with many of these solver options, you should be caeful not to set it to too extreme of a value. If you constrain the solver too much, simulations may take much longer than necessary. But if you don't constrain the solver enough, your results will be inaccurate. So in general you may need to use a bit of trial and error.
I also want to point you to a couple of other resources that can be useful when you have simulation errors:
-Arthur (he/him/his)
  1 个评论
Jesse Chao
Jesse Chao 2023-7-15
Hello Arthur,
Thank you for your response and all the other resources!
It is just as you said. I genuinely appreciate your clear explanation.
Have a great day!
Jesse

请先登录,再进行评论。

更多回答(0 个)

社区

更多回答在  SimBiology Community

类别

Help CenterFile Exchange 中查找有关 Scan Parameter Ranges 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by