Debugging NaN/Inf right-hand-side values in SimBIology

1 view (last 30 days)
I’m getting an error while simulating a SimBiology model that I have NaN or Inf values on the right-hand-side, but I’m having trouble identifying the species/parameters responsible for this error. The issue occurs at the same time as an event, so I can’t just stop the simulation at a shorter timepoint to try to identify the cause of this error. Is there a simple way to identify what reaction is causing the NaN or Inf values?
When I turned on ‘dbstop if warning’, I was able to get into the ‘sbioodeflux’ right-hand side function. I can then see some Inf values, but I can’t figure out how to map those Inf values back to model elements. In particular, I see that reactionFlux(77) is Inf, but I don’t know which is the 77th reaction flux. Likewise, I don’t know what the elements of Y0 and P0 correspond to.
Is there an easy way for me to get more detailed information on the cause of NaN and Inf values in SimBiology? If not, is there a way I can figure out the mapping of the elements in the ‘sbioodeflux’ function to the model element names? This mapping must exist somewhere, but I can’t find it.

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 29 Jan 2019
Hi Abed,
There's not currently any documented way to do this sort of debugging. We know that's a pain, so we're working on a debugger for a future release. But in the interim, the best bet is to contact us here at MathWorks to see if we can use any of our internal tools to help you. Because these tools depend on implementation details that could change from release to release, I can't really provide them here. It's generally easiest if you can share your model, but I recognize that this is not always possible.
I will contact you via your MATLAB Answers profile with a few more details.

Sign in to comment.

More Answers (0)


More Answers in the  SimBiology Community





Community Treasure Hunt

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

Start Hunting!