Professional Documents
Culture Documents
Laboratory Activity No. 3 Error Calculations
Laboratory Activity No. 3 Error Calculations
Error Calculations
1. Open labVIEW.
2. Open a new VI by clicking on Blank VI in the LabVIEW Getting Started
window.
3. Save the VI as Error Calculation.vi.
4. Create the front panel as shown in Figure 1.
Double click on the front panel and type the Maclaurin series for e x .
Figure 1
1|Page
Right-click on the front panel to open the Controls palette, and put down
a Numeric Control from the Modern Numeric sub-palette. Refer to Figure
2.
Figure 2
2|Page
Figure 3
Right click on the front panel to open the control palette, and put down a
Numeric Indicator from the Modern Numeric sub-palette, as shown in
Figure 4. Place the Numeric Indicator inside the array as shown in Figure
5.
3|Page
Figure 4
Figure 5
Adjust the size of the array and its dimension as shown in Figure 6.
4|Page
Figure 6
Figure 7
5|Page
Figure 8
6|Page
Type the commands inside the Mathscript Node and add inputs and
outputs as shown in Figure 9. Refer to Figure 7 to identify input and
output variables needed.
Figure 9
7|Page
Right-click on the block diagram to open the Functions palette and create
a For Loop structure from the Programming → Structures sub-palette, as
shown in Figure 10. Place the for-loop structure in such a way that the
mathscript node is positioned inside.
Figure 10
Add shift register by right clicking on the right side of the for-loop
structure and select Add Shift Register. Refer to Figure 11.
8|Page
Figure 11
9|Page
Figure 12
10 | P a g e
Problem:
11 | P a g e
SUMMARY OF LEARNING OUTCOMES:
In this Third experiment for Numerical Control we still utilize the LabView
Software but in addition to the Mathlab exntension.
12 | P a g e
DISCUSSION:
This experiment talks all about the Error calculations in math. Here are the types of
Errors that can be found in Numerical Engineering.
Roundoff Error
Roundoff errors occur because computers have a limited ability to represent numbers.
For example, π has infinite digits, but due to precision limitations, only 16 digits may be
stored in MATLAB. While this roundoff error may seem insignificant, if your process
involves multiple iterations that are dependent on one another, these small errors may
accumulate over time and result in a significant deviation from the expected value.
Furthermore, if a manipulation involves adding a large and small number, the effect of
the smaller number may be lost if rounding is utilized. Thus, it is advised to sum
numbers of similar magnitudes first so that smaller numbers are not “lost” in the
calculation.
Truncation Error
Truncation errors are introduced when exact mathematical formulas are represented by
approximations. An effective way to understand truncation error is through a Taylor
Series approximation. Let’s say that we want to approximate some function, f(x) at the
point xi+1, which is some distance, h, away from the basepoint xi, whose true value is
shown in black in Figure 1. The Taylor series approximation starts with a single zero
order term and as additional terms are added to the series, the approximation begins to
approach the true value. However, an infinite number of terms would be needed to
reach this true value.
The Tradeoff in Errors
The total error of an approximation is the summation of roundoff error and truncation
error. As seen from the previous sections, truncation error decreases as step size
decreases. However, when step size decreases, this usually results in the necessity for
more precise computations which consequently results in an increase in roundoff error.
Therefore, the errors are in direct conflict with one another: as we decrease one, the
other increases.
13 | P a g e
CONCLUSION
As future Electronics Engineers it is imperative for us to determine the most efficient
way of achieving the tasks we are going to part take in and one way of efficiency
testing is knowing the error factor of each component/instance.
as stated by Wikibooks "When using numerical methods or algorithms and computing
with finite precision, errors of approximation or rounding and truncation are introduced.
It is important to have a notion of their nature and their order. A newly developed
method is worthless without an error analysis. Neither does it make sense to use
methods which introduce errors with magnitudes larger than the effects to be measured
or simulated. On the other hand, using a method with very high accuracy might be
computationally too expensive to justify the gain in accuracy."
The Tradeoff in Errors
The total error of an approximation is the summation of roundoff error and truncation
error. As seen from the previous sections, truncation error decreases as step size
decreases. However, when step size decreases, this usually results in the necessity for
more precise computations which consequently results in an increase in roundoff error.
Therefore, the errors are in direct conflict with one another: as we decrease one, the
other increases.
However, the optimal step size to minimize error can be determined. Using an iterative
method of trying different step sizes and recording the error between the approximation
and the true value, the following graph shown in Figure 2 will result. The minimum of
the curve corresponds to the minimum error achievable and corresponds to the optimal
step size. Any error to the right of this point (larger step sizes) is primarily due to
truncation error and the increase in error to the left of this point corresponds to where
roundoff error begins to dominate. While this graph is specific to a certain function and
type of approximation, the general rule and shape will still hold for other cases.
14 | P a g e
REFERENCES:
https://knowledge.ni.com/KnowledgeArticleDetails?
id=kA03q000000x30HCAQ&l=en-PH
http://www.engineering.uco.edu/~aaitmoussa/Courses/ENGR3703/Chapter1/c
h1_1.pdf
Chapra, Steven C. Applied Numerical Methods with MATLAB for Engineers
and Scientists. McGraw-Hill, 2017.
Class Notes from ENGRD 3200: Engineering Computation taught by Professor
Peter Diamessis at Cornell University
15 | P a g e