SlideShare a Scribd company logo
PRACTICAL
Name- Saloni Singhal
M.Sc. (Statistics) II-Sem.
Roll No: 2046398
Course- MATH-409 L
Numerical Analysis Lab
Submitted To: Dr. S.C. Pandey
1.3
OBJECTIVE
Error Analysis in Computation: Round Off
and Truncation Errors
Problem Statement
1.Write a program (script file) for computation of Exponential function ex up to
4 terms in its series expansion. Calculate the value (true value of ex at x=0.001)
2.Evaluate the error in the computation of ex at x=0.001 (absolute error and
fractional relative error in percentage.)
3. Approximate the first derivative of tan(x) at x =1, and evaluate its relative
percentage error.
Theory
Computational Errors:
• Rounding off error occur as machine has limited capacity to store
exact number.
• For example: rational number having finite number of digits.
• The accumulated effect become significant after repeated operations.
They are of two types: 1.chopping
2.symmetry round off
• Truncation error arises when exact mathematical procedure is
approximated and process is truncated after a finite number of
iterations for computational simplicity.
• Example: when infinite series is to be added to arrive at exact result
Program
>> format long
>> n=0;
x=0.001;
y=0;
%expanding taylor series for ex
>> while n<=4
a=x^n/factorial(n);
n=n+1; y=y+a
end
y =
1
y =
1.001000000000000
y =
1.001000500000000
Program
Contd.
y =
1.001000500166667
y =
1.001000500166708
>> truevav=exp(0.001)
truevav =
1.001000500166708
>> err=abs(truevav-y)
err =
0
Error Analysis
As h grows smaller and smaller, f[x + h, x − h]
becomes a better and better approximation to
f(x) .If we plot the truncation error against h on a
log- scale (for linearity), we expect to see a
straight line. For small h values, the error is
dominated by roundoff rather than by truncation
error. An advantage of the higher order of
accuracy is that we can get very small truncation
errors even when h is not very small, and so we
tend to be able to reach a better optimal error
before cancellation effects start to dominate.
2. Program Contd.
h=zeros(5,1)
%initial zero matrix for approximated value
approxval=zeros(5,1)
err=zeros(5,1)
e=zeros(5,1)
format long
for i=1:5; x=1;
h(i)=10^(-i);
trueval=(sec(x))^2;
%numerical diffential
approxval(i)=(tan(x+h(i))-tan(x))/h(i);
%relative error
err(i)=abs(trueval-approxval(i))
e(i)=(err(i)/trueval)*100
end
Another way to create a
matrix is to use a function,
such as ones, zeros,
or rand.
Conclusion
Effect of change of the step size (h) in the
approximation of the function tan(x)
Error Analysis
The secant of a function based at a and a +h, as well as the tangent at a.
h ( f (a +h)− f (a))/h E(f ;a,h)
10−1 4.073519 -0.6480711
10−2 3.4798299 -0.053110792
10−3 3.4308632 -0.00534437
10−4 3.4260524 -0.0053357
10−5 3.4255721 -5.37919*10−5
Round Off Error: E(f ;a,h) = f’(a)− f (a+h)− f (a) /h. We observe
that the approximation improves with decreasing h, as expected.
More precisely, when h is reduced by a factor of 10, the error is
reduced by the same factor.
Truncation Error
Expansion of f (a +h) about x = a using Taylor expansion, where ξh lies
in the interval (a,a+h). The formula may be rearranged to give an
expression for the error often referred to as the truncation error of the
approximation. It is bounded as:
Optimum step size(h)
Total error is given by:
To find the value of h which minimizes this expression, we differentiate with
respect to h and set the derivative to zero. We find 0 (h) = 0, we obtain the
approximate optimal value of h
References
• Class Codes by Prof. S.C. Pandey Sir
• MATLAB documentation
• Numerical Differentiation e-notes
• Introduction to Scientific Computing (CS 3220)
Bindel, Spring. 2012

More Related Content

What's hot

numerical methods
numerical methodsnumerical methods
numerical methods
HaiderParekh1
 
Errors in Numerical Analysis
Errors in Numerical AnalysisErrors in Numerical Analysis
Errors in Numerical Analysis
Souma Maiti
 
introduction to Numerical Analysis
introduction to Numerical Analysisintroduction to Numerical Analysis
introduction to Numerical Analysis
Ghulam Mehdi Sahito
 
Applications of numerical methods
Applications of numerical methodsApplications of numerical methods
Applications of numerical methods
Tarun Gehlot
 
Applications of numerical methods
Applications of numerical methodsApplications of numerical methods
Applications of numerical methods
Daffodil International University
 
Importance of Numerical Methods in CSE.pptx
Importance of Numerical Methods in CSE.pptxImportance of Numerical Methods in CSE.pptx
Importance of Numerical Methods in CSE.pptx
Sanad Bhowmik
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
Mohammed_AQ
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
asad faraz
 
Interpolation
InterpolationInterpolation
Interpolation
Bhavik A Shah
 
Introduction to Numerical Analysis
Introduction to Numerical AnalysisIntroduction to Numerical Analysis
Introduction to Numerical Analysis
Mohammad Tawfik
 
Maximum sum subarray
Maximum sum subarrayMaximum sum subarray
Maximum sum subarray
Shaheen kousar
 
Approximation and error
Approximation and errorApproximation and error
Approximation and errorrubenarismendi
 
Optimization tutorial
Optimization tutorialOptimization tutorial
Optimization tutorial
Northwestern University
 
weddle's rule
weddle's ruleweddle's rule
weddle's rule
Effa Kiran
 
Engineering mathematics 1
Engineering mathematics 1Engineering mathematics 1
Engineering mathematics 1
Minia University
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
Yosuke Mizutani
 
Fuzzy Logic ppt
Fuzzy Logic pptFuzzy Logic ppt
Fuzzy Logic ppt
Ritu Bafna
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson MethodJigisha Dabhi
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method
Bhavik Vashi
 
Newton raphson method
Newton raphson methodNewton raphson method
Newton raphson method
Jayesh Ranjan
 

What's hot (20)

numerical methods
numerical methodsnumerical methods
numerical methods
 
Errors in Numerical Analysis
Errors in Numerical AnalysisErrors in Numerical Analysis
Errors in Numerical Analysis
 
introduction to Numerical Analysis
introduction to Numerical Analysisintroduction to Numerical Analysis
introduction to Numerical Analysis
 
Applications of numerical methods
Applications of numerical methodsApplications of numerical methods
Applications of numerical methods
 
Applications of numerical methods
Applications of numerical methodsApplications of numerical methods
Applications of numerical methods
 
Importance of Numerical Methods in CSE.pptx
Importance of Numerical Methods in CSE.pptxImportance of Numerical Methods in CSE.pptx
Importance of Numerical Methods in CSE.pptx
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
 
Interpolation
InterpolationInterpolation
Interpolation
 
Introduction to Numerical Analysis
Introduction to Numerical AnalysisIntroduction to Numerical Analysis
Introduction to Numerical Analysis
 
Maximum sum subarray
Maximum sum subarrayMaximum sum subarray
Maximum sum subarray
 
Approximation and error
Approximation and errorApproximation and error
Approximation and error
 
Optimization tutorial
Optimization tutorialOptimization tutorial
Optimization tutorial
 
weddle's rule
weddle's ruleweddle's rule
weddle's rule
 
Engineering mathematics 1
Engineering mathematics 1Engineering mathematics 1
Engineering mathematics 1
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Fuzzy Logic ppt
Fuzzy Logic pptFuzzy Logic ppt
Fuzzy Logic ppt
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson Method
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method
 
Newton raphson method
Newton raphson methodNewton raphson method
Newton raphson method
 

Similar to Error analysis

Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Ahmed Gamal Abdel Gawad
 
1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx
MOHAMMAD SAYDUL ALAM
 
Bisection method in maths 4
Bisection method in maths 4Bisection method in maths 4
Bisection method in maths 4
Vaidik Trivedi
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c language
AMIT KUMAR
 
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
 
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
amanabr
 
NACA Regula Falsi Method
 NACA Regula Falsi Method NACA Regula Falsi Method
NACA Regula Falsi Method
Mujeeb UR Rahman
 
Numerical analysis using Scilab: Error analysis and propagation
Numerical analysis using Scilab: Error analysis and propagationNumerical analysis using Scilab: Error analysis and propagation
Numerical analysis using Scilab: Error analysis and propagation
Scilab
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
SALU18
 
Mechanical Engineering Homework Help
Mechanical Engineering Homework HelpMechanical Engineering Homework Help
Mechanical Engineering Homework Help
Matlab Assignment Experts
 
Euler Method
Euler MethodEuler Method
Euler Method
Saloni Singhal
 
1
11
Informe #1 de metodos
Informe #1 de metodosInforme #1 de metodos
Informe #1 de metodos
juanpabloCantero2
 
Ai_Project_report
Ai_Project_reportAi_Project_report
Ai_Project_reportRavi Gupta
 
MATLAB Codes for Jacobi method
MATLAB Codes for Jacobi methodMATLAB Codes for Jacobi method
MATLAB Codes for Jacobi method
Saloni Singhal
 
NUMERICA METHODS 1 final touch summary for test 1
NUMERICA METHODS 1 final touch summary for test 1NUMERICA METHODS 1 final touch summary for test 1
NUMERICA METHODS 1 final touch summary for test 1
musadoto
 
3 analysis.gtm
3 analysis.gtm3 analysis.gtm
3 analysis.gtm
Natarajan Angappan
 
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
infantsuk
 
My Postdoctoral Research
My Postdoctoral ResearchMy Postdoctoral Research
My Postdoctoral Research
Po-Ting Wu
 

Similar to Error analysis (20)

Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
 
1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx1. Ch_1 SL_1_Intro to Matlab.pptx
1. Ch_1 SL_1_Intro to Matlab.pptx
 
Es272 ch2
Es272 ch2Es272 ch2
Es272 ch2
 
Bisection method in maths 4
Bisection method in maths 4Bisection method in maths 4
Bisection method in maths 4
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c language
 
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
 
NACA Regula Falsi Method
 NACA Regula Falsi Method NACA Regula Falsi Method
NACA Regula Falsi Method
 
Numerical analysis using Scilab: Error analysis and propagation
Numerical analysis using Scilab: Error analysis and propagationNumerical analysis using Scilab: Error analysis and propagation
Numerical analysis using Scilab: Error analysis and propagation
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
 
Mechanical Engineering Homework Help
Mechanical Engineering Homework HelpMechanical Engineering Homework Help
Mechanical Engineering Homework Help
 
Euler Method
Euler MethodEuler Method
Euler Method
 
1
11
1
 
Informe #1 de metodos
Informe #1 de metodosInforme #1 de metodos
Informe #1 de metodos
 
Ai_Project_report
Ai_Project_reportAi_Project_report
Ai_Project_report
 
MATLAB Codes for Jacobi method
MATLAB Codes for Jacobi methodMATLAB Codes for Jacobi method
MATLAB Codes for Jacobi method
 
NUMERICA METHODS 1 final touch summary for test 1
NUMERICA METHODS 1 final touch summary for test 1NUMERICA METHODS 1 final touch summary for test 1
NUMERICA METHODS 1 final touch summary for test 1
 
3 analysis.gtm
3 analysis.gtm3 analysis.gtm
3 analysis.gtm
 
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
 
My Postdoctoral Research
My Postdoctoral ResearchMy Postdoctoral Research
My Postdoctoral Research
 

More from Saloni Singhal

Finite Difference Method
Finite Difference MethodFinite Difference Method
Finite Difference Method
Saloni Singhal
 
Runge Kutta Method
Runge Kutta MethodRunge Kutta Method
Runge Kutta Method
Saloni Singhal
 
Simpson's Three-Eighth Method
Simpson's Three-Eighth MethodSimpson's Three-Eighth Method
Simpson's Three-Eighth Method
Saloni Singhal
 
Trapezoidal Rule
Trapezoidal RuleTrapezoidal Rule
Trapezoidal Rule
Saloni Singhal
 
Simpson One-Third
Simpson One-ThirdSimpson One-Third
Simpson One-Third
Saloni Singhal
 
Newton Forward Interpolation
Newton Forward InterpolationNewton Forward Interpolation
Newton Forward Interpolation
Saloni Singhal
 
Newton Backward Interpolation
Newton Backward InterpolationNewton Backward Interpolation
Newton Backward Interpolation
Saloni Singhal
 
Lagrange Interpolation
Lagrange InterpolationLagrange Interpolation
Lagrange Interpolation
Saloni Singhal
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece Table
Saloni Singhal
 
Bisection Method
Bisection MethodBisection Method
Bisection Method
Saloni Singhal
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson method
Saloni Singhal
 
Fixed Point Interation
Fixed Point InterationFixed Point Interation
Fixed Point Interation
Saloni Singhal
 
Power Method
Power MethodPower Method
Power Method
Saloni Singhal
 
Eigen Show
Eigen ShowEigen Show
Eigen Show
Saloni Singhal
 
Inverse Power Method
 Inverse Power Method Inverse Power Method
Inverse Power Method
Saloni Singhal
 
Convergence Analysis
Convergence AnalysisConvergence Analysis
Convergence Analysis
Saloni Singhal
 
MARLAB codes for Gauss Seidel
MARLAB codes for Gauss SeidelMARLAB codes for Gauss Seidel
MARLAB codes for Gauss Seidel
Saloni Singhal
 
L-U Decomposition
L-U DecompositionL-U Decomposition
L-U Decomposition
Saloni Singhal
 
Gauss Elimination (without pivot).pptx
Gauss Elimination (without pivot).pptxGauss Elimination (without pivot).pptx
Gauss Elimination (without pivot).pptx
Saloni Singhal
 
Gauss Elimination (With Partial Pivot)
Gauss Elimination (With Partial Pivot)Gauss Elimination (With Partial Pivot)
Gauss Elimination (With Partial Pivot)
Saloni Singhal
 

More from Saloni Singhal (20)

Finite Difference Method
Finite Difference MethodFinite Difference Method
Finite Difference Method
 
Runge Kutta Method
Runge Kutta MethodRunge Kutta Method
Runge Kutta Method
 
Simpson's Three-Eighth Method
Simpson's Three-Eighth MethodSimpson's Three-Eighth Method
Simpson's Three-Eighth Method
 
Trapezoidal Rule
Trapezoidal RuleTrapezoidal Rule
Trapezoidal Rule
 
Simpson One-Third
Simpson One-ThirdSimpson One-Third
Simpson One-Third
 
Newton Forward Interpolation
Newton Forward InterpolationNewton Forward Interpolation
Newton Forward Interpolation
 
Newton Backward Interpolation
Newton Backward InterpolationNewton Backward Interpolation
Newton Backward Interpolation
 
Lagrange Interpolation
Lagrange InterpolationLagrange Interpolation
Lagrange Interpolation
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece Table
 
Bisection Method
Bisection MethodBisection Method
Bisection Method
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson method
 
Fixed Point Interation
Fixed Point InterationFixed Point Interation
Fixed Point Interation
 
Power Method
Power MethodPower Method
Power Method
 
Eigen Show
Eigen ShowEigen Show
Eigen Show
 
Inverse Power Method
 Inverse Power Method Inverse Power Method
Inverse Power Method
 
Convergence Analysis
Convergence AnalysisConvergence Analysis
Convergence Analysis
 
MARLAB codes for Gauss Seidel
MARLAB codes for Gauss SeidelMARLAB codes for Gauss Seidel
MARLAB codes for Gauss Seidel
 
L-U Decomposition
L-U DecompositionL-U Decomposition
L-U Decomposition
 
Gauss Elimination (without pivot).pptx
Gauss Elimination (without pivot).pptxGauss Elimination (without pivot).pptx
Gauss Elimination (without pivot).pptx
 
Gauss Elimination (With Partial Pivot)
Gauss Elimination (With Partial Pivot)Gauss Elimination (With Partial Pivot)
Gauss Elimination (With Partial Pivot)
 

Recently uploaded

Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
benishzehra469
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
ewymefz
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
NABLAS株式会社
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
correoyaya
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
Tiktokethiodaily
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
yhkoc
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
nscud
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Subhajit Sahu
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
Oppotus
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
StarCompliance.io
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
vcaxypu
 

Recently uploaded (20)

Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
 

Error analysis

  • 1. PRACTICAL Name- Saloni Singhal M.Sc. (Statistics) II-Sem. Roll No: 2046398 Course- MATH-409 L Numerical Analysis Lab Submitted To: Dr. S.C. Pandey 1.3
  • 2. OBJECTIVE Error Analysis in Computation: Round Off and Truncation Errors Problem Statement 1.Write a program (script file) for computation of Exponential function ex up to 4 terms in its series expansion. Calculate the value (true value of ex at x=0.001) 2.Evaluate the error in the computation of ex at x=0.001 (absolute error and fractional relative error in percentage.) 3. Approximate the first derivative of tan(x) at x =1, and evaluate its relative percentage error.
  • 3. Theory Computational Errors: • Rounding off error occur as machine has limited capacity to store exact number. • For example: rational number having finite number of digits. • The accumulated effect become significant after repeated operations. They are of two types: 1.chopping 2.symmetry round off • Truncation error arises when exact mathematical procedure is approximated and process is truncated after a finite number of iterations for computational simplicity. • Example: when infinite series is to be added to arrive at exact result
  • 4. Program >> format long >> n=0; x=0.001; y=0; %expanding taylor series for ex >> while n<=4 a=x^n/factorial(n); n=n+1; y=y+a end y = 1 y = 1.001000000000000 y = 1.001000500000000
  • 5. Program Contd. y = 1.001000500166667 y = 1.001000500166708 >> truevav=exp(0.001) truevav = 1.001000500166708 >> err=abs(truevav-y) err = 0
  • 6. Error Analysis As h grows smaller and smaller, f[x + h, x − h] becomes a better and better approximation to f(x) .If we plot the truncation error against h on a log- scale (for linearity), we expect to see a straight line. For small h values, the error is dominated by roundoff rather than by truncation error. An advantage of the higher order of accuracy is that we can get very small truncation errors even when h is not very small, and so we tend to be able to reach a better optimal error before cancellation effects start to dominate.
  • 7. 2. Program Contd. h=zeros(5,1) %initial zero matrix for approximated value approxval=zeros(5,1) err=zeros(5,1) e=zeros(5,1) format long for i=1:5; x=1; h(i)=10^(-i); trueval=(sec(x))^2; %numerical diffential approxval(i)=(tan(x+h(i))-tan(x))/h(i); %relative error err(i)=abs(trueval-approxval(i)) e(i)=(err(i)/trueval)*100 end Another way to create a matrix is to use a function, such as ones, zeros, or rand.
  • 8. Conclusion Effect of change of the step size (h) in the approximation of the function tan(x)
  • 9. Error Analysis The secant of a function based at a and a +h, as well as the tangent at a. h ( f (a +h)− f (a))/h E(f ;a,h) 10−1 4.073519 -0.6480711 10−2 3.4798299 -0.053110792 10−3 3.4308632 -0.00534437 10−4 3.4260524 -0.0053357 10−5 3.4255721 -5.37919*10−5 Round Off Error: E(f ;a,h) = f’(a)− f (a+h)− f (a) /h. We observe that the approximation improves with decreasing h, as expected. More precisely, when h is reduced by a factor of 10, the error is reduced by the same factor.
  • 10. Truncation Error Expansion of f (a +h) about x = a using Taylor expansion, where ξh lies in the interval (a,a+h). The formula may be rearranged to give an expression for the error often referred to as the truncation error of the approximation. It is bounded as: Optimum step size(h) Total error is given by: To find the value of h which minimizes this expression, we differentiate with respect to h and set the derivative to zero. We find 0 (h) = 0, we obtain the approximate optimal value of h
  • 11. References • Class Codes by Prof. S.C. Pandey Sir • MATLAB documentation • Numerical Differentiation e-notes • Introduction to Scientific Computing (CS 3220) Bindel, Spring. 2012