Machine precision in simulink
Show older comments
Good morning everyone.
I am currently working on simulink model.
One of the equations is
"L = qf*(XL0+(XL1*alpha_quadrant))"
where "alpha_quadrant" is constantly zero. "XL0" and "qf" are both constants.
The result of the equation, when graphed, should be constantly -11.08, but as it can be seen in the picture the result keeps fluttering.
Is it because of the machine precision?
3 Comments
dpb
on 14 Jul 2021
Without Simulink in the picture, a product of two constants (presuming they are and do, in fact, remain constant) will indeed produce the same result to the final rounded bit.
Simulink, however, may do something behind the scenes in the model that mungs on the input terms that are those constants and thereby introduce some rounding which it would appear from the plot is what you're seeing.
However, would have to have the pertinent section of the model for anybody to be able to tell anything more definitive -- and, I don't have and have never seen a Simulink installation so I'm guessing here on what is possible given what I do understand about its operation.
MARCO LORENZI
on 15 Jul 2021
dpb
on 15 Jul 2021
"All that noise" is also in the 14th decimal place in the output. How can that make any real difference?
Just set
ylim([-10 -12])
on the plot so the tiny little jiggle isn't so amplified and you'd never have noticed it.
Accepted Answer
More Answers (0)
Categories
Find more on General Applications 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!