| 1 |
\subsection{Interpolation} |
| 2 |
|
| 3 |
Il s'agit ici de trouver un polynôme d'interpolation sur l'intervalle $[-1~;~1]$ de la fonction $f$ définie par : |
| 4 |
\[ |
| 5 |
f(x)=\frac{1}{1+8x^2} |
| 6 |
\] |
| 7 |
|
| 8 |
Le polynôme d'interpolation est celui obtenu par la méthode de \tkzimp{Lagrange} : |
| 9 |
\begin{equation*} |
| 10 |
\begin{split} |
| 11 |
P(x) = &1.000000000-0.0000000072x-7.991424876x^2+0.000001079x^3+62.60245358x^4\\ |
| 12 |
& -0.00004253x^5-444.2347594x^6+0.0007118x^7+ 2516.046396x^8 -0.005795x^9\\ &-10240.01777x^{10} +0.025404x^{11}+28118.29594x^{12} -0.05934x^{13} -49850.83249x^{14} \\ |
| 13 |
& +0.08097x^{15}+54061.87086x^{16} -0.055620x^{17} -32356.67279x^{18} +0.015440x^{19}\\ |
| 14 |
&+8140.046421x^{20}\\ |
| 15 |
\end{split} |
| 16 |
\end{equation*} |
| 17 |
|
| 18 |
Ayant utilisé vingt et un points, le polynôme est de degré $20$. Celui-ci est écrit en utilisant la méthode de \tkzimp{Horner}. Dans un premier temps, on demande à gnuplot de tracer la courbe de f en rouge, enfin on trace le polynôme d'interpolation en bleu. Les points utilisés sont en jaune. |
| 19 |
|
| 20 |
\subsubsection{Le code} |
| 21 |
\begin{tkzexample}[code only] |
| 22 |
\begin{tikzpicture} |
| 23 |
\tkzInit[xmin=-1,xmax=1,ymin=-1.8,ymax=1.2,xstep=0.1,ystep=0.2] |
| 24 |
\tkzGrid |
| 25 |
\tkzAxeXY |
| 26 |
\tkzFct[samples = 400, line width=4pt, color = red,opacity=.5](-1---1){1/(1+8*\x*\x)} |
| 27 |
\tkzFct[smooth,samples = 400, line width=1pt, color = blue,domain =-1:1]% |
| 28 |
{1.0+(((((((((((((((((((( |
| 29 |
8140.04642)*\x |
| 30 |
+0.01544)*\x |
| 31 |
-32356.67279)*\x |
| 32 |
-0.05562)*\x |
| 33 |
+54061.87086)*\x |
| 34 |
+0.08097)*\x |
| 35 |
-49850.83249)*\x |
| 36 |
-0.05934)*\x |
| 37 |
+28118.29594)*\x |
| 38 |
+0.02540)*\x |
| 39 |
-10240.01777)*\x |
| 40 |
-0.00580)*\x |
| 41 |
+2516.04640)*\x |
| 42 |
+0.00071)*\x |
| 43 |
-444.23476)*\x |
| 44 |
-0.00004)*\x |
| 45 |
+62.60245)*\x |
| 46 |
+0.00000)*\x |
| 47 |
-7.99142)*\x |
| 48 |
-0.00000)*\x} |
| 49 |
\tkzSetUpPoint[size=16,color=black,fill=yellow] |
| 50 |
\foreach \v in {-1,-0.8,---.,1}{\tkzDefPointByFct[draw](\v)} |
| 51 |
\end{tikzpicture} |
| 52 |
\end{tkzexample} |
| 53 |
|
| 54 |
Le résultat est sur la page suivante où on peut constater le phénomène de \tkzimp{Runge}. |
| 55 |
\subsubsection{la figure} |
| 56 |
|
| 57 |
\begin{sidewaysfigure}[htbp] |
| 58 |
\centering |
| 59 |
\begin{tikzpicture}[scale=.75] |
| 60 |
\tkzInit[xmin=-1,xmax=1,ymin=-1.8,ymax=1.2,xstep=0.1,ystep=0.2] |
| 61 |
\tkzGrid |
| 62 |
\tkzAxeXY |
| 63 |
\tkzFct[samples = 400, line width=4pt, color = red,opacity=.5,domain =-1:1]% |
| 64 |
{1/(1+8*\x*\x)} |
| 65 |
\tkzFct[samples = 400, line width=1pt, color = blue,domain =-1:1]% |
| 66 |
{1.0+ |
| 67 |
(((((((((((((((((((( |
| 68 |
8140.04642)*\x |
| 69 |
+0.01544)*\x |
| 70 |
-32356.67279)*\x |
| 71 |
-0.05562)*\x |
| 72 |
+54061.87086)*\x |
| 73 |
+0.08097)*\x |
| 74 |
-49850.83249)*\x |
| 75 |
-0.05934)*\x |
| 76 |
+28118.29594)*\x |
| 77 |
+0.02540)*\x |
| 78 |
-10240.01777)*\x |
| 79 |
-0.00580)*\x |
| 80 |
+2516.04640)*\x |
| 81 |
+0.00071)*\x |
| 82 |
-444.23476)*\x |
| 83 |
-0.00004)*\x |
| 84 |
+62.60245)*\x |
| 85 |
+0.00000)*\x |
| 86 |
-7.99142)*\x |
| 87 |
-0.00000)*\x} |
| 88 |
\tkzSetUpPoint[size=8,color=black,fill=yellow] |
| 89 |
\foreach \v in {-1,-0.8,---.,1}% |
| 90 |
{\tkzDefPointByFct[draw](\v)} |
| 91 |
\end{tikzpicture} |
| 92 |
\caption{Interpolation : $\dfrac{1}{1+8x^2}$} |
| 93 |
\end{sidewaysfigure} |
| 94 |
|
| 95 |
\endinput |
| 96 |
|