Why do I get an error "Division by zero" when I switch to normal mode but No error by using accelerator mode?
14 views (last 30 days)
Show older comments
Hello,
I use a simulation model which contains a number of reference models and in order to speed up the performance I changed the simulation mode from Normal to Accelerator.
The simulation getting faster but recently I get on erro when I swicht back to Normal mode.
My question is:
Why do I get an error "Division by zero" when I switch to normal mode but No error by using accelerator mode?
Has anybody On Idea how to solve this Issue that I continue to use accelerator mode without having any software bug?
4 Comments
Answers (2)
Pratheek
on 1 Mar 2023
Hi Noureddine Doumi,
When you change your simulation mode from Normal to Accelerator to speed up the simulation, the simulation behaves differently in Accelerator mode. While the simulation runs faster, certain errors, such as "Division by zero," may be masked or not triggered in the Accelerator mode. This can happen because the Accelerator mode optimizes the way calculations are performed differently than the Normal mode.
If you switch back to Normal mode and get an error, it may be because a variable or constant has a value of zero, which is causing a "Division by zero" error. To fix the error, you need to identify the variable or constant causing the error and adjust its value so that it is not zero. You can also modify your simulation code to handle the "Division by zero" case by checking for a zero value before performing the division operation.
0 Comments
See Also
Categories
Find more on Manual Performance Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!