필터 지우기
필터 지우기

Simbiology in app model simulation

조회 수: 1 (최근 30일)
Jesse Chao
Jesse Chao 2023년 7월 12일
댓글: Jesse Chao 2023년 7월 15일
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에서 Import Data에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by