Ejemplo Polinomios de Legendre - ific.uv.esific.uv.es/~vicente/physics/teaching/Legendre.pdf ·...

Post on 06-Jun-2018

223 views 0 download

Transcript of Ejemplo Polinomios de Legendre - ific.uv.esific.uv.es/~vicente/physics/teaching/Legendre.pdf ·...

Ejemplo Polinomios de Legendre

Tomamos una función

f@x_D = Sin@3 xD + Sqrt@2 + xDx + 2 + sinH3 xL

Plot@f@xD, 8x, -2, 2<D

-2 -1 1 2

0.5

1.0

1.5

2.0

2.5

Sabemos que

f[x]=S aL PLHxL dónde aL = H2 L + 1L �2 Ù-1

1f HxL PLHxL â x

a@L_D :=H2 L + 1L

-1

1

f@xD LegendreP@L, xD âx

8a@0D, a@1D, a@2D< �� N

81.39872, 1.3978, -0.0316861<For@i = 0, i < 20, i++, aa@iD = a@iD �� N; Print@aa@iDDD

1.39872

1.3978

-0.0316861

-1.05932

-0.000959976

0.180572

-0.0000435402

-0.0123628

-2.28268´10-6

0.000460618

-1.2903´10-7

-0.0000107173

-7.67854´10-9

1.74448´10-7

-1.1394´10-9

-1.15484´10-7

0.

0.

0.

-0.00238037

Aproximacion de M términos.

Aprox@M_, x_D := âL=0

M

aa@LD LegendreP@L, xD

Aprox@3, xD-0.529658 I5 x

3- 3 xM - 0.0158431 I3 x

2- 1M + 1.3978 x + 1.39872

2 Legendre.nb

Ap0

Plot@8f@xD, Aprox@0, xD<, 8x, -2, 2<, PlotStyle ® 88Thick, Green<, 8Thick, Red<<D

-2 -1 1 2

0.5

1.0

1.5

2.0

2.5

Ap1

Plot@8f@xD, Aprox@1, xD<, 8x, -2, 2<, PlotStyle ® 88Thick, Green<, 8Thick, Red<<D

-2 -1 1 2

-1

1

2

3

4

Legendre.nb 3

Ap3

Plot@8f@xD, Aprox@3, xD<, 8x, -2, 2<, PlotStyle ® 88Thick, Green<, 8Thick, Red<<D

-2 -1 1 2

-2

2

4

6

Ap9

Plot@8f@xD, Aprox@9, xD<, 8x, -2, 2<, PlotStyle ® 88Thick, Green<, 8Thick, Red<<D

-2 -1 1 2

-2

-1

1

2

3

4

4 Legendre.nb

Ap19

Plot@8f@xD, Aprox@19, xD<, 8x, -3, 3<, PlotStyle ® 88Thick, Green<, 8Thick, Red<<D

-3 -2 -1 1 2 3

-4

-2

2

4

6

App19-cerca

Plot@8f@xD, Aprox@19, xD<, 8x, -1.1, 1.1<, PlotStyle ® 88Thick, Green<, 8Thick, Red<<D

-1.0 -0.5 0.5 1.0

0.5

1.0

1.5

2.0

2.5

3.0

Legendre.nb 5