This chapter discusses various types of errors that can occur in numerical analysis calculations, including:
- Round-off errors due to limitations in significant figures and binary representation in computers
- Truncation errors from using approximations instead of exact mathematical representations
- Error propagation when combining results with arithmetic operations
It also covers topics like accuracy vs precision, definitions of relative and absolute errors, floating point representation standards, and techniques to estimate errors like Taylor series expansions and machine epsilon values. The goal is to understand the sources and magnitudes of different errors to improve the reliability of numerical analysis methods.
There are three main sources of errors in numerical computation: rounding, data uncertainty, and truncation. Rounding errors, also called arithmetic errors, are an unavoidable consequence of working in finite precision arithmetic.
Newton's Backward Interpolation explained with example. History of interpolation along with it's advantages and disadvantages. Applications of interpolation in computer sciences.
There are three main sources of errors in numerical computation: rounding, data uncertainty, and truncation. Rounding errors, also called arithmetic errors, are an unavoidable consequence of working in finite precision arithmetic.
Newton's Backward Interpolation explained with example. History of interpolation along with it's advantages and disadvantages. Applications of interpolation in computer sciences.
Here we have included details about relaxation method and some examples .
Contribution - Parinda Rajapakha, Hashan Wanniarachchi, Sameera Horawalawithana, Thilina Gamalath, Samudra Herath and Pavithri Fernando.
This lecture contains Newton Raphson Method working rule, Graphical representation, Example, Pros and cons of this method and a Matlab Code.
Explanation is available here: https://www.youtube.com/watch?v=NmwwcfyvHVg&lc=UgwqFcZZrXScgYBZPcV4AaABAg
This presentation gives the basic idea about the methods of solving ODEs
The methods like variation of parameters, undetermined coefficient method, 1/f(D) method, Particular integral and complimentary functions of an ODE
Here we have included details about relaxation method and some examples .
Contribution - Parinda Rajapakha, Hashan Wanniarachchi, Sameera Horawalawithana, Thilina Gamalath, Samudra Herath and Pavithri Fernando.
This lecture contains Newton Raphson Method working rule, Graphical representation, Example, Pros and cons of this method and a Matlab Code.
Explanation is available here: https://www.youtube.com/watch?v=NmwwcfyvHVg&lc=UgwqFcZZrXScgYBZPcV4AaABAg
This presentation gives the basic idea about the methods of solving ODEs
The methods like variation of parameters, undetermined coefficient method, 1/f(D) method, Particular integral and complimentary functions of an ODE
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxSALU18
error 2.pdf
10/13/16, 6(46 PM01_error
Page 1 of 5http://localhost:8888/nbconvert/html/group/01_error.ipynb?download=false
In [ ]: %matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import sys
Error Definitions
Following is an example for the concept of absolute error, relative error and decimal precision:
We shall test the approximation to common mathematical constant, . Compute the absolute and relative
errors along with the decimal precision if we take the approximate value of .
In [ ]: # We can use the formulas you derieved above to calculate the actual n
umbers
absolute_error = np.abs(np.exp(1) - 2.718)
relative_error = absolute_error/np.exp(1)
print "The absolute error is "+str(absolute_error)
print "The relative error is "+str(relative_error)
Machine epsilon is a very important concept in floating point error. The value, even though miniscule, can
easily compund over a period to cause huge problems.
Below we see a problem demonstating how easily machine error can creep into a simple piece of code:
In [ ]: a = 4.0/3.0
b = a - 1.0
c = 3*b
eps = 1 - c
print 'Value of a is ' +str(a)
print 'Value of b is ' +str(b)
print 'Value of c is ' +str(c)
print 'Value of epsilon is ' +str(eps)
Ideally eps should be 0, but instead we see the machine epsilon and while the value is small it can lead to
issues.
e
e = 2.718
10/13/16, 6(46 PM01_error
Page 2 of 5http://localhost:8888/nbconvert/html/group/01_error.ipynb?download=false
In [ ]: print "The progression of error:"
for i in range(1,20):
print str(abs((10**i)*c - (10**i)))
The largest floating point number
The formula for obtaining the number is shown below, instead of calculating the value we can use the
system library to find this value.
In [ ]: maximum = (2.0-eps)*2.0**1023
print sys.float_info.max
print 'Value of maximum is ' +str(maximum)
The smallest floating point number
The formula for obtaining the number is shown below. Similarly the value can be found using the system
library to find this value.
In [ ]: minimum = eps*2.0**(-1022)
print sys.float_info.min
print sys.float_info.min*sys.float_info.epsilon
print 'Value of minimum is ' +str(minimum)
As we try to compute a number bigger than the aforementioned, largest floating point number we see weird
errors. The computer assigns infinity to these values.
In [ ]: overflow = maximum*10.0
print 'Value of overflow is ' +str(overflow)
As we try to compute a number smaller than the aforementioned smallest floating point number we see that
the computer assigns it the value 0. We actually lose precision in this case.
10/13/16, 6(46 PM01_error
Page 3 of 5http://localhost:8888/nbconvert/html/group/01_error.ipynb?download=false
In [1]: underflow = minimum/2.0
print 'Value of underflow is ' +str(underflow)
Truncation error is a very common form of error you will keep seing in the area of Numerical
Analysis/Computing.
Here we will look at the classic Calculus example of the approximation near 0. We c ...
Contents of the presentation:
- ABOUT ME
- Bisection Method using C#
- False Position Method using C#
- Gauss Seidel Method using MATLAB
- Secant Mod Method using MATLAB
- Report on Numerical Errors
- Optimization using Golden-Section Algorithm with Application on MATLAB
A LEAST ABSOLUTE APPROACH TO MULTIPLE FUZZY REGRESSION USING Tw- NORM BASED O...ijfls
A least absolute approach to multiple fuzzy regression using Tw-norm based arithmetic operations is
discussed by using the generalized Hausdorff metric and it is investigated for the crisp input- fuzzy output
data. A comparative study based on two data sets are presented using the proposed method using shape
preserving operations with other existing method.
Number systems - Efficiency of number system, Decimal, Binary, Octal, Hexadecimalconversion
from one to another- Binary addition, subtraction, multiplication and division,
representation of signed numbers, addition and subtraction using 2’s complement and I’s
complement.
Binary codes - BCD code, Excess 3 code, Gray code, Alphanumeric code, Error detection
codes, Error correcting code.Deepak john,SJCET-Pala
This 10 hours class is intended to give students the basis to empirically solve statistical problems. Talk 1 serves as an introduction to the statistical software R, and presents how to calculate basic measures such as mean, variance, correlation and gini index. Talk 2 shows how the central limit theorem and the law of the large numbers work empirically. Talk 3 presents the point estimate, the confidence interval and the hypothesis test for the most important parameters. Talk 4 introduces to the linear regression model and Talk 5 to the bootstrap world. Talk 5 also presents an easy example of a markov chains.
All the talks are supported by script codes, in R language.
NUMERICA METHODS 1 final touch summary for test 1musadoto
MY FINAL TOUCH SUMMARY FOR TEST 1
ON 6TH MAY 2018
TOPICS AND MATERIALS COVERED
1. Class lecture notes (Basic concepts, errors and roots of function).
2. Lecture’s examples.
3. Past Years Examples.
4. Past Years examination papers.
5. Tutorial Questions.
6. Reference Books + web.
A set of notes prepared for an introductory machine learning course, assuming very limited linear algebra background, because all linear algebra operations are fully written out. These notes go into thorough derivations of the generalized linear regression formulation, demonstrating how to write it out in matrix form.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
2. Significant Figures
The significant figures are the digits that carry meaning to the precision of
the measurement.
Consider three measurements for the length of a table:
L1=3.2 m
L2: 3.27 m
L3: 3.270 m
Number of significant figures for L1 is two, for L2 is three, and for L3 is four.
First digit is the most significant figure, and the last digit is the least
significant digit in the measurement.
We can assign error associated with each measurement:
L1=3.2 +- 0.2 m L2: 3.27 m +- 0.01 m
L3: 3.270 +- 0.003 m
Any digit beyond the error carrying digits is meaningless.
Leading zeros are not significant. They are only used to show the location of
the decimal point. e. g. 0.00052 has only two significant digits . To avoid
confusion, scientists prefer scientific notation (e.g., 5.2x10-4).
3. Accuracy & Precision
Accuracy refers to how closely a
computed or measured value
agrees with the true value.
Inaccuracy (also called bias) is a
systematic deviation from the
truth.
Precision refers to how closely
individual computed or measured
values agree with each other.
Imprecision (also called
uncertainty) refers to the
magnitude of the scatter.
accuracy and precision are
independent from each other.
4. Error Definitions
In numerical methods both accuracy and precision is required for
a particular problem. We will use the collective term error to
represent both inaccuracy and imprecision in our predictions.
Numerical errors arise from the use of approximation to
represent exact mathematic operations or quantities. Consider
the approximation we did in the problem of falling object in air.
We observed some error between the exact (true) and numerical
solutions (approximation).
The relationship between them:
True value = approximation + error
or
Et = true value – approximation
5. Note that in this equation, we included all factors contributing
to the error. So, we used the subscript t to designate that this
is the true error).
To take into account different magnitudes in different
measurements, we prefer to normalize the error. Then, we
define the fractional relative error:
Fractional relative error = (true value-approximation)/(true value)
or the percent relative error:
t = (true value-approximation)/(true value) x 100
Most of the times, we just say “error” to mean percent relative error.
6. So, we define true error as :
(true value approximated value)
t
100 %
(true value)
In most cases we don’t have the knowledge of the “true value”,
so we define approximate error as
(approximate error )
a
100 %
(approximate value)
Approximate error can be defined in different ways depending
on the problem. For example, in iterative methods, error is
defined with respect to the previous calculation.
(current approx. previous approx.)
a
100 %
(current approx.)
7. Round-off Errors
Round-off errors result from the omission of the significant figures.
Base-10 (decimal) versus Base-2 (binary) system:
Base-10
Base-2
103 102 101 100
23 22 21 20
a b c d
a b a b
= ax103 + bx102 + cx101 + dx100
= ax23 + bx22 + ax21 + bx20
Positional
Notation
Computers knows only two numbers (on/off states). So
computers can only store numbers in binary (base-2) system.
e.g. 100101
a bit (binary digit).
1 byte= 8 bits
computer uses 6 bits to store this number.
8. Integer Representation:
First bit is used to store the sign (0 for “+” and 1 for “-”);
remaining bits are used to store the number.
In integer representation, numbers can be defined exactly but
only a limited range of numbers are allowed in a limited
memory. Also fractional quantities can not be represented.
Ex: How -3 is stored in a computer in integer representation?
Ex: Find the range of numbers that you can store in a 16-bit
computer in integer representation. (-32767 to 32767).
9. Floating Point Representation:
FPR allows a much wider range of numbers than integer
representation.
It allows storing fractional quantities.
It is similar to the scientific notation.
Mantissa (significand)
mb e
e.g.
exponent
base
0.015678 1.5678 10 2
(base-10)
Ex: Assume you have a hypotetical base-10 computer with a 5-digit word size
(one digit for sign, two for exponent with sign, two for mantissa). a) Find the
range of values that can be represented. b) Calculate the error of representing 2-5
using this representation.
10. IEEE floating point representation standards:
32-bit (single precision) word format:
64-bit (double precision) word format:
Mantissa takes only a limited number of significant digits
round-off error
Increasing the number of digits (32-bit versus 64-bit) decreases
the roundoff error.
11. Range:
In FPR there is still a limit for the representation numbers but the
range is much bigger.
In 64-bit representiaton in IEEE format:
52 digits
11 digits
Max value= +1.111…1111 x 2 +(1111111111) = 1.7977 x 10+308
Min value= 1.000…0000 x 2 -(1111111111) = 2.2251 x 10 -308
Numbers larger than the max. value cannot be represented by
the computer overflow error.
>> realmax
ans=
1.7976931e+308
Any value bigger than this is set to infinity
Numbers smaller than the min. value cannot be represented.
There is a “hole” at zero. underflow error.
>> realmin
ans=
2.22500738e-308
Any value smalller than this is set to zero
12. Precision:
52 bits used for the mantissa correspond to about 15-16 base-10
significant units.
>> pi
ans=
3.142857
>> formatlong
>> pi
ans=
3.1428571428571
32-bit representation (single precision)
64-bit representation (double precision)
Ex: Find the smallest possible value floating point number for a hypothetical
base-2 machine that stores information using 7-bits words (first bit for the sign
of the number, next three for the sign and magnitude of the exponent , and the
last three for the magnitude of the mantissa). (1x2-3)
13. Chopping versus Rounding:
Assume a computer that can store 7 significant digits:
Rounding
Chopping
error
error
4.2428576428......
4.2428576428......
4.242857
4.242858
Rounding is a better choice since the sign of error can be either
positive and negative leading to smaller total numerical error.
Whereas error in chopping is always positive and adds up.
Rounding costs an extra processing to the computer, so most
computers just chops off the number.
Error associated with rounding/chopping Quantization error
14. Machine epsilon:
As a result of quantization of numbers, there is a finite length of
interval between two numbers in floating point representation.
x
Machine epsilon (or machine precision) is the upper bound on
the relative error due to chopping/rounding in floating point
arithmetic.
x
For a 64-bit
x
representation, b=2, t=53
=2-52
The machine epsilon can be computed as =2.22044.. x 10-16
b
1t
b=number base
t= number of digits in
mantissa
>> eps
ans=
2.2204460e-16
15. Arithmetic operations:
Besides the limitations of the computer for storage of numbers,
arithmetic operations of these numbers also contribute to the
round-off error.
Consider a hypotetical base-10 computer with 4-digit mantissa and 1-digit
exponent:
1.345 + 0.03406 = 0.1345 x 101 + 0.003406 x 101 = 0.137906 x 101
in arithmetic operations numbers are converted as with same exponents
chopped-off
Ex: a) Evaluate the polynomial
y x 3 5 x 2 6 x 0.55
at x=1.73. Use 3-digit arithmetic with chopping. Evaluate the error.
b) If the function is expressed as
y x( x 5) 6x 0.55
What is the percent relative error? Compare with part a.
16. Subtractive cancellation:
Subtructive cancellation occurs when subtracting two nearly
equal number.
0.7549 x 103 - 0.7548 x 103 = 0.0001 x 103
4 S.D.
4 S.D.
Also called
loss of significance
1 S.D.
Many problems in numerical analysis are prone to subtractive
cencallation error. They can be mitigated by manipulations in the
formulation of the problem or by increasing the precision.
Consider finding the roots of a
2nd order polynomial:
b b 2 4ac
x2
2a
x1
b 4ac
2
Subtractive
cancellation
- Can use double precision, or
- Can use an alternative
formulation:
x1
x2
2c
b b 2 4ac
17. Truncation Errors
Truncation errors result from using an approximations in place of
exact mathematical representations. Remember the
approximation in the falling object in air problem:
dv v v(ti 1 ) v(ti )
dt t
ti 1 ti
Taylor theorem:
Taylor’s theorem give us insight for estimating the truncation
error in the numerical approximation.
Taylor’s theorem states that if the function f and its n+1 drivatives
are continous on an interval containing a and x, then the values of
the function at x is given by
f ( 2) (a)
f ( n ) (a)
2
f ( x) f (a) f (a)( x a)
( x a) ...
( x a) n Rn
2!
n!
'
18. exact solution
In other words, any smooth
function can be
approximated as a
polynomial of order n within
a given interval.
The error gets smaller as n
increases.
base point(a)=1
Ex: Use second order Taylor series expansion to approximate the
function
f ( x) 0.1x 4 0.15 x 3 0.5 x 2 0.25 x 1.2
at x=1 from a=0. Calculate the truncation error from this
approximation.
19. Suppose you have f(xi ) and want to evaulate f(xi+1):
f 2 ( xi ) 2
f n ( xi ) n
f ( xi 1 ) f ( xi ) f ' ( xi )h
h ...
h Rn
2!
n!
h ( xi 1 xi )
Step size
where
f n 1 ( ) n 1
Rn
h
( n 1)!
xi , xi 1
Here Rn represents the remainder (or the error) from the n-th
order approximation of the function. It provides and exact
determination of the error.
We can estimate the order of the magnitude of the error in
terms of step size (h):
Rn O (h n 1 )
we can change ‘h’ to control the magnitude of the error in the calculation!
20. Falling object in air problem:
We can evalate the truncation error for the “falling object in
air” problem. Express v(ti+1 ) in Taylor series:
v '' (ti ) 2
v n (ti ) n
v(ti 1 ) v(ti ) v (ti )h
h ...
h Rn
2!
n!
'
h (ti 1 ti )
Taylor series to n=1:
v(ti 1 ) v(ti ) v ' (ti )h R1
R1 O(h 2 )
or
v ' (ti )
v(ti 1 ) v(ti ) R1
h
h
Finite difference appr.
Truncation error
R1 O(h 2 )
O ( h)
h
h
Error
Then the error associated with
finite difference approximation
is in the order of h.
21. Error Propogation
Error propagation concerns how an error in x is propagated to the
function f(x).
x=true v.
xo= approx. v.
x x x
f ( x ) f ( x) f ( x )
Propagation
of error
Taylor expansion can be used to estimate the error propagation.
Lets evaluate f(x) near f(xo):
f ( x) f ( x ) f ' ( x)x ...
f ( x) f ( x) f ( x ) f ' ( x)x
dropping 2nd and
higher order terms
f ( x ) f ' ( xo ) x
Ex 2.3: Given a measured value of x0= 2.50.01, estimate the
resulting error in the function f(x)=x3.
22. Functions of more than one variable:
x x x
y y y
x z z
f ( x , y o , z o ,..)
Propagation of
error
...
error in
error out
Error propagation for functions of more than one variable can be
understood as the generalization of the case of functions with a
single variable:
f
f
f
f ( x , y , z ,..)
x
y
z ...
x
y
z
o
o
Ex 2.3: Open channel flow formula for a rectangular channel is given by :
1 (bh) 5 / 3
Q
n (b 2h) 2 / 3
s
(Q=flow rate , n=roughness coff.,)
(b=width, h=depth, s=slope)
Assume that b=20 m and h=0.3 m for the channel. If you know that
n=0.030±0.002 and s=0.05±0.01, what is the resulting error in calculation of Q?
23. Condition and stability:
Condition of a mathematical computation is the sensitivity to the
input values. It is a measure of how much an uncertainity is
magnified by the computation.
Condition
Number
=
Error in the output
Error in the input
f ( x) f ( x o )
f ' ( x o )( x x o )
Condition
xo f ' ( xo )
f ( xo )
f ( xo )
o
o
Number
(x x )
(x x )
f ( xo )
xo
xo
If the uncertainty in the input results in gross changes in the
output, we say that the problem is unstable or ill-conditioned.
C.N.1
C.N.>>1 (ill-conditioned)
24. Total numerical error:
Total
Numerical
Error
= Round-off
Error
+ Truncation
Error
Round-off errors can be minimized by increasing the number of
significant digits. Subtractive cancellations and number of
computations increases the roundoff-error.
Truncation errors can be reduced by decreasing the step size (h).
But this may result in subtractive cancellation error too.
So, there is a trade-off between
truncation error and round-off error in
terms of step size (h).
Note that there is no systematic and
general approach to evaluating
numerical errors for all problems.
25. Formulation Errors & Data Uncertainity
These errors are totally independant from numerical errors, and
are not directly connected to most numerical methods.
Blunders:
In other words: stupid mistakes. They can only be mitigated by
experience, or by consulting to experienced persons.
Formulation (model) errors:
Formulation (or model) errors are causes by incomplete
formulation of the mathematical model. (e.g., in “the falling object
in air problem”, not taking the effect of air fricton into account).
Data uncertainity:
If your data contain large inaccuracies or imprecisions (may be
due to problems with measurement device), this will directly
affect the quality of the results.
Statistical analyses on the data helps to minimize these errors.