Why do I get an error "Division by zero" when I switch to normal mode but No error by using accelerator mode?
Ältere Kommentare anzeigen
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 Kommentare
Jan
am 1 Mär. 2023
Without seeing any part of the model, it is impossible to guess the cause of an error.
Noureddine Doumi
am 1 Mär. 2023
Noureddine Doumi
am 1 Mär. 2023
Jan
am 1 Mär. 2023
The code and the error message would be useful.
Antworten (2)
Pratheek
am 1 Mär. 2023
0 Stimmen
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.
Noureddine Doumi
am 1 Mär. 2023
0 Stimmen
Kategorien
Mehr zu Interactive and Graphical Tuning finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!