Machine precision in simulink

 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.

ANSWER provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

To determine what is happening, a good approach is to log the key signals involved.
Then use MATLAB to investigate the logged values.
I suspect you'll find that either alpha_quadrant isn't always zero or qf is not constant or XL0 is not constant.
The differences in values from what you expect might be very small so you could use some techniques like the following.
format long g  % will shows higher precision than short, but can still hide some differences

a = 0.05;
b = a + eps(a);
c = a + 2*eps(a);
v = [c,a,b]      % the differences will not be visible in the command window

% converting to a string with 17 digits will be enough to see differences

% subtracting values is another way to make the differences visible in the
% command window
dv = diff(v)

The output of this code is:



Popular posts from this blog

Why are Fourier series important? Are there any real life applications of Fourier series?

What are some good alternatives to Simulink?

What is the difference between a reversible machine and a self-locking machine?