Events which introduce dicontinuities (Simbiology toolbox)
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
What is the best way of using events in SimBiology which change the parameters in a discontinuous way. Sometimes the solver crashes because of these which is annoying. I want to simulate an experiment in which the medium is changed from glucose -> glycerol , and back, many times. So the concentrations of these are not continuous, which gives me troubles sometimes. I use sundials solver.
Best,
Razvan
댓글 수: 0
채택된 답변
Arthur Goldsipe
2011년 5월 14일
Hi Razvan,
There's a SimBiology demo on this topic. Execute the following from the MATLAB prompt and see if that answers your question:
showdemo('discontSimBiologyModel')
If you still have questions after reading the demo, please post again.
Also, can you clarify what you mean by "the solver crashes"? If you introduce a discontinuity in an ODE without using events, I would not be surprised if you got some sort of error message that the solver that the step size could not be reduced enough to meet the error tolerances. But if you got some other sort of error, then I encourage you to give further details (reproduction steps, etc.), either to technical support or via email. (I will separately send you an email address for such feedback.)
The reason you may receive an error message is that the solver tries to use a continuous interpolating function to predict the system's behavior across the discontinuity. It sees that the interpolant works poorly and keeps trying to improve the interpolant by reducing the size of the time step that it takes. If the solver reaches the minimum step size and is still unable to ensure the solution's accuracy, it will error. By using an event, you explicitly inform the solver there is a discontinuity, and it uses different interpolants before and after the event.
-Arthur
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Scan Parameter Ranges에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!