how to avoid rounding off error in simulink calculations?
Show older comments
Hi, I have a simulink model including a level 2 S function block. The code in the s function ia a numerical scheme that solves a PDE . When this code is run as a script alone the results are exactly accurate..but when the model is simulated they results differ from the accurate ones. I have checked and compared the results thoroughly and I guess in the very first step there is a rounding off error which is causing the results to differ. With each iteration the error is getting summed up. Is there any way to avoid this error?? Please help. I am using all variables in double data type. Please answer. Thanks.
Accepted Answer
More Answers (0)
Categories
Find more on General Applications in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!