\documentclass[a4paper, 12pt]{article}
\usepackage[slovene]{babel}
\textwidth17cm
\oddsidemargin-8mm\evensidemargin-8mm
\topmargin-24mm\textheight+740pt

\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsxtra}

\setlength{\parindent}{0pt}

\def\ee{\textrm{e}}

\begin{document}

\Large \centerline{\textbf{IZPIT IZ NUMERI"CNIH METOD}}
\centerline{\textbf{1. februar 2013}}

\normalsize
\begin{enumerate}
  \item Podatke
    $$
      \begin{tabular}{c||cccc}
      x & 1 & 2 & 3 & 4 \\
      \hline
      y & 1 & 3 & 2 & 3
      \end{tabular}
    $$
    aproksimirajte z linearno funkcijo $y = \alpha x + \beta$ po metodi najman"sih kvadratov ter dolo"cite
    koeficienta $\alpha$ in $\beta$. \\[2mm]
    \textbf{Re"sitev:} Iz podatkov dobimo predolo"cen sistem, ki ga zapi"semo v matri"cni obliki
    $$
      \underbrace{\left[ \begin{array}{c} 1 \\ 3 \\ 2 \\ 3 \end{array} \right]}_{\textbf{b}} =
      \underbrace{\left[ \begin{array}{cc} 1 & 1 \\ 3 & 1 \\ 2 & 1 \\ 3 & 1 \end{array} \right]}_{A} \cdot
      \underbrace{\left[ \begin{array}{c} \alpha \\ \beta \end{array} \right]}_{\textbf{x}}.
    $$
    Re"sitev po metodi najman"sih kvadratov dobimo kot re"sitev normalnega sistema
    $$
      A^T \; A \; \textbf{x} = A^T \; \textbf{b}.
    $$
    \begin{eqnarray*}
      \textbf{x} & = & (A^T \; A)^{-1} \; (A^T \; \textbf{b}) \\
      & = & \left[ \begin{array}{cc} 30 & 10 \\ 10 & 4 \end{array} \right]^{-1} \cdot
        \left[ \begin{array}{c} 25 \\ 9 \end{array} \right] =
        \frac{1}{20} \left[ \begin{array}{cc} 4 & -10 \\ -10 & 30 \end{array} \right] \cdot
        \left[ \begin{array}{c} 25 \\ 9 \end{array} \right] = \left[ \begin{array}{c} 1/2 \\ 1 \end{array} \right]
    \end{eqnarray*}
    Koeficienta sta $\alpha = \frac{1}{2}$ in $\beta = 1$, premica je $y = \frac{1}{2}x+1$.
  \item Z uporabo modificirane Eulerjeve metode
    \begin{eqnarray*}
      k_1 & = & f(x_n,y_n), \\
      k_2 & = & f(x_n+h/2,y_n+hk_1/2), \\
      y_{n+1} & = & y_n + hk_2,
    \end{eqnarray*}
    re"site diferencialno ena"cbo
    $$
      y' = -2y, \qquad y(0) = 1.
    $$
    Interval $[0,1]$ razdelite na $n=4$ enako dolge podintervale ter poi"s"cite numeri"cno re"sitev v to"cki
    $x=1$. \\[2mm]
    \textbf{Re"sitev:} Ker je desna stran ena"cbe $f(x,y)=-2y$, se modificirana Eulerjeva metoda poenostavi v
    $$
      y_{n+1} = y_n - 2h \left( y_n - hy_n \right) = y_n \left( 1 - 2h + 2h^2 \right).
    $$
    Korak je $h=\frac{1}{4}$, zato je $1-2h+2h^2=\frac{5}{8}$. Sledi:
    $$
      y_0=1, \quad y_1 = \textstyle{\frac{5}{8}}, \quad y_2 = \textstyle{\frac{25}{64}}, \quad
      y_3 = \textstyle{\frac{125}{512}}, \quad y_4 = \textstyle{\frac{625}{4096}}.
    $$
    Numeri"cna re"sitev v to"cki $x=1$ je $y_n = \frac{625}{4096} \approx 0.1526$, to"cna pa
    $y_t = \ee^{-2} \approx 0.1353$.
  \item Poi"s"cite negibni to"cki funkcije $f(x) = 2x\ee^{-x}+\frac{1}{2}$ ter dolo"cite njun tip. \\[2mm]
    \textbf{Re"sitev:} I"s"cemo re"sitve ena"cbe $f(x) = x$. Problem je ekvivalenten iskanju ni"cel funkcije
    $g(x) = f(x)-x = 2x\ee^{-x}+\frac{1}{2}-x$. Le-te npr.~ poi"s"cemo z uporabo Newtonove metode
    $$
      x_{n+1} = x_n - \frac{g(x_n)}{g'(x_n)},
    $$
    kjer je odvod $g'(x) = 2\ee^{-x}(1-x)-1$. Za za"cetna pribli"zka vzemimo npr.~ $x_0^1 = 0$ in $x_0^2 = 2$.
    Sledi:
    $$
      x_0^1 = 0, \quad x_1^1 = -0.5, \quad x_2^1 = -0.33561, \quad x_3^1 = -0.29787, \quad x_4^1 = -0.29603
    $$
    in
    $$
      x_0^2 = 2, \quad x_1^2 = 1.24555, \quad x_2^2 = 1.22044, \quad x_3^2 = 1.22032.
    $$
    Ker je $f'(x) = 2\ee^{-x}(1-x)$ in $|f'(-0.29603)| = 3.48505 > 1$, je negibna to"cka $\hat{x}_1 = -0.29603$
    odbojna, medtem ko je to"cka $\hat{x}_2 = 1.22032$ privla"cna, saj je $|f'(1.22032)| = 0.130049 < 1$.
\end{enumerate}

\end{document}
