Matlab Programming For Numerical Computation - Unit 4 - Module 2 - Errors and Approximations
Matlab Programming For Numerical Computation - Unit 4 - Module 2 - Errors and Approximations
parth.gaud270123@paruluniversity.ac.in
(https://swayam.gov.in)
(https://swayam.gov.in/nc_details/NPTEL)
https://onlinecourses.nptel.ac.in/noc20_ge05/unit?unit=9&assessment=92 1/6
2/10/2020 Matlab Programming for Numerical Computation - - Unit 4 - Module 2: Errors and Approximations
The three-point forward difference formula for calculating derivative is given by:
Get Access to MATLAB
Online −f (x+2h)+4f (x+h)−3f (x)
′
f (x) =
2h
Module 1: Introduction to We wish to use this formula for calculating first derivative of f (x) = e
(−1/x)
using various step-size h . Note that the true-value of the
MATLAB
derivative is
(−1/x)
′ e
f (x) =
Module 2: Errors and x
2
Approximations at a point x = 1 .
For value of x=1 , compute numerical derivative for step-sizes:
Lec 2.1: Errors in −2 −3 −8
h = [ 10 10 ⋯ 10 ]
Numerical Computation
(unit?unit=9&lesson=10) For each of the above value of step-size, compute the value of f ′ (x) and compare it with the true value. Compare with the true value and
compute the error ( err ) as abs olute difference between the true and approximate values. Please answer the following questions.
Lec 2.2: Truncation Errors
and Taylor's Series (unit? 1) Please report the value of the error correct to three significant digits. For example, if the error is 1.234*10-8, then please report 1.23e-8 or
unit=9&lesson=11)
0.0000000123.
Lec 2.3: Round-Off Errors;
and Iterative Methods
(unit?unit=9&lesson=12) 1 point
Lec 2.4: Step-wise 2) Which of the following step-sizes gives the minimum error? 1 point
Methods and Error
Propagation (unit? 10-2
unit=9&lesson=8)
10-3
Quiz : Assignment 2 10-4
(assessment?name=92)
10-5
Matlab Programming for 10-6
Numerical Computation :
10-7
Week 2 Feedback Form
(unit?unit=9&lesson=93) 10-8
Module 3: Numerical
Differentiation and
Integration
Problem-2: Non-Convergent Infinite Series
https://onlinecourses.nptel.ac.in/noc20_ge05/unit?unit=9&assessment=92 2/6
2/10/2020 Matlab Programming for Numerical Computation - - Unit 4 - Module 2: Errors and Approximations
We have studied several infinite convergent series to calculate exponential or trigonometric functions. In this example, we will examine an
Text Transcripts
infinite series that is non-convergent:
Download videos 1 1 1
S(n) = 1 + + +⋯+
2 3 n
Write a MATLAB function that takes in the value n and computes the above series sum S(n) .
1 point
1 point
1 point
1 point
1 a
x new = (2x + )
2
3 x
https://onlinecourses.nptel.ac.in/noc20_ge05/unit?unit=9&assessment=92 3/6
2/10/2020 Matlab Programming for Numerical Computation - - Unit 4 - Module 2: Errors and Approximations
Take the initial guess as x=0.5 . The iteration stops when the absolute error, |x new − x| ≤ δ t ol . Please count the number of steps required
as well. Please answer the following questions.
1 point
8) For the above example, also report the error at fourth iteration as above.
1 point
9) For value of a = 20 , please run the iterations until the error |x new − x| falls below 0.001 . Please report the value of xnew after
convergence
1 point
10) For the above case, also report the number of iterations required for convergence.
1 point
https://onlinecourses.nptel.ac.in/noc20_ge05/unit?unit=9&assessment=92 4/6
2/10/2020 Matlab Programming for Numerical Computation - - Unit 4 - Module 2: Errors and Approximations
Please use the vector vec to compute approximate values of cosh(x). Your function should return coshVal , while taking the values of x and
n as inputs.
1 point
1 point
You may submit any number of times before the due date. The final submission will be considered for grading.
Submit Answers
https://onlinecourses.nptel.ac.in/noc20_ge05/unit?unit=9&assessment=92 5/6
2/10/2020 Matlab Programming for Numerical Computation - - Unit 4 - Module 2: Errors and Approximations
https://onlinecourses.nptel.ac.in/noc20_ge05/unit?unit=9&assessment=92 6/6