使用Legendre正交多项式求f(x)=ex在[1, 2]上的三次最佳平方逼近多项式
时间: 2024-05-27 17:07:46 浏览: 106
首先,我们需要将f(x)在[1,2]上进行Legendre正交化。Legendre多项式的正交性质如下:
$$\int_{-1}^{1}P_n(x)P_m(x)dx = \frac{2}{2n+1}\delta_{nm}$$
其中,$\delta_{nm}$为Kronecker delta,等于当$n=m$时为1,否则为0。
在[1,2]上进行Legendre正交化,我们需要将其映射到[-1,1]上,即令$y = \frac{2x-3}{1}$,得到:
$$\int_{1}^{2}f(x)P_n(\frac{2x-3}{1})dx = \int_{-1}^{1}f(\frac{y+3}{2})P_n(y)dy$$
我们要求的是三次最佳平方逼近多项式,因此我们需要用到前四个Legendre多项式($n=0,1,2,3$)来逼近f(x),即:
$$f(x) \approx c_0P_0(\frac{2x-3}{1}) + c_1P_1(\frac{2x-3}{1}) + c_2P_2(\frac{2x-3}{1}) + c_3P_3(\frac{2x-3}{1})$$
其中,$c_0,c_1,c_2,c_3$为待求系数。
将上式代入到正交性质中,得到:
$$\int_{-1}^{1}f(\frac{y+3}{2})P_n(y)dy \approx c_0\int_{-1}^{1}P_0(y)P_n(y)dy + c_1\int_{-1}^{1}P_1(y)P_n(y)dy + c_2\int_{-1}^{1}P_2(y)P_n(y)dy + c_3\int_{-1}^{1}P_3(y)P_n(y)dy$$
令$y = \frac{2x-3}{1}$,得到:
$$\int_{1}^{2}f(x)P_n(\frac{2x-3}{1})dx \approx c_0\int_{-1}^{1}P_0(y)P_n(y)dy + c_1\int_{-1}^{1}P_1(y)P_n(y)dy + c_2\int_{-1}^{1}P_2(y)P_n(y)dy + c_3\int_{-1}^{1}P_3(y)P_n(y)dy$$
求解上式中的系数$c_0,c_1,c_2,c_3$,即可得到三次最佳平方逼近多项式。
根据正交性质,我们可以得到以下方程组:
$$c_0\int_{-1}^{1}P_0^2(y)dy + c_1\int_{-1}^{1}P_0(y)P_1(y)dy + c_2\int_{-1}^{1}P_0(y)P_2(y)dy + c_3\int_{-1}^{1}P_0(y)P_3(y)dy = \int_{-1}^{1}f(\frac{y+3}{2})P_0(y)dy$$
$$c_0\int_{-1}^{1}P_0(y)P_1(y)dy + c_1\int_{-1}^{1}P_1^2(y)dy + c_2\int_{-1}^{1}P_1(y)P_2(y)dy + c_3\int_{-1}^{1}P_1(y)P_3(y)dy = \int_{-1}^{1}f(\frac{y+3}{2})P_1(y)dy$$
$$c_0\int_{-1}^{1}P_0(y)P_2(y)dy + c_1\int_{-1}^{1}P_1(y)P_2(y)dy + c_2\int_{-1}^{1}P_2^2(y)dy + c_3\int_{-1}^{1}P_2(y)P_3(y)dy = \int_{-1}^{1}f(\frac{y+3}{2})P_2(y)dy$$
$$c_0\int_{-1}^{1}P_0(y)P_3(y)dy + c_1\int_{-1}^{1}P_1(y)P_3(y)dy + c_2\int_{-1}^{1}P_2(y)P_3(y)dy + c_3\int_{-1}^{1}P_3^2(y)dy = \int_{-1}^{1}f(\frac{y+3}{2})P_3(y)dy$$
代入Legendre多项式的表达式,化简上式,得到:
$$\begin{bmatrix}
2 & 0 & 0 & 0 \\
0 & \frac{2}{3} & 0 & 0 \\
0 & 0 & \frac{2}{5} & 0 \\
0 & 0 & 0 & \frac{2}{7}
\end{bmatrix}\begin{bmatrix}
c_0 \\
c_1 \\
c_2 \\
c_3
\end{bmatrix} = \begin{bmatrix}
e^{\frac{1}{2}} \\
\frac{4}{3}e^{\frac{1}{2}} \\
\frac{8}{15}e^{\frac{1}{2}} \\
\frac{16}{105}e^{\frac{1}{2}}
\end{bmatrix}$$
解上式,得到
$$c_0 = \frac{5\sqrt{2}}{16}e^{\frac{1}{2}} - \frac{5\sqrt{2}}{32}e^{\frac{3}{2}} + \frac{5\sqrt{2}}{64}e^{\frac{5}{2}}$$
$$c_1 = \frac{35\sqrt{2}}{64}e^{\frac{3}{2}} - \frac{35\sqrt{2}}{128}e^{\frac{5}{2}}$$
$$c_2 = -\frac{21\sqrt{2}}{32}e^{\frac{5}{2}}$$
$$c_3 = \frac{35\sqrt{2}}{128}e^{\frac{5}{2}}$$
因此,我们的三次最佳平方逼近多项式为:
$$f(x) \approx \frac{5\sqrt{2}}{16}e^{\frac{1}{2}}P_0(\frac{2x-3}{1}) + \frac{35\sqrt{2}}{64}e^{\frac{3}{2}}P_1(\frac{2x-3}{1}) - \frac{21\sqrt{2}}{32}e^{\frac{5}{2}}P_2(\frac{2x-3}{1}) + \frac{35\sqrt{2}}{128}e^{\frac{5}{2}}P_3(\frac{2x-3}{1})$$
阅读全文