Sie sind auf Seite 1von 6

2/10/2020 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)

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Matlab Programming for Numerical Computation (course)

Announcements (announcements) About the Course (https://swayam.gov.in/nd1_noc20_ge05/preview) Ask a Question (forum)

Progress (student/home) Mentor (student/mentor)

Unit 4 - Module 2: Errors and Approximations


Register for Certification
exam
(https://nptelmarchexam.swayam.gov.in/) Assignment 2
Assignment not submitted Due date: 2020-02-12, 23:59 IST.
Course outline

How does an NPTEL


Problem-1: Smallest Error in Differentiation
online course work?

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) .

3) Please report the value of S(100)

1 point

4) Please report the value of S(500)

1 point

5) Please report the value of S(2000)

1 point

6) Please report the value of S(5000)

1 point

Problem-3: Iterative Method for Cube Root


In the lectures, we saw how to calculate the square root of a number using iterative method. We will use a similar iterative algorithm to find
cube-root of a number a , where the new guess is generated using the following iterative formula

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.

7) For value of a = 8 , please report the value of xnew after 4 iterations.

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

Problem-4: MacLaurin Series for Hyperbolic Function


Please download and use the template file provided: mcLaurinCosh.m (https://drive.google.com/open?
id=0B8FZSbAiAbjGQjVIb3gxdF8wUVU).
In this problem, you will use MacLaurin Series until the n-th order terms to compute approximations of cosh (hyperbolic cosine) function, given
by:

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.

11) Report the result obtained on running the code maclaurinCosh(1.2,4)

1 point

12) Report the result obtained on running the code maclaurinCosh(2.4,9)

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

Das könnte Ihnen auch gefallen