03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A.6. FINAL EXAM, FALL 2004 153<br />

P5 (15 pnts) Find constants, α, β, γ such that the following is a natural cubic spline on [1, 3].<br />

{<br />

α (x − 1) 3 + β (x − 1) 2 + 12 (x − 1) + 1 : 1 ≤ x < 2<br />

Q(x) =<br />

γx 3 + 18x 2 − 30x + 19 : 2 ≤ x < 3<br />

P6 (15 pnts) Devise a subroutine that, given an input number z, calculates an approximate to 3√ z<br />

via Newton’s Method. Write your subroutine in pseudo code, Matlab, or C/C++. Include<br />

reasonable termination conditions so your subroutine will terminate if it finds a good approximate<br />

solution. Your subroutine should use only the basic arithmetic operations of addition,<br />

subtraction, multiplication, division; in particular your subroutine should not have access to<br />

a cubed root or logarithm operator.<br />

P7 (15 pnts) Consider the ODE:<br />

{<br />

x ′ (t) = cos (x(t)) + sin (x(t))<br />

x(0) = 1<br />

Use Taylor’s theorem to devise a O ( h 3) approximant to x(t + h) which is a function of x, t,<br />

and h only. You may write your answer as a program:<br />

x ′ (t) ← Q 0 (x(t))<br />

such that x(t + h) = ˜x + O ( h 3) .<br />

[Questions] Answer all of the following.<br />

P1 (20 pnts) Consider the “quadrature” rule:<br />

∫ 1<br />

0<br />

x ′′ (t) ← Q 1 (x(t), x ′ (t))<br />

.<br />

˜x ← R(x(t), x ′ (t), x ′′ (t), . . .)<br />

f(x) dx ≈ A 0 f(0) + A 1 f(1) + A 2 f ′ (1) + A 3 f ′′ (1)<br />

(a) Write four linear equations involving A i to make this rule exact for polynomials of the<br />

highest possible degree.<br />

(b) Find the constants A i using Gaussian Elimination with naïve pivoting.<br />

P2 (20 pnts) Consider the data:<br />

k 0 1 2<br />

x k 0 0.25 0.5<br />

f(x k ) 1.5 1 0.5<br />

(a) Construct the divided differences table for the data.<br />

(b) Construct the Newton form of the polynomial p(x) of lowest degree that interpolates<br />

f(x) at these nodes.<br />

(c) What degree is your polynomial? Is this strange?<br />

(d) Suppose that these data were generated by the function<br />

f(x) = 1 +<br />

cos 2πx<br />

.<br />

2<br />

Find an upper bound on the error |p(x) − f(x)| over the interval [0, 0.5]. Your answer<br />

should be a number.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!