Test 2a Answer

You might also like

You are on page 1of 7

First name: Last name:

Instructor: Yerlan Amanbek

Section: MATH-351-1L Numerical Methods with Applications, Fall 2022

P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Total

TEST-2
October 27, 2022

Examination Rules
• Students are required to follow all instructions given by the examiners.

• Talking is NOT allowed under any circumstances.

• Students MAY NOT bring any written or printed materials into the examination room except where
explicitly allowed by the examiner.

• Mobile phones are strictly prohibited in the examination room.

• Students MAY NOT bring any electronic device into the examination room except where explicitly
allowed by the examiner.

• Students may raise their hand to ask the examiner a question. The examiner may decide not to answer
the question: students are expected to know the requisite terminology and understand the examination
questions.

• Students are NOT allowed to leave the examination room until ready to turn in their work.

• Once a student has seen the examination paper, the student is assumed to be in good health at the
time of the examination.

I have read and understood the examination rules. I will not cheat, copy from other students, or
use unauthorised materials or devices, and I have not brought such materials or devices into the
examination room.

Signed: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 1: Multiple Choice questions (3 points each)

Directions: Mark the correct choice and write only one choice to the provided space.
1. In cubic spline interpolation, which spline derivatives must be continuous at interior points?
A. first derivatives
B. second derivatives
C. third derivatives
D. first and second derivatives
Answer:
f (x+h) f (x h)
D
2. What form does the truncation error take for the di↵erence formula f (x) ⇡ 2h ?
A. O(h3 )
B. O(h2 )
OC. O(h)
D. O(1)
Answer: B
3. Which of the statements below is TRUE regarding the di↵erence formula
1 h4 (5)
f 0 (x) = (f (x 2h) 8f (x h) + 8f (x + h) f (x + 2h)) + f (⇠)?
12h 30
A. it is a 5-point centered formula
B. the truncation error is O(h4 )
C. when h is large, the truncation error dominates

O
D. All of the above
Answer:
D
4. A first-order di↵erence approximation of the first derivative is written in the form
f 0 (x) = G(h) + c · h + O(h2 ), where c is some constant. Which of the Richardson extrapolation formulas
below is an O(h2 ) approximation of f 0 (x)?
✓ ◆
h
O 2G
A. 2G
2
h
G(h)

G(h)
2
B.
3
h
4G 2 G(h)
C.
3
D. None of the above
Answer:
A
5. Which of the following statements is TRUE?
I Simpson’s rule is exact for linear functions, f (x) = ax + b.
II Simpson’s rule is exact for second-degree polynomials (quadratics), f (x) = ax2 + bx + c.
III Simpson’s rule is exact for fourth-degree polynomials, f (x) = ax4 + bx3 + cx2 + dx + e.
A. I
B. II

O
C. I and II
D. I, II, and III
Answer:
e

Page 2
Part 2: Problems

Directions: Present your solutions in the space provided. Show all your work neatly and concisely and
clearly indicate your final answer.
Z 1
6. [9] The quadrature formula f (x)dx = c0 f ( 1) + c1 f (0) + c2 f (1) is exact for all polynomials of
1
degree less than or equal to two. Determine c0 , c1 , and c2 .

Palle the simplest constant fan feel I n linear fax


quadratic fix x2
fix Isdx 2 Co Ite Itcz't

ffool x
Ia de Ia i o Col1 g lil co e

cofi t g i 28 3 co
f te x
Ia'd c t 31 3
2 9 2co c 1.3 e I 3
c0 = c1 = I c2 = I
7. [6] The velocity of a rocket as a function of time is given by

Time, t (seconds) 0 0.5 1.2 1.5 1.8


Distance, v (m/s) 0 213 223 275 300

Use the forward di↵erence, backward di↵erence or centered di↵erence approximations of the first
derivative for the acceleration a = dv 2
dt of the rocket in m/s at t = 1.5 seconds.

Ed a 15 7,111
04 3095175 83.333

backward all 5 173.333


01151711.1 2755,223

30 21 128.333
centered a 1s 041TL

forward a = 83,333 backward a = 173.333 centered a = 128.333

Page 3
8. [10] Approximate the integral
Z 1
x2 e x
dx
0
using Gaussian quadrature with n = 2 and compare your results to the exact values of the integral.
Find the actual error.

a o 6 1
tttt te Il
x Iz at b I b a t t t ta ta

I see dx
If Itt zdt Iff E sniff E

III t e I bye tatty


D 1594104

if
we
dee 2x ax
e ax
dye
ve e Y
see
fl e t 2xdx

t t t 2 xe dy
X
deed
e dx.dz t
ex
t 2face flex
E E 2et 2 E 2 2 E 0.16060

Error o 16060 0.159411 0100119

Page 4
Z b
9. [10] The Composite Trapezoidal Rule applied to the integral I = f (x)dx gives the error
a
b a 3 00 2 + 2x ex
E= h f (µ). Suppose f 00 (x) = , a = 0.51, b = 1.0. What values of n and h should
12 3
be used to approximate I to within 0.00001?

Phe absolute error is


43 f ly a 0.51 by
let BE 43 If G1 9
Note that
way If g 1 13171237
0,51EMEI

gigs er g ly o
Menz I
gso.si 1.3547 gg
g i 1 2817 wax
grenz 1.3863

Max
194 12 262 eh 262 1,3863
051
feel 0.4621
So 11 y e f 1.3863
62110.00001 10
9 h f ly a 11,3
Pints E 0

he 0.0809 h but 04ns


h's 6934oz or

9
94720.0809 n 99 16.0169
7 and h 041 0.07 to achieve 10 accuracy
Therefore we use n

Page 5
Z 2
10. [(Bonus*) 10] Apply Romberg Integration to find R4,4 for the integral sin(x2 )dx. Use initially the
0
Composite Trapezoidal rule in the approximation.

Using the trapezoidal rule we obtain

n l R 1 0 844 0.7568

2
Ra full fink 0.4630
I 0 2

fin4 0,7442
Ray I 0 2 Sin t Siu i fin

Page 6
Draft page

Page 7

You might also like