% This is a LaTex file. % Quiz for the undergraduate course "Numerical Analysus I", % Fall semester, 2017, Wei-Cheng Wang. \documentclass[12pt]{article} % The page format, somewhat wider and taller page than in art12.sty. \topmargin -0.1in \headsep 0in \textheight 9.7in \footskip 0.6in \oddsidemargin 0in \evensidemargin 0in \textwidth 6.5in \usepackage{amsfonts,amssymb,amstext} \begin{document} \thispagestyle{empty} % The title and header. \noindent {\scriptsize Numerical Analysis I, Fall 2017 (http://www.math.nthu.edu.tw/\~\,wangwc/)} \hfill \begin{center} \large Quiz 04 \normalsize \end{center} \noindent Nov 24, 2017. % \vspace{.3in} % \bigskip % The questions! \begin{enumerate} \item Give an approximation, $f_h''(x)$, of of $f''(x)$ from $f(x-h)$, $f(x)$ and $f(x+h)$. Then derive an error identity of the form $f''(x) - f''_h(x) = C_1 f^{(?)}(\xi) h^{?}$. {\bf Ans:} Refer to the textbook for the derivation of error term. {\bf(12 pts)} $$ f_h''(x) = \frac{1}{h^2}[f(x-h)-2f(x)+f(x+h)]\;\textrm{{\bf(4 pts)}} $$ $$ f''(x) - f''_h(x) = C_1f^{(4)}(\xi) h^{2}\;\textrm{{\bf(4 pts)}} $$ \item Find $\min_{h>0} e(h) = \min_{h>0} |f''(x)-f''_h(x) |$ where $f''_h(x)$ is the three point formula from previous problem. Express the critical value $h^*$ and the minimum $e(h^*)$ in terms of machine $\varepsilon$ as $O(\varepsilon^\alpha)$ and find $\alpha$ for them. {\bf Ans:} The round-off error is bounded by $$ \frac{4\epsilon}{h^2}+\frac{h^2}{12}M $$ where $M$ is an upper bound of $|f^{(4)}|$. {\bf(12 pts)} \\ Thus, the optimal $h^* = O(\epsilon^{1/4})$ {\bf(4 pts)} and $e(h^*) = O(\epsilon^{1/2})$ {\bf(4 pts)}. \item Derive a fourth order approximation of $f'(x)$ from $f(x)$, $f(x\pm h)$, $f(x\pm 2 h)$, $f(x \pm 3h), \cdots$. Assume $f\in C^\infty$ and show that your formula satisfies $ |f'(x) - f'_h(x)| \leq C h^{4}$. {\bf Ans:} Refer to the textbook for the derivation of approximation. {\bf(12 pts)} $$ f_h'(x) = \frac{1}{12h}[f(x-2h)-8f(x-h)+8f(x+h)-f(x+2h)]\;\textrm{{\bf(4 pts)}} $$ Show the inequality of error term. {\bf(4 pts)} \item Let $x_0 = a$, $x_1 = {a+b \over 2}$, and $x_2 = b$. Write down trapezoidal rule, the midpoint rule and Simpson's rule approximations of $\int_a^b f(x) dx$. Then derive the error formula (equality) for any one of them of your choice. {\bf Ans:}\\ Refer to the textbook for the derivation of error term {\bf(4 pts)}. Error term {\bf(4 pts)}.\\ Trapezoidal: $\frac{h}{2}[f(x_0)+f(x_2)]$ where $h = b-a$ {\bf(4 pts)}. Error: $-\frac{h^3}{12}f''(\xi)$. \\ Midpoint: $2hf(x_1)$ where $h = (b-a)/2$ {\bf(4 pts)}. Error: $\frac{h^3}{3}f''(\xi)$.\\ Simpson's: $\frac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]$ where $h = (b-a)/2$ {\bf(4 pts)}. Error: $-\frac{h^5}{90}f^{(4)}(\xi)$. \item Evaluate the degree of precision for all three methods in previous problem. Give definition and show details. You may choose any $a$, $b$ for your convenience ($-1$, $1$ are recommended). {\bf Ans:}\\ Definition of degree of precision. {\bf(5 pts)}\\ Trapezoidal: DOP=1, details. {\bf(5 pts)}\\ Midpoint: DOP=1, details. {\bf(5 pts)}\\ Simpson's: DOP=3, details. {\bf(5 pts)} \end{enumerate} %% \item %% At least how many points among %% $f(x)$, $f(x\pm h)$, $f(x\pm 2 h)$, $f(x \pm 3h), \cdots$ are needed to %% approximate $f^{(4)}(x)$? What is the order of the truncation %% error $p$ in $f^{(4)}(x) - f^{(4)}_h(x) = O(h^p)$? Explain. %% You could give your answer with or without explicitly finding %% the coefficients of %% $f(x)$, $f(x\pm h)$, $f(x\pm 2 h)$, $f(x \pm 3h), \cdots$. %% \item %% Let $N(h) = \left( {1 + h \over 1-h} \right)^{1\over h}$ %% and $M = \lim_{h \to 0} N(h)$. Note that $N(h)=N(-h)$. %% Apply the Richardson extrapolation procedure %% to derive an approximation $N_{2}(h)$ of %% $M$ from $N(h)$ and $N(2h)$ %% and %% give an estimate of the error $N_2{h} - N(h) = O(h^p)$ (i.e. find $p$). %% Finally, evaluate $N_2(0.01)$. % {\noindent Name your codes in the same format as $s104000001.m$ or % $s103000002.c$ and make sure it is executable/compilable.} \vspace{1.7in} \noindent {\scriptsize Numerical Analysis I, Fall 2017 (http://www.math.nthu.edu.tw/\~\,wangwc/)} \hfill \begin{center} \large Quiz 04 \normalsize \end{center} \noindent Nov 24, 2017. % \vspace{.3in} % \bigskip % The questions! \begin{enumerate} \item Give an approximation, $f_h''(x)$, of of $f''(x)$ from $f(x-h)$, $f(x)$ and $f(x+h)$. Then derive an error identity of the form $f''(x) - f''_h(x) = C_1 f^{(?)}(\xi) h^{?}$. \item Find $\min_{h>0} e(h) = \min_{h>0} |f''(x)-f''_h(x) |$ where $f''_h(x)$ is the three point formula from previous problem. Express the critical value $h^*$ and the minimum $e(h^*)$ in terms of machine $\varepsilon$ as $O(\varepsilon^\alpha)$ and find $\alpha$ for them. \item Derive a fourth order approximation of $f'(x)$ from $f(x)$, $f(x\pm h)$, $f(x\pm 2 h)$, $f(x \pm 3h), \cdots$. Assume $f\in C^\infty$ and show that your formula satisfies $ |f'(x) - f'_h(x)| \leq C h^{4}$. \item Let $x_0 = a$, $x_1 = {a+b \over 2}$, and $x_2 = b$. Write down trapezoidal rule, the midpoint rule and Simpson's rule approximations of $\int_a^b f(x) dx$. Then derive the error formula (equality) for any one of them of your choice. \item Evaluate the degree of precision for all three methods in previous problem. Give definition and show details. You may choose any $a$, $b$ for your convenience ($-1$, $1$ are recommended). \end{enumerate} \end{document}