Interpolation & Curve Fitting(Numerical Method)

Lagrange Form

$$(-2,21),(1,6),(3,26),(2,13)$$

Find the interpolating polynomial of these points in the Lagrange Form

Solution:

$$\color{fuchsia}{(-2,21)},(\color{orange}{1},6),(\color{orange}{3},26),(\color{orange}{2},13)$$

$$\text{Lagrange form for }(-2,21)=\color{fuchsia}{21}\frac{(x-\color{orange}{1})(x-\color{orange}{3})(x-\color{orange}{2})}{(\color{fuchsia}{-2}-\color{orange}{1})(\color{fuchsia}{-2}-\color{orange}{3})(\color{fuchsia}{-2}-\color{orange}{2})}$$

$$(\color{orange}{-2},21),\color{fuchsia}{(1,6)},(\color{orange}{3},26),(\color{orange}{2},13)$$

$$\text{Lagrange form for }(1,6)=\color{fuchsia}{6}\frac{(x-\color{orange}{(-2)})(x-\color{orange}{3})(x-\color{orange}{2})}{(\color{fuchsia}{1}-\color{orange}{(-2)})(\color{fuchsia}{1}-\color{orange}{3})(\color{fuchsia}{1}-\color{orange}{2})}$$

$$(\color{orange}{-2},21),(\color{orange}{1},6),\color{fuchsia}{(3,26)},(\color{orange}{2},13)$$

$$\text{Lagrange form for }(3,26)=\color{fuchsia}{26}\frac{(x-\color{orange}{(-2)})(x-\color{orange}{1})(x-\color{orange}{2})}{(\color{fuchsia}{3}-\color{orange}{(-2)})(\color{fuchsia}{3}-\color{orange}{1})(\color{fuchsia}{3}-\color{orange}{2})}$$

$$(\color{orange}{-2},21),(\color{orange}{1},6),(\color{orange}{3},26),\color{fuchsia}{(2,13)}$$

$$\text{Lagrange form for }(2,13)=\color{fuchsia}{13}\frac{(x-\color{orange}{(-2)})(x-\color{orange}{1})(x-\color{orange}{3})}{(\color{fuchsia}{2}-\color{orange}{(-2)})(\color{fuchsia}{2}-\color{orange}{1})(\color{fuchsia}{2}-\color{orange}{3})}$$


Lagrange Form:

$$P(x)=21\frac{(x-1)(x-3)(x-2)}{(-2-1)(-2-3)(-2-2)}+6\frac{(x+2)(x-3)(x-2)}{(1+2)(1-3)(1-2)}+26\frac{(x+2)(x-1)(x-2)}{(3+2)(3-1)(3-2)}+13\frac{(x+2)(x-1)(x-3)}{(2+2)(2-1)(2-3)}$$

**To obtain Natural Form, expand the Lagrange Form



Newton Form

$$y(x)=\sin({\frac{\pi x}{2}})$$

Write the interpolating polynomial in Newton Form for $x=1,2,3,4$


$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&0 &0\\1 & 1 & 1 & \frac{y_1-y_0}{x_1-x_0}=\frac{1-0}{1-0}=1\\2 & 2 & 0 & \frac{y_2-y_1}{x_2-x_1}=\frac{0-1}{2-1}=-1 \\ 3 & 3& -1 & \frac{y_3-y_2}{x_3-x_2}=\frac{-1-0}{3-2}=-1\\4&4&0&\frac{y_4-y_3}{x_4-x_3}=\frac{0-(-1)}{4-3}=1\end{array}$$
$$\downarrow$$
$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&0 &0\\1 & 1 & 1 & \color{fuchsia}{1}\\2 & 2 & 0 & \color{orange}{-1} & \frac{\color{orange}{-1}-\color{fuchsia}{1}}{x_2-x_0}=\frac{-1-1}{2-0}=-1 \\ 3 & 3& -1 & \color{yellow}{-1} & \frac{\color{yellow}{-1}-\color{orange}{(-1)}}{x_3-x_1}=\frac{-1-(-1)}{3-1}=0\\4&4&0&\color{pink}{1} & \frac{\color{pink}{1}-\color{yellow}{(-1)}}{x_4-x_2}=\frac{1-(-1)}{4-2}=1\end{array}$$
$$\downarrow$$
$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&0 &0\\1 & 1 & 1 & 1\\2 & 2 & 0 &-1 & \color{fuchsia}{-1} \\ 3 & 3& -1 & -1 & \color{orange}{0} & \frac{\color{orange}{0}-\color{fuchsia}{(-1)}}{x_3-x_0}=\frac{0-(-1)}{3-0}=\frac{1}{3}\\4&4&0&1 & \color{yellow}{1}& \frac{\color{yellow}{1}-\color{orange}{0}}{x_4-x_0}=\frac{1-0}{4-1}=\frac{1}{3}\end{array}$$
$$\downarrow$$
$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&0 &0\\1 & 1 & 1 & 1\\2 & 2 & 0 &-1 & -1 \\ 3 & 3& -1 & -1 & 0 & \color{fuchsia}{\frac{1}{3}}\\4&4&0&1 & 1& \color{orange}{\frac{1}{3}} & \frac{\color{orange}{\frac{1}{3}}-\color{fuchsia}{\frac{1}{3}}}{x_4-x_0}=\frac{\frac{1}{3}-\frac{1}{3}}{4-0}=0\end{array}$$
$$\downarrow$$
$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&0 &0\\1 & 1 & 1 & 1\\2 & 2 & 0 &-1 & -1 \\ 3 & 3& -1 & -1 & 0 & \frac{1}{3}\\4&4&0&1 & 1& \frac{1}{3} & 0\end{array}$$

**Newton Form can have two forms: Newton Forward Divided-Differences and Newton Backward Divided-Differences**


  • Newton Forward Divided-Differences
$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&\color{red}{0} &\color{lime}{0}\\1 & \color{red}{1} & 1 & \color{lime}{1}\\2 & \color{red}{2} & 0 &-1 & \color{lime}{-1} \\ 3 & \color{red}{3}& -1 & -1 & 0 & \color{lime}{\frac{1}{3}}\\4&4&0&1 & 1& \frac{1}{3} & \color{lime}{0}\end{array}$$

$$\begin{align}P(x) = \color{lime}{0}&+(\color{lime}{1})(x-\color{red}{0})\\&+(\color{lime}{-1})(x-\color{red}{1})(x-\color{red}{0})\\&+(\color{lime}{\frac{1}{3}})(x-\color{red}{2})(x-\color{red}{1})(x-\color{red}{0})\\&+(\color{lime}{0})(x-\color{red}{3})(x-\color{red}{2})(x-\color{red}{1})(x-\color{red}{0}) \end{align}$$



  • Newton Backward Divided-Differences
$$\begin{array}{c|cc|cccc}i & x_i& y_i\\\hline 0&0 &0\\1 & \color{red}{1} & 1 & 1\\2 & \color{red}{2} & 0 &-1 &-1 \\ 3 & \color{red}{3}& -1 & -1 & 0 & \frac{1}{3}\\4&\color{red}{4}&\color{lime}{0}&\color{lime}{1} & \color{lime}{1}& \color{lime}{\frac{1}{3}} & \color{lime}{0}\end{array}$$

$$\begin{align}P(x) = \color{lime}{0}&+(\color{lime}{1})(x-\color{red}{4})\\&+(\color{lime}{1})(x-\color{red}{4})(x-\color{red}{3})\\&+(\color{lime}{\frac{1}{3}})(x-\color{red}{4})(x-\color{red}{3})(x-\color{red}{2})\\&+(\color{lime}{0})(x-\color{red}{4})(x-\color{red}{3})(x-\color{red}{2})(x-\color{red}{1}) \end{align}$$


Hermite Interpolation

$$\begin{array}{c|c|c}x_k & y_k & y'_k\\\hline 8.3 & 17.56492 & 3.116256\\ 8.6 & 18.50515 & 3.151762\end{array}$$

Construct an approximating Hermite polynomial for the above specification.

Solution:

$$\begin{array}{c|c|c}x_k & y_k & y'_k\\\hline 8.3 & 17.56492\\8.3 & 17.56492 & 3.116256\\8.6 & 18.50515 & \frac{18.50515-17.56492}{8.6-8.3}=3.1341\\ 8.6 & 18.50515 & 3.151762\end{array}$$
$$\downarrow$$
$$\begin{array}{c|c|c}x_k & y_k & y'_k\\\hline 8.3 & 17.56492\\8.3 & 17.56492 & 3.116256\\8.6 & 18.50515 & 3.1341 & \frac{3.1341-3.116256}{8.6-8.3}=0.05948\\ 8.6 & 18.50515 & 3.151762 & \frac{3.151762-3.1341}{8.6-8.3}=0.058873\end{array}$$
$$\downarrow$$
$$\begin{array}{c|c|c}x_k & y_k & y'_k\\\hline 8.3 & 17.56492\\8.3 & 17.56492 & 3.116256\\8.6 & 18.50515 & 3.1341 & 0.05948\\ 8.6 & 18.50515 & 3.151762 & 0.058873 & \frac{0.058873-0.05948}{8.6-8.3}=-0.0020222\end{array}$$
$$\downarrow$$
$$\begin{array}{c|c|c}x_k & y_k & y'_k\\\hline 8.3 & 17.56492\\8.3 & 17.56492 & 3.116256\\8.6 & 18.50515 & 3.1341 & 0.05948\\ 8.6 & 18.50515 & 3.151762 & 0.058873 & -0.0020222\end{array}$$

Hermit Polynomial
$$\begin{array}{c|c|c}x_k & y_k & y'_k\\\hline \color{red}{8.3} & \color{lime}{17.56492}\\\color{red}{8.3} & 17.56492 & \color{lime}{3.116256}\\\color{red}{8.6} & 18.50515 & 3.1341 & \color{lime}{0.05948}\\ 8.6 & 18.50515 & 3.151762 & 0.058873 & \color{lime}{-0.0020222}\end{array}$$

$$\begin{align}H(x) = \color{lime}{17.56492}&+(\color{lime}{3.116256})(x-\color{red}{8.3})\\&+(\color{lime}{0.05948})(x-\color{red}{8.3})(x-\color{red}{8.3})\\&+(\color{lime}{-0.020222})(x-\color{red}{8.3})(x-\color{red}{8.3})(x-\color{red}{8.6})\\\end{align}$$

Comments

Popular Posts