2016 Numerical Analysis Final Exam
When is the best time for you?
 Tuesday Dec 13th 16:30 -- 19:30 3 Wednesday Dec 14th 18:00 -- 21:00 1 Thursday Dec 15th 16:30 -- 19:30 7 Friday Dec 16th 9:00 -- 12:00 2 Friday Dec 16th 15:00 -- 18:00 3 Friday Dec 16th 18:00 -- 21:00 1 Sunday Dec 18th 15:00 -- 18:00 2 Monday Dec 19th 18:00 -- 21:00 0 Tuesday Dec 20th 16:30 -- 19:30 15
Poll ended at 5:35 pm on Thursday December 8th 2016. Total votes: 34. Total voters: 20.
Tuesday December 20th 2016
16:30 — 19:30

ANSWER ALL 6 PROBLEMS; ALL PROBLEMS HAVE EQUAL VALUE; NO NOTES OR BOOKS.
 Question #1
Consider the system of equations $AX=B$ with $A$ equal to: $$A=\left[ \begin{array}{ccc} -2 & 2 & -1 \\ 6 & -6 & 7 \\ 3 & -8 & 4 \end{array} \right]$$ and $B$ equal to: $$B=\left[ \begin{array}{c} -1 \\ -7 \\ -6 \end{array} \right]$$ Find $X$ using partial pivoting (by hand).
 12.12.16
 Question #2
Consider the modified Euler method of numerical differentiation. Do the following:
 (a) Assuming that $$\Delta t f\left(t_{n+1/2},~\phi_n+\frac{\Delta t}{2}f (t_n,~\phi_n) + O(\Delta t^2) \right) = \Delta t f\left(t_{n+1/2},~\phi_n+\frac{\Delta t}{2}f (t_n,~\phi_n) \right) + O(\Delta t^3)$$ Show that the modified Euler method is second-order accurate. (b) For $f(t,\phi)=\frac{1}{\phi}$, show that the assumption in (a) is valid.
 Question #3
Making use of the Simpson rule: $$I_i=\textrm{odd}(i) \frac{(\Delta x_i+\Delta x_{i+1})}{6} \left( f(x_i) + 4 f(x_{i+1}) +f(x_{i+2}) \right) + O(\Delta x_i^5)$$ Write a C code that finds the numerical solution of the integral $$\int_{x=0}^{x=2} e^{x^2}$$ in the interval $1<x<2$ with the number of integration steps $N$ set to 50. The C code should start as follows:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>

double f(double x){
double ret;
ret=exp(x*x);
return(ret);
}

int main(void){
Note: the C code should work when $N$ is odd and when $N$ is even.
 Question #4
You obtain a polynomial of degree 3 that yields $y$ as a function of $x$ from 4 data points ($x_1,y_1$), ($x_2,y_2$), ($x_3,y_3$), ($x_4,y_4$). Knowing the polynomial coefficients, determine the minimum number of arithmetic operations (additions, subtractions, multiplications, and divisions) necessary to calculate $y$ as a function of $x$ from $x=0$ to $x=1$ using a step $\Delta x=0.01$ for
 (a) A Vandermonde polynomial. (b) A Lagrange polynomial. (b) A Newton polynomial.
 Question #5
Consider the following non-linear system of equations: $$\sin^2(x_1) \cos(x_2)=0.5$$ $$\sqrt{x_1}-x_2=0.3$$ Do the following:
 (a) Find the root of the system starting from the guess $x_1=x_2=0.6$ and make sure the root is correct to at least 6 significant digits. Hint: first substitute one equation in the other to obtain 1 equation for 1 unknown, and then find the root for such unknown through an iterative root solver of your choice. (b) Starting from the guess $x_1=x_2=0.6$ and with the first steps $\Delta x_1=\Delta x_2=0.00001$, use the secant method in system form to obtain the root of the system. Solve by hand the first 2 iterations only. Outline clearly all the steps including the expressions used to compute the Jacobians.
 Question #6
Consider 9 nodes arranged as follows:
with the following values and $x$-$y$ coordinates:
 Node $x$ $y$ $\phi$ 1 0 ? 100 2 ? ? 120 3 1 ? 150 4 0 1 160 5 ? 1 170 6 1 1 190 7 0 2 200 8 ? 2 230 9 1 2 270
using a multidimensional piecewise-linear interpolation, it is found that: $$\phi_{x=0.2,y=1.6}=190$$ and $$\phi_{x=0.8,y=0.8}=170$$ Knowing that $$x_2=x_5=x_8$$ $$y_1=y_2=y_3$$ find (in no particular order):
 (a) The $y$ coordinate of nodes 1, 2, and 3. (b) The $x$ coordinate of nodes 2, 5, and 8.
 1. 2, $\frac{1}{4}$, $-\frac{5}{2}$. 4. 808, 1943 or 1741, 1111. 5. 0.919332, 0.658818, 0.9197, 0.6586. 6. 0.733, -0.9.
 $\pi$