- This documentation page lists simulation troubleshooting tips.
- The SimBiology Model Debugger allows you to step through simulation, inspect values, and detect common problems like negative values.
Simbiology in app model simulation
조회 수: 1 (최근 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
댓글 수: 0
채택된 답변
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)
추가 답변 (0개)
커뮤니티
더 많은 답변 보기: SimBiology Community
참고 항목
카테고리
Help Center 및 File Exchange에서 Import Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!