Numerical Method
Assignment #1. Due date: March 6, 2019. Submission via Google Drive
PDF file (Nama_Tgs1.pdf), Times New Roman 11/12 pt or Arial 10/11 pt, single space (try to use max. of 2 pages)
Problem 1
Function:
𝑓(𝑥) = ln 𝑥
Use forward and centered finite differences method to approximate the derivative at x=1 with h between 10-15
and 10-1 (step size: 10-1). Calculate the numerical error (true value – approximation) compared to the
analytical solution (f’(x) = 1/x).
Tabulate your results, e.g.:
Forward difference method Centered difference method
h
Numerical sol. Error, Et Numerical sol. Error, Et
10-1
10-2
.
.
.
10-15
Explain your findings. (Hint: numerical error has two kinds of error. This book is a good start for referencing:
Numerical Methods for Engineers, 6th ed. Authors: Chapra & Canale)
Problem 2
Find at least 4 functions for numerical differentiation calculations at x = 0 using those methods:
−𝑦2 + 4𝑦1 − 3𝑦0
𝑦 ′ (𝑥0 ) =
2ℎ
𝑦1 − 𝑦−1
𝑦 ′ (𝑥0 ) =
2ℎ
−𝑦2 + 8𝑦1 − 8𝑦−1 + 𝑦−2
𝑦 ′ (𝑥0 ) =
12ℎ
Denoted as solution A, B, and C, respectively. Use the same h for all methods.
Tabulate your results, e.g.:
H=h
Analytical −𝑦 +4𝑦 −3𝑦 −𝑦2 +4𝑦1 −3𝑦0 −𝑦2 +8𝑦1 −8𝑦−1 +𝑦−2
A( 2 1 0 ) B( ) C( )
2ℎ 2ℎ 12ℎ
Equation solution
Numerical
(x=0) Error, Et Numerical sol. Error, Et Numerical sol. Error, Et
sol.
Eq 1
Eq 2
Eq 3
Eq 4
*You do not have to use the table format presented here if you do not find it convenient.
Google drive link: