Approximate $f(t) = 1-|2t-5|$ in $[2,3]$ by $p\in P_2$ by using the least squares method

62 Views Asked by At

Approximate $f(t) = 1-|2t-5|$ in $[2,3]$ by $p\in P_2$ by using the least squares method in respect to $\langle f,g\rangle = \int_2^3 f(x)g(x) \ dx$ (use the Legendre polynomials)

I think I need to project $p$ onto the subspace generated by $f(t)$ but I don't know how to do this because I should do

$$\langle p-f(t),something\rangle$$

Or should I do $\langle f(t)-p,1\rangle=0, \langle f(t)-p,t\rangle=0, \langle f(t)-p,t²\rangle=0$?

Can somebody give me a ligth?

1

There are 1 best solutions below

6
On BEST ANSWER

If you are due to use Legendre polynomials, you have to

  • change the working interval :

Instead of $t \in [2,3]$, take variable $T \in [-1,1]$

using coordinates change

$$T=2t-5 \tag{1}$$

Meanwhile, expression $f(t)$ is changed into expression $F(T)=1-|T|.$

  • compute coefficients $$a_k=\dfrac{2k+1}{2}\int_{-1}^{1}F(T)L_k(T)dT \ \ k=0,1,2$$

Then, the looked for quadratic $Q(T)$ is the beginning of the infinite expansion limited to its 3 first terms : $$F(T)=\underbrace{a_0L_0(T)+a_1L_1(T)+a_2L_2(T)}_{Q(T)}+...$$

(see https://en.wikipedia.org/wiki/Legendre_polynomials).

You should find $a_0=\tfrac12, a_1=0, a_2=-\tfrac58$, giving

$$Q(T)=\tfrac12-\tfrac{5}{16}(3T^2-1)$$

which is indeed very satisfactory (see Fig. 1).

  • It remains to do the "return path", i.e., express the result as a quadratic $q(t)$ with respect to initial variable using (1) :

$$q(t)=\tfrac12-\tfrac{5}{16}(3(2t-5)^2-1)$$

(best quadratic approximation).

enter image description here

Fig. 1 : In red (resp. blue), curve with equation $Y=F(T)$ (resp. $Y=Q(T)$, its best quadratic approximation) on reference interval $[-1,1]$.