Machine precision in simulink
显示 更早的评论
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 个评论
dpb
2021-7-14
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
2021-7-15
dpb
2021-7-15
"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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!