SlideShare a Scribd company logo
1 of 11
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

introduction to Numerical Analysis
introduction to Numerical Analysisintroduction to Numerical Analysis
introduction to Numerical AnalysisGhulam Mehdi Sahito
 
Interpolation and its applications
Interpolation and its applicationsInterpolation and its applications
Interpolation and its applicationsRinkuMonani
 
Errors in Numerical Analysis
Errors in Numerical AnalysisErrors in Numerical Analysis
Errors in Numerical AnalysisSouma Maiti
 
Presentation on Solution to non linear equations
Presentation on Solution to non linear equationsPresentation on Solution to non linear equations
Presentation on Solution to non linear equationsRifat Rahamatullah
 
lagrange interpolation
lagrange interpolationlagrange interpolation
lagrange interpolationayush raj
 
Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Muhammad Waqas
 
Applications of linear algebra
Applications of linear algebraApplications of linear algebra
Applications of linear algebraPrerak Trivedi
 
Floating point representation
Floating point representationFloating point representation
Floating point representationmissstevenson01
 
systems of linear equations & matrices
systems of linear equations & matricessystems of linear equations & matrices
systems of linear equations & matricesStudent
 
Linear Algebra Applications
Linear Algebra ApplicationsLinear Algebra Applications
Linear Algebra ApplicationsRamesh Shashank
 
Newton's forward & backward interpolation
Newton's forward & backward interpolationNewton's forward & backward interpolation
Newton's forward & backward interpolationHarshad Koshti
 
numerical differentiation&integration
numerical differentiation&integrationnumerical differentiation&integration
numerical differentiation&integration8laddu8
 
Application of numerical method
Application of numerical methodApplication of numerical method
Application of numerical methodNayeem Rahman
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrixitutor
 

What's hot (20)

Numerical methods
Numerical methodsNumerical methods
Numerical methods
 
numerical methods
numerical methodsnumerical methods
numerical methods
 
introduction to Numerical Analysis
introduction to Numerical Analysisintroduction to Numerical Analysis
introduction to Numerical Analysis
 
Interpolation
InterpolationInterpolation
Interpolation
 
Interpolation and its applications
Interpolation and its applicationsInterpolation and its applications
Interpolation and its applications
 
Errors in Numerical Analysis
Errors in Numerical AnalysisErrors in Numerical Analysis
Errors in Numerical Analysis
 
NACA Regula Falsi Method
 NACA Regula Falsi Method NACA Regula Falsi Method
NACA Regula Falsi Method
 
Presentation on Solution to non linear equations
Presentation on Solution to non linear equationsPresentation on Solution to non linear equations
Presentation on Solution to non linear equations
 
lagrange interpolation
lagrange interpolationlagrange interpolation
lagrange interpolation
 
Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1
 
Applications of linear algebra
Applications of linear algebraApplications of linear algebra
Applications of linear algebra
 
Floating point representation
Floating point representationFloating point representation
Floating point representation
 
systems of linear equations & matrices
systems of linear equations & matricessystems of linear equations & matrices
systems of linear equations & matrices
 
Linear Algebra Applications
Linear Algebra ApplicationsLinear Algebra Applications
Linear Algebra Applications
 
APPLICATION OF NUMERICAL METHODS IN SMALL SIZE
APPLICATION OF NUMERICAL METHODS IN SMALL SIZEAPPLICATION OF NUMERICAL METHODS IN SMALL SIZE
APPLICATION OF NUMERICAL METHODS IN SMALL SIZE
 
Newton's forward & backward interpolation
Newton's forward & backward interpolationNewton's forward & backward interpolation
Newton's forward & backward interpolation
 
numerical differentiation&integration
numerical differentiation&integrationnumerical differentiation&integration
numerical differentiation&integration
 
Application of numerical method
Application of numerical methodApplication of numerical method
Application of numerical method
 
BISECTION METHOD
BISECTION METHODBISECTION METHOD
BISECTION METHOD
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrix
 

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 - AGAAhmed Gamal Abdel Gawad
 
Bisection method in maths 4
Bisection method in maths 4Bisection method in maths 4
Bisection method in maths 4Vaidik Trivedi
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c languageAMIT 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_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
 
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 propagationScilab
 
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.docxSALU18
 
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 methodSaloni 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 1musadoto
 
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.docxinfantsuk
 
My Postdoctoral Research
My Postdoctoral ResearchMy Postdoctoral Research
My Postdoctoral ResearchPo-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
 
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
 
Matlab lab.pdf
Matlab lab.pdfMatlab lab.pdf
Matlab lab.pdf
 

More from Saloni Singhal

Finite Difference Method
Finite Difference MethodFinite Difference Method
Finite Difference MethodSaloni Singhal
 
Simpson's Three-Eighth Method
Simpson's Three-Eighth MethodSimpson's Three-Eighth Method
Simpson's Three-Eighth MethodSaloni Singhal
 
Newton Forward Interpolation
Newton Forward InterpolationNewton Forward Interpolation
Newton Forward InterpolationSaloni Singhal
 
Newton Backward Interpolation
Newton Backward InterpolationNewton Backward Interpolation
Newton Backward InterpolationSaloni Singhal
 
Lagrange Interpolation
Lagrange InterpolationLagrange Interpolation
Lagrange InterpolationSaloni Singhal
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece TableSaloni Singhal
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson methodSaloni Singhal
 
Fixed Point Interation
Fixed Point InterationFixed Point Interation
Fixed Point InterationSaloni Singhal
 
MARLAB codes for Gauss Seidel
MARLAB codes for Gauss SeidelMARLAB codes for Gauss Seidel
MARLAB codes for Gauss SeidelSaloni Singhal
 
Gauss Elimination (without pivot).pptx
Gauss Elimination (without pivot).pptxGauss Elimination (without pivot).pptx
Gauss Elimination (without pivot).pptxSaloni 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

IMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxIMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxdolaknnilon
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSINGmarianagonzalez07
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 

Recently uploaded (20)

IMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptxIMA MSN - Medical Students Network (2).pptx
IMA MSN - Medical Students Network (2).pptx
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 

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