Tarea Interpolation

  • Uploaded by: Katty Sanchez
  • 0
  • 0
  • March 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tarea Interpolation as PDF for free.

More details

  • Words: 2,277
  • Pages: 10
Loading documents preview...
Asignatura

Datos del alumno

Métodos Numéricos

Apellidos y Nombre Cajamarca Jenyffer y Sanchez Marilyn

Fecha 20/12/2018

Actividades Lectura: Interpolation and Curve Fitting: Resumen y ejemplos Descripción La lectura propuesta se trata de un breve resumen de interpolación y ajuste de curvas , Leer ( Documento: Interpolation and Curve Fitting) Objetivos Son los siguientes: »

Establecer un esquema (síntesis) de la lectura,

»

Resolución de las siguientes cuestiones: 

Resolver los ejercicios propuestos del documento: Interpolation and Curve Fitting. Pag 22.



Plantear un ejemplo real aplicado a su formación.

Entrega del laboratorio La entrega de esta tarea: AULA VIRTUAL, será un único archivo Extensión máxima: 6 páginas (Georgia 11, interlineado 1,5) Nombre de archivo: Tarea_Interpolation_Apellidos,docx CREDITO: 10 PUNTOS

UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

EJERCICIO 1:

1.

The fuel consumption of an engine has been recorded as shown in the following table. Time, hour

Fuel, liter

1,2 1,7 1,8 2,0

0,33201 0,54739 0,60496 0,73891

If a user runs the engine for 1,55 hours, determine the estimated fuel consumption using the Newton and Lagrange interpolation methods. RESOLUCIÓN: Literal a) consumo de combustible en 1,55 horas por el método de Newton. Observación: para la resolución de este literal se utilizó la siguiente fórmula. 𝐈𝐧𝐭𝐞𝐫𝐩𝐨𝐥𝐚𝐜𝐢𝐨𝐧 𝐝𝐞 𝐍𝐞𝐰𝐭𝐨𝐧 𝑓(𝑥1 , 𝑥0 ) =

𝑓(𝑥1 ) − 𝑓(𝑥0 ) 𝑥1 − 𝑥0

𝑎0 = 𝑥0 = 0,33201 𝒇(𝒙𝟏 , 𝒙𝟎 ) =

0,54739 − 0,33201 = 0,43076 = 𝒂𝟏 1,7 − 1,2

𝒇(𝒙𝟏 , 𝒙𝟐 ) =

𝒇(𝒙𝟐 , 𝒙𝟑 ) =

0,73891 − 0,60496 = 0,66975 2,0 − 1,8

𝒇(𝒙𝟑 , 𝒙𝟏 , 𝒙𝟐 ) =

0,5757 − 0,43076 = 0,24157 = 𝒂𝟐 1,8 − 1,2

𝒇(𝒙𝟑 , 𝒙𝟏 , 𝒙𝟐 ) =

0,3135 − 0,24157 = 0,9 = 𝒂𝟑 2,0 − 1,2

𝒇(𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 ) =

0,66975 − 0,5757 = 0,3135 2,0 − 1,7

0,60496 − 0,54739 = 0,5757 1,8 − 1,7

Forma general del polinomio: 𝑃3 𝑥 = 𝑎0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + 𝑎3 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) 𝑃3 𝑥 = 0,33201 + 0,43076(𝑥 − 1,2) + 0,24157(𝑥 − 1,2)(𝑥 − 1,7) + 0,9(𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 1,8) 𝑃3 𝑥 = 0,33201 + 0,43076𝑥 − 0,5169 + 0,24157(𝑥 2 − 2,9𝑥 + 2,04) + 0,9(𝑥 2 − 2,9𝑥 + 2,04)(𝑥 − 1,8)

𝑃3 𝑥 = 0,33201 + 0,43076𝑥 − 0,51692 + 0,24157𝑥 2 − 0,7𝑥 + 0,4928 +0,9

(𝑥 3 − 2,9𝑥 2 + 2,04𝑥 − 1,8𝑥 2 + 5,22𝑥 − 3,672)

𝑷𝟑 𝒙 = 𝟎, 𝟎𝟖𝟗𝟗𝒙𝟑 − 𝟎, 𝟏𝟖𝟏𝟒𝒙𝟐 + 𝟎, 𝟑𝟖𝟒𝟏𝟔𝒙 − 𝟎, 𝟎𝟐𝟐𝟓𝟖 𝑃3 (1,55) = 0,0899(1,55)3 − 0,1814(1,55)2 + 0,38416(1,55) − 0,02258 = 0,4682 = 𝟎, 𝟒𝟕𝟐 En 1,55 horas se consume 0,472 de combustible. Literal b) consumo de combustible en 1,55 horas por el método de LaGrange. Observación: Para este literal se utilizó la siguiente fórmula para determinar el polinomio que se ajuste a función tabular. 𝑰𝒏𝒕𝒆𝒓𝒑𝒐𝒍𝒂𝒄𝒊𝒐𝒏 𝒅𝒆 𝑳𝒂𝒈𝒓𝒂𝒏𝒈𝒆

UIDAD 3 – Actividades

𝑷(𝒙) = 𝒚𝟎 𝑳𝟎 (𝒙) + 𝒚𝟏 𝑳𝟏 (𝒙) + ⋯ … … 𝒚𝒏 𝑳𝒏 (𝒙)

© Universidad Nacional de Chimborazo (UNACH)

𝑳𝟎 (𝒙) =

(𝑥 − 1,7)(𝑥 − 1,8)(𝑥 − 2) (𝑥 − 1,7)(𝑥 − 1,8)(𝑥 − 2) =− (1,2 − 1,7)(1,2 − 1,8)(1,2 − 2,0) 0,24

𝑳𝟏 (𝒙) =

(𝑥 − 1,2)(𝑥 − 1,8)(𝑥 − 2) (𝑥 − 1,2)(𝑥 − 1,8)(𝑥 − 2) = (1,7 − 1,2)(1,7 − 1,8)(1,7 − 2,0) 0,015

𝑳𝟐 (𝒙) =

(𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 2) (𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 2) =− (1,8 − 1,2)(1,8 − 1,7)(1,8 − 2,0) 0,012

𝑳𝟑 (𝒙) =

(𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 1,8) (𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 1,8) = (2 − 1,2)(2 − 1,7)(2 − 1,8) 0,048

𝑷𝟑 (𝒙) = 0,33201 (−

(𝑥 − 1,7)(𝑥 − 1,8)(𝑥 − 2) (𝑥 − 1,2)(𝑥 − 1,8)(𝑥 − 2) ) ) + 0,54739 ( 0,24 0,015

+ 0,60496 (−

(𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 2) (𝑥 − 1,2)(𝑥 − 1,7)(𝑥 − 1,8) ) + 0,73891 ( ) 0,012 0,048

𝑃3 (𝑥) = −1,3834[(𝑥 − 1,7)(𝑥 − 1,8)(𝑥 − 2)] + 36,4926[(𝑥 − 1,2)(𝑥 − 1,8)(𝑥 − 2)] − 50,413[(𝑥 − 1,2) (𝑥 − 1,7)(𝑥 − 2)] 𝑃3 (1,55) = −0,33201[(1,55 − 1,7)(𝑥 − 1,8)(1,55 − 2)] + 36,4926[(1,55 − 1,2)(1,55 − 1,8)(1,55 − 2)] − 50,4133[(1,55 − 1,2)(1,55 − 1,7)(1,55 − 1,8))] 𝑃3 (1,55) = 𝟎, 𝟒𝟕𝟏𝟐 En 1,55 el consume de combustible es o,4712 Conclusión: El resultado obtenido fue que en 1,55 horas se consume 0,47 de combustible, para la resolución de este ejercicio se pudo determinar que el método de Newton es más extenso de realizarlo, pero el más exacto para obtener el polinomio, y que el método de LaGrange fue un método más rápido de realizarlo. Los dos métodos arrojaron el resultado deseado, con un error mínimo comparado entre los dos resultados.

2.

The following data shows the height function of a hill a distance x from a reference, Form a cubic polynomial via regression, Also, calculate the corresponding standard deviation, 𝒙𝒊 𝒉𝒊

0 4

1 5

2 10

3 17

4 21

5 16

6 11

7 3

8 1

RESOLUCIÓN: Para n = 3; Polinomio de 3𝑒𝑟 grado, 𝑒𝑐𝑢𝑎𝑐𝑖𝑜𝑛 𝑔𝑒𝑛𝑒𝑟𝑎𝑙 𝑑𝑒𝑙 𝑝𝑜𝑙𝑖𝑛𝑜𝑚𝑖𝑜 𝑑𝑒 𝑟𝑒𝑔𝑟𝑒𝑠𝑖ó𝑛: 𝒇(𝒙) = 𝒂𝟎 + 𝒂𝟏𝒙 + 𝒂𝟐𝒙𝟐 + 𝒂𝟑𝒙𝟑 Para obtener 𝑥𝑖 ∑ 𝑥𝑖 = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36 ∑ 𝑥𝑖 2 = 0 + 1 + 4 + 9 + 16 + 25 + 36 + 49 + 64 = 204 ∑ 𝑥𝑖 3 = 0 + 1 + 8 + 27 + 64 + 125 + 216 + 343 + 512 = 1296 UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

∑ 𝑥𝑖 4 = 0 + 1 + 16 + 81 + 256 + 625 + 1296 + 2401 + 4096 = 8772 ∑ 𝑥𝑖 5 = 0 + 1 + 32 + 243 + 1024 + 3125 + 7776 + 16807 + 32768 = 61776 ∑ 𝑥𝑖 6 = 0 + 1 + 64 + 729 + 4096 + 15625 + 46656 + 117649 + 262144 = 446964 ∑ 𝑦𝑖 = 4 + 5 + 10 + 17 + 21 + 16 + 11 + 3 + 1 = 88 ∑ 𝑥𝑖 𝑦𝑖 = 0 + 5 + 20 + 51 + 84 + 80 + 66 + 21 + 8 = 335 ∑ 𝑥𝑖 2 𝑦𝑖 = 0 + 5 + 46 + 153 + 336 + 400 + 396 + 147 + 64 = 1541 ∑ 𝑥𝑖 3 𝑦𝑖 = 0 + 5 + 80 + 459 + 1344 + 2000 + 2376 + 1029 + 512 = 7805 ∑ 𝑥𝑖 4 𝑦𝑖 = 0 + 5 + 160 + 1377 + 5376 + 10000 + 14256 + 7203 + 81 = 38458 De la siguiente tabla: ∑ 𝑦𝑖 = 36

𝑁=9

∑ 𝑥𝑖 2 = 204

∑ 𝑦𝑖 = 88

∑ 𝑥𝑖 3 = 1296

∑ 𝑥𝑖 𝑦𝑖 = 335

∑ 𝑥𝑖 4 = 8772

∑ 𝑥𝑖 2 𝑦𝑖 = 1541

∑ 𝑥𝑖 5 = 61776

∑ 𝑥𝑖 3 𝑦𝑖 = 7805

∑ 𝑥𝑖 6 = 446964

∑ 𝑥𝑖 4 𝑦𝑖 = 38458

Ecuación matricial 9 36 36 204 204 1296 1296 8772

204 1906 1296 8772 8772 61776 61776 446964

*

𝑎0 𝑎1 𝑎2 𝑎3

=

88 335 1541 7805

Observación: para la resolución de este ejercicio se utilizó el método de eliminación ejecutado el programa Matlab. (Ver anexo ELIMINACIONGAUSS.m ) 𝑎0 = 1,7374

𝑎1 = 6,9927

𝑎2 = −0,7082

𝑎3 = −0,0269

Polinomio de tercer grado. 𝒇(𝒙) = 𝟏, 𝟕𝟑𝟕𝟒 + 𝟔, 𝟗𝟗𝟐𝟕𝒙 − 𝟎, 𝟕𝟎𝟖𝟐𝒙𝟐 − 𝟎, 𝟎𝟐𝟔𝟗𝒙𝟑 Desviación en 𝑃(2 ; 10) 𝑒𝑖 = 𝑦𝑖 − 𝑓(𝑥𝑖 ) = 𝑦𝑖 − 𝑎0 − 𝑎1 𝑥𝑖 − 𝑎2 𝑥 2 𝑖 − 𝑎3 𝑥 3 𝑖 𝑒𝑖 = 10 − 12.66 = −𝟐. 𝟔𝟔 𝑁

𝑆 = ∑ 𝑒 2 = (−2.66)2 = 𝟕. 𝟎𝟕 𝑖=3

UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

𝜎=√

5 5 =√ = 𝟏. 𝟎𝟎𝟓 𝑁−𝑛+1 9−3+1

Conclusión: este método fue el más extenso de realizarlo, sin embargo arrojo los datos deseados. The following data represents temperature distribution T(x,y) in a metal plate:

3.

y coordinate

x coordinate

Temperatu r e T(x,y)

0,5

1,0

1,5

2,0

0,5

7,51

10,05

12,70

15,67

1,0

10,00

10,00

10,00

10,00

1,5

12,51

9,95

7,32

4,33

2,0

15,00

10,00

5,00

0,00

Estimate the temperature at the coordinate (x, y) = (1,15, 1,42) using:

a.

the Newton linear interpolation,

𝒇𝟏 (𝒙) = 𝒇𝒙𝟎 + 𝑃𝑎𝑟𝑎 𝑥0 𝑥1 𝑥2 𝑥3

𝑥 = 0,5 j 𝑦𝑖 0 0,5 1 1 2 1,5 3 2

(𝒇(𝒙𝟏 ) − 𝒇(𝒙𝟎 ) 𝒙 ∗ (𝒚 − 𝒚 ) 𝒙𝟏 − 𝒙𝟎 𝟎

𝑓(0,5: 𝑦) 7,51 10,05 12,7 15,67

(𝒇(𝒙𝟏 ) − 𝒇(𝒙𝟎 ) 15,67 − 7,51 = = 5,44 𝒙𝟏 − 𝒙𝟎 2 − 0,5 𝒇𝟏 (𝒙) = 𝒇𝒙𝟎 +

(𝒇(𝒙𝟏 ) − 𝒇(𝒙𝟎 ) 𝒙 ∗ (𝒚 − 𝒚 ) 𝒙𝟏 − 𝒙𝟎 𝟎

15,67 − 7,51 ) (𝑥 − 0,5) 7,51 + ( 2 − 0,5 𝑓1 (𝑦) = 7,51 + 5,44 (𝑦 − 0,5) 𝑓1 (1,42) = 7,51 + 5,44 (𝑦 − 0,5) 𝑓1 (1,42) = 12,514 𝑃𝑎𝑟𝑎 𝑥 = 1 𝑆 0 1 2 3

𝑦𝑗 0,5 1 1,5 2

𝑓(1; 𝑦) 10 10 10 10

UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

𝑓(𝑥0 ) + (

10 − 10 ) (𝑥 − 10) 2 − 0,5

10 − 0 𝑓1 (1; 1,42) = 10 𝑃𝑎𝑟𝑎 𝑥 = 1,5 𝑗 𝑦𝑗 𝑓(1; 𝑦) 0 0,5 12,51 1 1 9,95 2 1,5 7,32 3 2 4,33 4,33 − 12,51 = −5,45 2 − 0,5 𝑓1 (𝑥) = 12,51 − 5,45(𝑦 − 0,5) 𝑓1 (𝑥}1,5; 1,42) = 7,496 𝑃𝑎𝑟𝑎 𝑥 = 2 0,5 15 1

10

1,5

5

2

0

0 − 15 = −10 2 − 0,5 𝑓1 (𝑥) = 15 − 10 (𝑥 − 0,5) 𝑓1 (2; 1,41) = 15 − 10 (1,42 − 0,5) 𝑓1 (2; 1,42) = 5,8 𝑃𝑎𝑟𝑎 𝑦 = 1,42 𝑖 𝑥𝑖 0 0,5 1 1 2 1,5 3 2

𝑓(𝑥𝑖 ; 1,42) 12,51 10 7,496 5,8

12,51 − 5,8 ) = 4,47 2 − 0,5 𝑓(𝑥1 ) − 𝑓(𝑥0 ) (𝑦 − 𝑦0 ) 𝑓1 (𝑥) = 𝑓(𝑥0 ) + 𝑥1 − 𝑥0 𝑓1 (𝑥) = 12,51 + 4,47(𝑥 − 0,5) 𝑓1 (1,15; 1,42) = 15,4 (

b.

the Newton cubic interpolation,

𝑷𝒂𝒓𝒂 𝒙 = 𝟎, 𝟓 𝑗 0 1 2

𝑦𝑖 0,5 1 1,5

𝑓(0,5 ; 𝑦𝑖 ) 7,51 10,05 12,70

UIDAD 3 – Actividades

I 5,08 5,3 5,94

II 0,22 0,64

II 0,28

© Universidad Nacional de Chimborazo (UNACH)

3

2

15,67

𝑓(0,5 ; 𝑦𝑖 ) = 7,51 + 5,08(𝑦 − 0,5) + 0,22(𝑦 − 0,5)(𝑦 − 1) + 0,28(𝑦 − 0,5)(𝑦 − 1)(𝑦 − 1,5) 𝑓(0,5 ; 1,42) = 7,51 + 5,08(𝑦 − 0,5) + 0,22(𝑦 − 0,5)(𝑦 − 1) + 0,28(𝑦 − 0,5)(𝑦 − 1)(𝑦 − 1,5) 𝑓(0,5 ; 1,42) = 𝟏𝟐, 𝟐𝟓 𝑷𝒂𝒓𝒂 𝒙 = 𝟏 𝑗 0 1 2 3

𝑦𝑖 0,5 1 1,5 2

𝑓(1 ; 𝑦𝑖 ) 10 10 10 10

I 0 0 0

II 0 00

II 0

𝑓(1 ; 𝑦𝑖 ) = 10 + 0(𝑦 − 0,5) + 0(𝑦 − 0,5)(𝑦 − 1) + 0(𝑦 − 0,5)(𝑦 − 1)(𝑦 − 1,5) 𝑓(1 ; 1,42) = 𝟏𝟎 𝑷𝒂𝒓𝒂 𝒙 = 𝟏, 𝟓 𝑗 0 1 2 3

𝑦𝑖 0,5 1 1,5 2

𝑓(1,5 ; 𝑦𝑖 ) 12,51 9,95 7,32 4,33

I -5,12 -5,26 -5,98

II -0,14 -0,72

II -0,39

𝑓(1,5 ; 𝑦𝑖 ) = 12,51 − 5,12(𝑦 − 0,5) − 0,14(𝑦 − 0,5)(𝑦 − 1) − 0,39(𝑦 − 0,5)(𝑦 − 1)(𝑦 − 1,5) 𝑓(1,5 ; 1,42) = 12,51 − 5,12(1,42 − 0,5) − 0,14(1,42 − 0,5)(1,42 − 1) − 0,39(1,42 − 0,5) (1,42 − 1)(1,42 − 1,5) 𝑓(1,5 ; 1,42) = 𝟕, 𝟕𝟔 𝑷𝒂𝒓𝒂 𝒙 = 𝟐 𝑗 0 1 2 3

𝑦𝑖 0,5 1 1,5 2

𝑓(0,5 ; 𝑦𝑖 ) 15 10 5 0

I -10 -10 -10

II 0 0

II 0

𝑓(2 ; 𝑦𝑖 ) = 15 − 10(𝑦 − 0,5) + 0(𝑦 − 0,5)(𝑦 − 1) + 0(𝑦 − 0,5)(𝑦 − 1)(𝑦 − 1,5) 𝑓(2 ; 1,42) = 15 − 10(1,42 − 0,5) 𝑓(2 ; 1,42) = 𝟓, 𝟖 𝑗 0 1 2 3

𝑦𝑖 0,5 1 1,5 2

𝑓(1,42 ; 𝑦𝑖 ) 12,25 10 7,76 5,8

I -4,5 -4,48 -3,92

II 0,02 0,56

II 0,36

𝑓3 (𝑥) = 12,25 − 4,5(𝑦 − 0,5) + 0,02(𝑦 − 0,5)(𝑦 − 1) + 0,36(𝑦 − 0,5)(𝑦 − 1)(𝑦 − 1,5) 𝑓3 (1,15 ; 1,42) = 12,25 − 4,5(1,42 − 0,5) + 0,02(1,42 − 0,5)(1,42 − 1) + 0,36(1,42 − 0,5) (1,42 − 1)(1,42 − 1,5) (1,15 𝑓3 ; 1,42) = 𝟗, 𝟑𝟏 𝑹𝒕𝒂 Conclusion: las respuestas obtenidas son diferentes debido al polinomio usado en cada caso, por lo que se puede decir qeu el metodo cubico de newton es el mas apropiado para la resolucion de ejercicios ya que arroja los resultados mas exactos. UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

Plantear un ejemplo real aplicado a su formación: 

En la siguiente tabla se presentan los alargamientos de un resorte correspondientes a fuerzas de diferente magnitud que lo deforma

Determine por el método de Newton el mejor polinomio de 3 grado que represente la función dada,

UIDAD 3 – Actividades

© Universidad Nacional de Chimborazo (UNACH)

Related Documents

Tarea Interpolation
March 2021 1
Tarea
February 2021 5
Tarea 2 Filosofia Tarea
February 2021 3
Tarea
February 2021 5

More Documents from "hunterfdo"

Tarea Interpolation
March 2021 1
March 2021 0
March 2021 0
March 2021 0