SlideShare a Scribd company logo
1 of 10
Download to read offline
www.openeering.com
powered by
NUMERICAL ANALYSIS USING SCILAB:
ERROR ANALYSIS AND PROPAGATION
This tutorial provides a collection of numerical examples and advises on error
analysis and its propagation. All examples are developed in Scilab.
Level
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Error analysis and propagation www.openeering.com page 2/10
Step 1: The purpose of this tutorial
The purpose of this Scilab tutorial is to provide a collection of numerical
examples that are typically part of numerical analysis courses.
This tutorial is intended to help readers familiarize with numerical methods
and their implementations, keeping under control the error propagation.
Here we provide some classical examples on error analysis and
propagation.
An introduction to
NUMERICAL ANALYSIS USING SCILAB
(Error study in Numerical Analysis)
Step 2: Roadmap
In this tutorial, after a brief introduction to the concept of numerical errors,
we analyze some examples in which numerical errors occur. These
examples are useful to understand how important is to pay attention to
error propagation when implementing numerical methods.
Descriptions Steps
Numerical errors 3-5
Examples 6-10
Conclusions and remarks 11-12
Error analysis and propagation www.openeering.com page 3/10
Step 3: Numerical error
What is allocated in a computer is only a subset of real number (using
IEEE 754 standard) and hence, a real number is represented in the
computer as , a fixed strings of digits. This limited amount of storage
introduces a rounding error (or round-off error). It is possible to prove the
following relation
with
| |
where is a constant that depends on the floating point system used to
represent the number (for double precision arithmetic is equal to
).
// Scilab command to obtain eps
// ----------------------------
%eps
Step 4: Truncation error
The next step is to study what happens when the basic arithmetic
operations are used.
We denote the computer arithmetic as , , , to distinguish them
from real arithmetic , , and respectively.
A part from the numerical error due to limited length in bits of registers, the
computer arithmetic introduces a further truncation error when results are
transfer from CPU to the memory. This error is caused by the fact that the
length in bits of the CPU register is greater than the one used to store
numbers.
As an example, if we sum two numbers and (to compute )
the corresponding machine operation can be written as
( )
with | | . The sum of two numbers involves the sum of the
two floating point operands. Since this operation is done in a register
of the computer, it is necessary to consider a further floating point
representation when the number is transferred to be stored into the
memory.
Error analysis and propagation www.openeering.com page 4/10
Step 5: Cancellation error
It is interesting to analyze the arithmetic operations when we consider
relative errors. For example, we want to analyze the sum operation:
| |
| |
in terms of the relative error of the input operands and . The relative
error for is defined as
| |
| |
A computer operation is considered numerically stable when
where and and are two input operands.
It is possible to prove that the computer operations and are the only
stable operations with respect to the rounding error. Conversely, for
addition we have:
(
| |
| |
| |
| |
)
A similar inequality holds for subtraction.
When , the right hand side of the inequality may be very high and
hence may generate a high relative error (cancellation error).
Cancellation error should be avoided whenever possible!
Example of cancellation error for subtraction operation
In this example we consider a decimal arithmetic with floating point where a
number is expressed in the following way:
with . is the exponent (or characteristic) of the representation while
is the mantissa of the representation. The mantissa has always a
fixed number of digits, in this case m.
For example, we can compute using a system with a mantissa of
4 digits for the number, while we use a mantissa of 8 digits for the internal
representations in the CPU register.
The example is done using .
From memory to registers:
Memory (mantissa = 4) Register (mantissa = 8)


Arithmetic operation with alignment of the exponent:
Register (mantissa = 8) Register with aligned exp.


+

From register to memory:
Register (mantissa = 8) Memory (mantissa = 4)

It is easy to compute the final step in which we subtract again 1 to evaluate
. As a result we obtain that is not equal to x.
Error analysis and propagation www.openeering.com page 5/10
Step 6: Two equivalent expressions
In this example we compare the following two equivalent expressions:
These two expressions are equivalent from an algebraic point of view; the
second expression is simply obtained from the first one through
simplification.
The first function suffers of the cancellation error when goes to zero.
This phenomenon has been explained in the previous step.
In the reported figure we have plotted the error . We
may see that the cancellation error is huge when is close to zero. This
phenomenon produces a loss of significant digits.
The Scilab script for the figure on the right is available in ex01.sce. The
code can be downloaded from the Openeering website.
(Error err in the range [-1e-07;1e-07])
Error analysis and propagation www.openeering.com page 6/10
Step 7: Two equivalent polynomials
In this example, we compare the two following polynomial expressions:
where the first expression is obtained from the second by expansion.
As depicted on the right, the second expression is numerically stable while
the first one is more unstable.
The Scilab script is reported in the function ex02.sce.
(Comparison between two algebraic equivalent polynomials)
Error analysis and propagation www.openeering.com page 7/10
Step 8: Derivative example
In this step, we study the computation of a derivative from a numerical
point of view. To approximate the first derivate, we use here the difference
quotient (a.k.a. Newton’s quotient):
For example, we may analyze the formula for the function at
point varying h in the following way:
The plot on the right visualizes the results.
From a mathematical point of view, when goes to zero, the formula
should assume the value of the first derivative. Intuitively, we may expect
the smaller the , the better the approximation. Unfortunately, because of
cancellation errors, it happens that the most reliable value for the derivate
is reached in (for , the value of the derivate is the same
as ).
The Scilab script for plot and table is reported in the function ex03.sce.
(Value of the derivative changing the value of h)
(Derivative example – table of results)
Error analysis and propagation www.openeering.com page 8/10
Step 9: Error analysis and optimal step
The Newton’s quotient to approximate the derivative contains two
sources of error:
 Round-off error;
 Truncation error.
This follows from the Taylor series expansion of :
where and hence:
The first term contributes to round-off error, while the second term gives
rise to a truncation error.
As reported on the right the total error can be expressed as
̅
From the above formula it is possible to compute the optimal step size .
Taking the derivative of the total error with respect to and setting this
quantity equal to zero, we have:
√
̅
This represents the optimal value for to minimize the total error.
Evaluation of the round-off error:
The round-off error for the Newton’s quotient can be written as:
|
( ) ( )
|
| |
where | | (remember that where | | ).
Moreover we ignore error from division by .
In order to evaluate this error, with small, we replace by
We do not know the signs of and , so we replace the difference
with ̅. This leads to:
̅
| |
̅
where | |.
Evaluation of the truncation error:
The truncation error is given by:
| |
where for small values of we replace by and | |.
Error analysis and propagation www.openeering.com page 9/10
Step 10: Exercise
It is possible to compute the second derivatives of a function using the
following approximation
Apply the above formula to compute the second derivative of the function
at a given point .
Moreover, prove the following estimate for the total error:
|
( ) ( ) ( )
|
̅
where | | and | |.
The upper bound error is minimized when has the value
√
̅
Hints: Using Taylor expansion for the function and to
the fourth order paying attention to the signs.
(Relative error for second derivative approximation)
(Second derivative approximation, table of results)
Error analysis and propagation www.openeering.com page 10/10
Step 11: Concluding remarks and References
In this tutorial we have collected a series of numerical examples written in
Scilab for the study of numerical errors.
1. Scilab Web Page: Available: www.scilab.org.
2. Openeering: www.openeering.com.
3. J. Higham, accuracy and Stability of Numerical Algorithms, SIAM
4. Atkinson, An Introduction to Numerical Analysis, Wiley
Step 12: Software content
To report a bug or suggest improvements please contact Openeering
team at the web site www.openeering.com.
Thank you for your attention,
Silvia Poles and Manolo Venturin
--------------
Main directory
--------------
ex01.sce : Expression example
ex02.sce : Polynomial example
ex03.sce : Derivative example
ex04.sce : Second derivative exercise
license.txt : The license file

More Related Content

What's hot

5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals 5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals MdFazleRabbi18
 
Advanced road transporlation system report
Advanced road transporlation system reportAdvanced road transporlation system report
Advanced road transporlation system reportAbdul Aziz
 
Deniz ortamında optik haberleşme grup 3
Deniz ortamında optik haberleşme grup 3Deniz ortamında optik haberleşme grup 3
Deniz ortamında optik haberleşme grup 3Müdessir Sel
 
Intelligent transport system (its) [autosaved]
Intelligent transport system (its) [autosaved]Intelligent transport system (its) [autosaved]
Intelligent transport system (its) [autosaved]Krishna Bhola
 
Antenna Azimuth Position Control System using PIDController & State-Feedback ...
Antenna Azimuth Position Control System using PIDController & State-Feedback ...Antenna Azimuth Position Control System using PIDController & State-Feedback ...
Antenna Azimuth Position Control System using PIDController & State-Feedback ...IJECEIAES
 
Traffic stream models
Traffic stream models Traffic stream models
Traffic stream models Faris Thyab
 
Ofdm & qam
Ofdm & qamOfdm & qam
Ofdm & qamnickymeher
 
GPS modulation/demodulation and noise
GPS modulation/demodulation and noise GPS modulation/demodulation and noise
GPS modulation/demodulation and noise syuhaimi
 
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...Brati Sundar Nanda
 
Traffic signal
Traffic signalTraffic signal
Traffic signalaloknitb
 
#2 gnss errors,its sources & mitigation techniques
#2 gnss errors,its sources & mitigation techniques#2 gnss errors,its sources & mitigation techniques
#2 gnss errors,its sources & mitigation techniquesMohammedHusain20
 
Class 8 mathematical modeling of interacting and non-interacting level systems
Class 8   mathematical modeling of interacting and non-interacting level systemsClass 8   mathematical modeling of interacting and non-interacting level systems
Class 8 mathematical modeling of interacting and non-interacting level systemsManipal Institute of Technology
 
Modul 2 gsm air interface
Modul 2   gsm air interfaceModul 2   gsm air interface
Modul 2 gsm air interfaceWijaya Kusuma
 

What's hot (20)

5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals 5. convolution and correlation of discrete time signals
5. convolution and correlation of discrete time signals
 
Advanced road transporlation system report
Advanced road transporlation system reportAdvanced road transporlation system report
Advanced road transporlation system report
 
Deniz ortamında optik haberleşme grup 3
Deniz ortamında optik haberleşme grup 3Deniz ortamında optik haberleşme grup 3
Deniz ortamında optik haberleşme grup 3
 
GPS
GPSGPS
GPS
 
GNSS data collection
GNSS data collectionGNSS data collection
GNSS data collection
 
Module3 part1
Module3 part1Module3 part1
Module3 part1
 
Intelligent transport system (its) [autosaved]
Intelligent transport system (its) [autosaved]Intelligent transport system (its) [autosaved]
Intelligent transport system (its) [autosaved]
 
Antenna Azimuth Position Control System using PIDController & State-Feedback ...
Antenna Azimuth Position Control System using PIDController & State-Feedback ...Antenna Azimuth Position Control System using PIDController & State-Feedback ...
Antenna Azimuth Position Control System using PIDController & State-Feedback ...
 
Traffic stream models
Traffic stream models Traffic stream models
Traffic stream models
 
Fading & Doppler Effect
Fading & Doppler EffectFading & Doppler Effect
Fading & Doppler Effect
 
Ofdm & qam
Ofdm & qamOfdm & qam
Ofdm & qam
 
Introduction to equalization
Introduction to equalizationIntroduction to equalization
Introduction to equalization
 
GPS modulation/demodulation and noise
GPS modulation/demodulation and noise GPS modulation/demodulation and noise
GPS modulation/demodulation and noise
 
Its architecture
Its architectureIts architecture
Its architecture
 
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
 
Traffic signal
Traffic signalTraffic signal
Traffic signal
 
#2 gnss errors,its sources & mitigation techniques
#2 gnss errors,its sources & mitigation techniques#2 gnss errors,its sources & mitigation techniques
#2 gnss errors,its sources & mitigation techniques
 
Class 8 mathematical modeling of interacting and non-interacting level systems
Class 8   mathematical modeling of interacting and non-interacting level systemsClass 8   mathematical modeling of interacting and non-interacting level systems
Class 8 mathematical modeling of interacting and non-interacting level systems
 
GPS-errors-2
GPS-errors-2GPS-errors-2
GPS-errors-2
 
Modul 2 gsm air interface
Modul 2   gsm air interfaceModul 2   gsm air interface
Modul 2 gsm air interface
 

Viewers also liked

Numerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsNumerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsScilab
 
Numerical analysis using Scilab: Numerical stability and conditioning
Numerical analysis using Scilab: Numerical stability and conditioningNumerical analysis using Scilab: Numerical stability and conditioning
Numerical analysis using Scilab: Numerical stability and conditioningScilab
 
Introduction to error analysis
Introduction to error analysis Introduction to error analysis
Introduction to error analysis Muhmmad Asif
 
First steps with Scilab
First steps with ScilabFirst steps with Scilab
First steps with ScilabScilab
 
Aeraulic toolbox for Xcos
Aeraulic toolbox for XcosAeraulic toolbox for Xcos
Aeraulic toolbox for XcosScilab
 
Data mining
Data miningData mining
Data miningScilab
 
Modeling an ODE: 3 different approaches - Part 1
Modeling an ODE: 3 different approaches - Part 1Modeling an ODE: 3 different approaches - Part 1
Modeling an ODE: 3 different approaches - Part 1Scilab
 
Modeling an ODE: 3 different approaches - Part 2
Modeling an ODE: 3 different approaches - Part 2Modeling an ODE: 3 different approaches - Part 2
Modeling an ODE: 3 different approaches - Part 2Scilab
 
Approximation and error
Approximation and errorApproximation and error
Approximation and errorrubenarismendi
 
Introduction to Control systems in scilab
Introduction to Control systems in scilabIntroduction to Control systems in scilab
Introduction to Control systems in scilabScilab
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical MethodsESUG
 
Customizing Xcos with new Blocks and Palette
Customizing Xcos with new Blocks and PaletteCustomizing Xcos with new Blocks and Palette
Customizing Xcos with new Blocks and PaletteScilab
 
Types of errors
Types of errorsTypes of errors
Types of errorsRima fathi
 
Introduction to Numerical Analysis
Introduction to Numerical AnalysisIntroduction to Numerical Analysis
Introduction to Numerical AnalysisMohammad Tawfik
 
Error analysis presentation
Error analysis presentationError analysis presentation
Error analysis presentationGeraldine Lopez
 
Errors in Computing- Runtime, Semantics, Syntax and Fixed and Floating point
Errors in Computing- Runtime, Semantics, Syntax and Fixed and Floating pointErrors in Computing- Runtime, Semantics, Syntax and Fixed and Floating point
Errors in Computing- Runtime, Semantics, Syntax and Fixed and Floating pointRyon Whyte
 
Scilab as a calculator
Scilab as a calculatorScilab as a calculator
Scilab as a calculatorScilab
 
Example of error analysis and worked examples
Example of error analysis and worked examplesExample of error analysis and worked examples
Example of error analysis and worked examplesLisa Thompson Sousa
 

Viewers also liked (20)

Numerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsNumerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equations
 
Numerical analysis using Scilab: Numerical stability and conditioning
Numerical analysis using Scilab: Numerical stability and conditioningNumerical analysis using Scilab: Numerical stability and conditioning
Numerical analysis using Scilab: Numerical stability and conditioning
 
Introduction to error analysis
Introduction to error analysis Introduction to error analysis
Introduction to error analysis
 
First steps with Scilab
First steps with ScilabFirst steps with Scilab
First steps with Scilab
 
Aeraulic toolbox for Xcos
Aeraulic toolbox for XcosAeraulic toolbox for Xcos
Aeraulic toolbox for Xcos
 
Data mining
Data miningData mining
Data mining
 
Modeling an ODE: 3 different approaches - Part 1
Modeling an ODE: 3 different approaches - Part 1Modeling an ODE: 3 different approaches - Part 1
Modeling an ODE: 3 different approaches - Part 1
 
Modeling an ODE: 3 different approaches - Part 2
Modeling an ODE: 3 different approaches - Part 2Modeling an ODE: 3 different approaches - Part 2
Modeling an ODE: 3 different approaches - Part 2
 
Approximation and error
Approximation and errorApproximation and error
Approximation and error
 
Introduction to Control systems in scilab
Introduction to Control systems in scilabIntroduction to Control systems in scilab
Introduction to Control systems in scilab
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
Customizing Xcos with new Blocks and Palette
Customizing Xcos with new Blocks and PaletteCustomizing Xcos with new Blocks and Palette
Customizing Xcos with new Blocks and Palette
 
Error analysis
Error analysisError analysis
Error analysis
 
Types of errors
Types of errorsTypes of errors
Types of errors
 
Introduction to Numerical Analysis
Introduction to Numerical AnalysisIntroduction to Numerical Analysis
Introduction to Numerical Analysis
 
Error analysis presentation
Error analysis presentationError analysis presentation
Error analysis presentation
 
Error analysis
Error  analysisError  analysis
Error analysis
 
Errors in Computing- Runtime, Semantics, Syntax and Fixed and Floating point
Errors in Computing- Runtime, Semantics, Syntax and Fixed and Floating pointErrors in Computing- Runtime, Semantics, Syntax and Fixed and Floating point
Errors in Computing- Runtime, Semantics, Syntax and Fixed and Floating point
 
Scilab as a calculator
Scilab as a calculatorScilab as a calculator
Scilab as a calculator
 
Example of error analysis and worked examples
Example of error analysis and worked examplesExample of error analysis and worked examples
Example of error analysis and worked examples
 

Similar to Numerical analysis using Scilab: Error analysis and propagation

(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...Naoki Shibata
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniyaTutorialsDuniya.com
 
House Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN ApproachHouse Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN ApproachYusuf Uzun
 
A study of the Behavior of Floating-Point Errors
A study of the Behavior of Floating-Point ErrorsA study of the Behavior of Floating-Point Errors
A study of the Behavior of Floating-Point Errorsijpla
 
Curve fitting
Curve fittingCurve fitting
Curve fittingdusan4rs
 
GENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATION
GENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATIONGENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATION
GENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATIONijaia
 
PVS-Studio team is about to produce a technical breakthrough, but for now let...
PVS-Studio team is about to produce a technical breakthrough, but for now let...PVS-Studio team is about to produce a technical breakthrough, but for now let...
PVS-Studio team is about to produce a technical breakthrough, but for now let...PVS-Studio
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013amanabr
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Kurmendra Singh
 

Similar to Numerical analysis using Scilab: Error analysis and propagation (20)

(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
(Slides) Efficient Evaluation Methods of Elementary Functions Suitable for SI...
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Algoritmos
AlgoritmosAlgoritmos
Algoritmos
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Adsa u1 ver 1.0
Adsa u1 ver 1.0Adsa u1 ver 1.0
Adsa u1 ver 1.0
 
Data Transformation
Data TransformationData Transformation
Data Transformation
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniya
 
Python_Module_2.pdf
Python_Module_2.pdfPython_Module_2.pdf
Python_Module_2.pdf
 
House Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN ApproachHouse Price Estimation as a Function Fitting Problem with using ANN Approach
House Price Estimation as a Function Fitting Problem with using ANN Approach
 
Lecture 05.pptx
Lecture 05.pptxLecture 05.pptx
Lecture 05.pptx
 
A study of the Behavior of Floating-Point Errors
A study of the Behavior of Floating-Point ErrorsA study of the Behavior of Floating-Point Errors
A study of the Behavior of Floating-Point Errors
 
Curve fitting
Curve fittingCurve fitting
Curve fitting
 
GENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATION
GENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATIONGENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATION
GENETIC ALGORITHM FOR FUNCTION APPROXIMATION: AN EXPERIMENTAL INVESTIGATION
 
Chapitre 08
Chapitre 08Chapitre 08
Chapitre 08
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
PVS-Studio team is about to produce a technical breakthrough, but for now let...
PVS-Studio team is about to produce a technical breakthrough, but for now let...PVS-Studio team is about to produce a technical breakthrough, but for now let...
PVS-Studio team is about to produce a technical breakthrough, but for now let...
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 

More from Scilab

Statistical Analysis for Robust Design
Statistical Analysis for Robust DesignStatistical Analysis for Robust Design
Statistical Analysis for Robust DesignScilab
 
Electric motor optimization
Electric motor optimizationElectric motor optimization
Electric motor optimizationScilab
 
Asteroidlanding - Scilab conference 2019 Keynote
Asteroidlanding - Scilab conference 2019 KeynoteAsteroidlanding - Scilab conference 2019 Keynote
Asteroidlanding - Scilab conference 2019 KeynoteScilab
 
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...Scilab
 
Scilab and Xcos for Very Low Earth Orbits satellites modelling
Scilab and Xcos for Very Low Earth Orbits satellites modellingScilab and Xcos for Very Low Earth Orbits satellites modelling
Scilab and Xcos for Very Low Earth Orbits satellites modellingScilab
 
X2C -a tool for model-based control development and automated code generation...
X2C -a tool for model-based control development and automated code generation...X2C -a tool for model-based control development and automated code generation...
X2C -a tool for model-based control development and automated code generation...Scilab
 
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...Scilab
 
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCosAircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCosScilab
 
Scilab for real dummies j.heikell - part3
Scilab for real dummies j.heikell - part3Scilab for real dummies j.heikell - part3
Scilab for real dummies j.heikell - part3Scilab
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab
 
Multiobjective optimization and Genetic algorithms in Scilab
Multiobjective optimization and Genetic algorithms in ScilabMultiobjective optimization and Genetic algorithms in Scilab
Multiobjective optimization and Genetic algorithms in ScilabScilab
 
Scilab optimization workshop
Scilab optimization workshop Scilab optimization workshop
Scilab optimization workshop Scilab
 
INRA @ Scilab Conference 2018
INRA @ Scilab Conference 2018INRA @ Scilab Conference 2018
INRA @ Scilab Conference 2018Scilab
 
Qualcomm @ Scilab Conference 2018
Qualcomm @ Scilab Conference 2018Qualcomm @ Scilab Conference 2018
Qualcomm @ Scilab Conference 2018Scilab
 
Sanofi @ Scilab Conference 2018
Sanofi @ Scilab Conference 2018Sanofi @ Scilab Conference 2018
Sanofi @ Scilab Conference 2018Scilab
 
University of Applied Science Esslingen @ Scilab Conference 2018
University of Applied Science Esslingen @ Scilab Conference 2018University of Applied Science Esslingen @ Scilab Conference 2018
University of Applied Science Esslingen @ Scilab Conference 2018Scilab
 
DLR @ Scilab Conference 2018
DLR @ Scilab Conference 2018DLR @ Scilab Conference 2018
DLR @ Scilab Conference 2018Scilab
 
Fraunhofer IIS @ Scilab Conference 2018
Fraunhofer IIS @ Scilab Conference 2018Fraunhofer IIS @ Scilab Conference 2018
Fraunhofer IIS @ Scilab Conference 2018Scilab
 
Arcelormittal @ Scilab Conference 2018
Arcelormittal @ Scilab Conference 2018Arcelormittal @ Scilab Conference 2018
Arcelormittal @ Scilab Conference 2018Scilab
 

More from Scilab (20)

Statistical Analysis for Robust Design
Statistical Analysis for Robust DesignStatistical Analysis for Robust Design
Statistical Analysis for Robust Design
 
Electric motor optimization
Electric motor optimizationElectric motor optimization
Electric motor optimization
 
Asteroidlanding - Scilab conference 2019 Keynote
Asteroidlanding - Scilab conference 2019 KeynoteAsteroidlanding - Scilab conference 2019 Keynote
Asteroidlanding - Scilab conference 2019 Keynote
 
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
Faster Time to Market using Scilab/XCOS/X2C for motor control algorithm devel...
 
Scilab and Xcos for Very Low Earth Orbits satellites modelling
Scilab and Xcos for Very Low Earth Orbits satellites modellingScilab and Xcos for Very Low Earth Orbits satellites modelling
Scilab and Xcos for Very Low Earth Orbits satellites modelling
 
X2C -a tool for model-based control development and automated code generation...
X2C -a tool for model-based control development and automated code generation...X2C -a tool for model-based control development and automated code generation...
X2C -a tool for model-based control development and automated code generation...
 
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
A Real-Time Interface for Xcos – an illustrative demonstration using a batter...
 
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCosAircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
Aircraft Simulation Model and Flight Control Laws Design Using Scilab and XCos
 
Scilab for real dummies j.heikell - part3
Scilab for real dummies j.heikell - part3Scilab for real dummies j.heikell - part3
Scilab for real dummies j.heikell - part3
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
 
Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1Scilab for real dummies j.heikell - part 1
Scilab for real dummies j.heikell - part 1
 
Multiobjective optimization and Genetic algorithms in Scilab
Multiobjective optimization and Genetic algorithms in ScilabMultiobjective optimization and Genetic algorithms in Scilab
Multiobjective optimization and Genetic algorithms in Scilab
 
Scilab optimization workshop
Scilab optimization workshop Scilab optimization workshop
Scilab optimization workshop
 
INRA @ Scilab Conference 2018
INRA @ Scilab Conference 2018INRA @ Scilab Conference 2018
INRA @ Scilab Conference 2018
 
Qualcomm @ Scilab Conference 2018
Qualcomm @ Scilab Conference 2018Qualcomm @ Scilab Conference 2018
Qualcomm @ Scilab Conference 2018
 
Sanofi @ Scilab Conference 2018
Sanofi @ Scilab Conference 2018Sanofi @ Scilab Conference 2018
Sanofi @ Scilab Conference 2018
 
University of Applied Science Esslingen @ Scilab Conference 2018
University of Applied Science Esslingen @ Scilab Conference 2018University of Applied Science Esslingen @ Scilab Conference 2018
University of Applied Science Esslingen @ Scilab Conference 2018
 
DLR @ Scilab Conference 2018
DLR @ Scilab Conference 2018DLR @ Scilab Conference 2018
DLR @ Scilab Conference 2018
 
Fraunhofer IIS @ Scilab Conference 2018
Fraunhofer IIS @ Scilab Conference 2018Fraunhofer IIS @ Scilab Conference 2018
Fraunhofer IIS @ Scilab Conference 2018
 
Arcelormittal @ Scilab Conference 2018
Arcelormittal @ Scilab Conference 2018Arcelormittal @ Scilab Conference 2018
Arcelormittal @ Scilab Conference 2018
 

Recently uploaded

UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 

Recently uploaded (20)

UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 

Numerical analysis using Scilab: Error analysis and propagation

  • 1. www.openeering.com powered by NUMERICAL ANALYSIS USING SCILAB: ERROR ANALYSIS AND PROPAGATION This tutorial provides a collection of numerical examples and advises on error analysis and its propagation. All examples are developed in Scilab. Level This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
  • 2. Error analysis and propagation www.openeering.com page 2/10 Step 1: The purpose of this tutorial The purpose of this Scilab tutorial is to provide a collection of numerical examples that are typically part of numerical analysis courses. This tutorial is intended to help readers familiarize with numerical methods and their implementations, keeping under control the error propagation. Here we provide some classical examples on error analysis and propagation. An introduction to NUMERICAL ANALYSIS USING SCILAB (Error study in Numerical Analysis) Step 2: Roadmap In this tutorial, after a brief introduction to the concept of numerical errors, we analyze some examples in which numerical errors occur. These examples are useful to understand how important is to pay attention to error propagation when implementing numerical methods. Descriptions Steps Numerical errors 3-5 Examples 6-10 Conclusions and remarks 11-12
  • 3. Error analysis and propagation www.openeering.com page 3/10 Step 3: Numerical error What is allocated in a computer is only a subset of real number (using IEEE 754 standard) and hence, a real number is represented in the computer as , a fixed strings of digits. This limited amount of storage introduces a rounding error (or round-off error). It is possible to prove the following relation with | | where is a constant that depends on the floating point system used to represent the number (for double precision arithmetic is equal to ). // Scilab command to obtain eps // ---------------------------- %eps Step 4: Truncation error The next step is to study what happens when the basic arithmetic operations are used. We denote the computer arithmetic as , , , to distinguish them from real arithmetic , , and respectively. A part from the numerical error due to limited length in bits of registers, the computer arithmetic introduces a further truncation error when results are transfer from CPU to the memory. This error is caused by the fact that the length in bits of the CPU register is greater than the one used to store numbers. As an example, if we sum two numbers and (to compute ) the corresponding machine operation can be written as ( ) with | | . The sum of two numbers involves the sum of the two floating point operands. Since this operation is done in a register of the computer, it is necessary to consider a further floating point representation when the number is transferred to be stored into the memory.
  • 4. Error analysis and propagation www.openeering.com page 4/10 Step 5: Cancellation error It is interesting to analyze the arithmetic operations when we consider relative errors. For example, we want to analyze the sum operation: | | | | in terms of the relative error of the input operands and . The relative error for is defined as | | | | A computer operation is considered numerically stable when where and and are two input operands. It is possible to prove that the computer operations and are the only stable operations with respect to the rounding error. Conversely, for addition we have: ( | | | | | | | | ) A similar inequality holds for subtraction. When , the right hand side of the inequality may be very high and hence may generate a high relative error (cancellation error). Cancellation error should be avoided whenever possible! Example of cancellation error for subtraction operation In this example we consider a decimal arithmetic with floating point where a number is expressed in the following way: with . is the exponent (or characteristic) of the representation while is the mantissa of the representation. The mantissa has always a fixed number of digits, in this case m. For example, we can compute using a system with a mantissa of 4 digits for the number, while we use a mantissa of 8 digits for the internal representations in the CPU register. The example is done using . From memory to registers: Memory (mantissa = 4) Register (mantissa = 8)   Arithmetic operation with alignment of the exponent: Register (mantissa = 8) Register with aligned exp.   +  From register to memory: Register (mantissa = 8) Memory (mantissa = 4)  It is easy to compute the final step in which we subtract again 1 to evaluate . As a result we obtain that is not equal to x.
  • 5. Error analysis and propagation www.openeering.com page 5/10 Step 6: Two equivalent expressions In this example we compare the following two equivalent expressions: These two expressions are equivalent from an algebraic point of view; the second expression is simply obtained from the first one through simplification. The first function suffers of the cancellation error when goes to zero. This phenomenon has been explained in the previous step. In the reported figure we have plotted the error . We may see that the cancellation error is huge when is close to zero. This phenomenon produces a loss of significant digits. The Scilab script for the figure on the right is available in ex01.sce. The code can be downloaded from the Openeering website. (Error err in the range [-1e-07;1e-07])
  • 6. Error analysis and propagation www.openeering.com page 6/10 Step 7: Two equivalent polynomials In this example, we compare the two following polynomial expressions: where the first expression is obtained from the second by expansion. As depicted on the right, the second expression is numerically stable while the first one is more unstable. The Scilab script is reported in the function ex02.sce. (Comparison between two algebraic equivalent polynomials)
  • 7. Error analysis and propagation www.openeering.com page 7/10 Step 8: Derivative example In this step, we study the computation of a derivative from a numerical point of view. To approximate the first derivate, we use here the difference quotient (a.k.a. Newton’s quotient): For example, we may analyze the formula for the function at point varying h in the following way: The plot on the right visualizes the results. From a mathematical point of view, when goes to zero, the formula should assume the value of the first derivative. Intuitively, we may expect the smaller the , the better the approximation. Unfortunately, because of cancellation errors, it happens that the most reliable value for the derivate is reached in (for , the value of the derivate is the same as ). The Scilab script for plot and table is reported in the function ex03.sce. (Value of the derivative changing the value of h) (Derivative example – table of results)
  • 8. Error analysis and propagation www.openeering.com page 8/10 Step 9: Error analysis and optimal step The Newton’s quotient to approximate the derivative contains two sources of error:  Round-off error;  Truncation error. This follows from the Taylor series expansion of : where and hence: The first term contributes to round-off error, while the second term gives rise to a truncation error. As reported on the right the total error can be expressed as ̅ From the above formula it is possible to compute the optimal step size . Taking the derivative of the total error with respect to and setting this quantity equal to zero, we have: √ ̅ This represents the optimal value for to minimize the total error. Evaluation of the round-off error: The round-off error for the Newton’s quotient can be written as: | ( ) ( ) | | | where | | (remember that where | | ). Moreover we ignore error from division by . In order to evaluate this error, with small, we replace by We do not know the signs of and , so we replace the difference with ̅. This leads to: ̅ | | ̅ where | |. Evaluation of the truncation error: The truncation error is given by: | | where for small values of we replace by and | |.
  • 9. Error analysis and propagation www.openeering.com page 9/10 Step 10: Exercise It is possible to compute the second derivatives of a function using the following approximation Apply the above formula to compute the second derivative of the function at a given point . Moreover, prove the following estimate for the total error: | ( ) ( ) ( ) | ̅ where | | and | |. The upper bound error is minimized when has the value √ ̅ Hints: Using Taylor expansion for the function and to the fourth order paying attention to the signs. (Relative error for second derivative approximation) (Second derivative approximation, table of results)
  • 10. Error analysis and propagation www.openeering.com page 10/10 Step 11: Concluding remarks and References In this tutorial we have collected a series of numerical examples written in Scilab for the study of numerical errors. 1. Scilab Web Page: Available: www.scilab.org. 2. Openeering: www.openeering.com. 3. J. Higham, accuracy and Stability of Numerical Algorithms, SIAM 4. Atkinson, An Introduction to Numerical Analysis, Wiley Step 12: Software content To report a bug or suggest improvements please contact Openeering team at the web site www.openeering.com. Thank you for your attention, Silvia Poles and Manolo Venturin -------------- Main directory -------------- ex01.sce : Expression example ex02.sce : Polynomial example ex03.sce : Derivative example ex04.sce : Second derivative exercise license.txt : The license file