Docsity

Computational Methods in Civil Engineering: Homework Set #5 - Prof. Joannes Westerink, Assignments of Civil Engineering

Toggle sidebar
bg1
UNIVERSITY OF NOTRE DAME
Department of Civil Engineering
and Geological Sciences
CE 30125 Computational Methods October 16, 2009
J.J. Westerink Due: November 3, 2009
Homework Set #5 (revised 10/19/2009)
Problem 1
Consider the second order accurate backward difference approximation to the second derivative
Using Taylor series analysis, show that the error in this approximation is:
Problem 2
Use the method of undetermined coefficients to derive a fourth order accurate central difference approximation
to the first derivative, . Include details of the leading order error term.
Problem 3
Evaluate the first derivative of the function:
at point using a second order accurate central difference approximation to the first derivative
where , , , , and
Hint: you can compute the third derivative in the formal truncation error by taking the analytical third deriva-
tive of the specified function f(x).
a) Use 5 different spacings to compute the discrete approximation to the derivative: ; ;
; ; . Complete the table shown computing the discrete approximation to the
derivative and the actual error, . Also compute the formal truncation error, .
1.0
0.5
0.1
0.05
0.01
fi2() 2fi5fi1–
–4fi2– fi3–
–+
h2
----------------------------------------------------------- E+=
E11
12
------h2fi4()
≅
fi1()
fx() 3x65x3
–32x2x6–++=
x01=
f01() EFormal
+f1f1–
–
2h
----------------=
f1– fx1–
()≡
f1fx
1
()≡
x1x0h+≡
EFormal formal truncation error 1
6
---h2f03()
==
h1.0=
h0.5=
h0.1=
h0.05=
h0.01=
EActual
EFormal
h
f1–
f1
f1f1–
–
2h
----------------
EActual
f1f1–
–
2h
----------------f1()x0
()–=
EFormal
pf2

Partial preview of the text

Download Computational Methods in Civil Engineering: Homework Set #5 - Prof. Joannes Westerink and more Assignments Civil Engineering in PDF only on Docsity!

UNIVERSITY OF NOTRE DAME

Department of Civil Engineering

and Geological Sciences

CE 30125 Computational Methods October 16, 2009

J.J. Westerink Due: November 3, 2009

Homework Set #5 (revised 10/19/2009)

Problem 1

Consider the second order accurate backward difference approximation to the second derivative

Using Taylor series analysis, show that the error in this approximation is:

Problem 2

Use the method of undetermined coefficients to derive a fourth order accurate central difference approximation

to the first derivative,. Include details of the leading order error term.

Problem 3

Evaluate the first derivative of the function:

at point using a second order accurate central difference approximation to the first derivative

where , , , , and

Hint: you can compute the third derivative in the formal truncation error by taking the analytical third deriva-

tive of the specified function f(x).

a) Use 5 different spacings to compute the discrete approximation to the derivative: ; ;

; ;. Complete the table shown computing the discrete approximation to the

derivative and the actual error,. Also compute the formal truncation error,.

f (^) i (^2 )^

2 f (^) i – 5 f (^) i – 1 + 4 f (^) i – 2 – f (^) i – 3 h^2

=----------------------------------------------------------- + E

E ≅^1112 ------ h^2 f (^) i (^4 )

f (^) i (^1 )

f x ( ) = 3 x^6 – 5 x^3 + 32 x^2 + x – 6 x 0 = 1

f 0 (^1 )^ + E (^) Formal

f 1 – f (^) – 1 = --------------- 2 h -

f (^) – 1 ≡ f x ( (^) – 1 ) f 1 ≡ f x ( 1 ) x (^) – 1 ≡ x 0 – h x 1 ≡ x 0 + h E (^) Formal = formal truncation error =^16 --- h^2 f 0 (^3 )

h = 1.0 h =0. h = 0.1 h = 0.05 h =0. E (^) Actual E (^) Formal

h f (^) – 1 f 1

f 1 – f (^) – 1 --------------- 2 h - E (^) Actual

f 1 – f (^) – 1 --------------- 2 h - f ( 1 ) (^) x = – ( 0 ) E (^) Formal

b) Plot ln vs. ln for your data. On the same graph plot ln vs. ln. Label your

graph appropriately. Comment on:

i) The slopes of your error curves and how they relate to the formal truncation error associ-

ated with the second order accurate formula.

ii) Any discrepancies which exist between the and curves and why all points do not lie

along a straight line in the curve.

( E (^) actual ) ( h ) ( E (^) Formal ) ( h )

E (^) Formal

E (^) actual E (^) Formal E (^) actual