Lista de Exercícios MMQ in MNEDO

Embed Size (px)

Citation preview

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    1/14

    Lista de exerccios ( Reviso para a A2 )

    Ex1- Dado o conjunto de pontos na Tabela 1, ajuste os dados com o modelo linear e

    quadrtico e comente os resultados e exponencial.

    Tabela 1Dados

    Interpolao

    Linear:

    Interpolao linear

    Usando os dois primeiros pontos:

    0 0 0

    1 1 1

    1

    1

    x a y

    x a y

    1 0

    1 0 0

    1 0

    1

    1

    1

    1, 9 1,81,8 0,3

    2,7 0,3

    0,11,8 0,3

    2,4

    0,04166667 1,7875

    y yP x y x x

    x x

    P x x

    P x x

    P x x

    Interpolao polinomial

    Usando os 3 primeiros pontos2

    0 00 0 0

    21 11 1 1

    22 22 2 2

    2

    ( )1

    ( )1

    ( )1

    ( )1

    n

    n

    n

    nn nn n n

    a f xx x x

    a f xx x x

    a f xx x x

    a f xx x x

    22102 )( xaxaaxp

    )()( 02

    0201002 xfxaxaaxp

    )()( 12

    1211012 xfxaxaaxp

    )()( 22

    2221022 xfxaxaaxp

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    2/14

    Escrito na forma matricial:

    20 00 0

    21 11 1

    2

    2 22 2

    ( )1

    ( )1

    ( )1

    a f xx x

    a f xx x

    a f xx x

    x y x^2

    0,3 1,8 0,09

    2,7 1,9 7,29

    4,5 3,1 20,25

    0

    1

    2

    1 0,3 0,09 1,81 2,7 7, 29 1,9

    1 4,5 20, 25 3,1

    aa

    a

    1) L2 = L1 * (-1) * (1 / 1) + L22) L3 = L1 * (-1) * (1 / 1) + L3

    3) L3 = L2 * (-1) * (4,2 / 2,4) + L3

    2

    2 0 1 2

    2

    2

    ( )

    ( ) 1, 908 - 0, 4047 0,14880

    p x a a x a x

    p x x x

    Interpolao por Lagrange

    Usando os 3 primeiros pontos

    Forma de Lagrange

    0 0 1 1P ( ) ( ) ( ) ( ) ( ) ( ) ( )n n nx L x f x L x f x L x f x

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    3/14

    0

    0

    n

    j

    jj i

    i n

    i j

    j

    j i

    x x

    L x

    x x

    Encontrando os Lis:

    0 2

    0

    0

    2,7 4,5 7,2 12,15

    0,3 2,7 0,3 4,5 10,08

    n

    j

    jj i

    n

    i j

    jj i

    x x

    x x x xL x

    x x

    0 2

    1

    0

    0,3 4,5 4,8 1,35

    2,7 0,3 2,7 4,5 4,32

    n

    j

    jj i

    n

    i j

    jj i

    x x

    x x x x

    L xx x

    0 2

    2

    0

    0,3 2,7 3 0,81

    4,5 0,3 4,5 2,7 7,56

    n

    j

    jj i

    n

    i j

    jj i

    x x

    x x x xL x

    x x

    2 2 2

    2

    2 2 2

    2

    2

    2

    7,2 12,15 4,8 1,35 3 0,81P ( ) 1,8 1,9 3,110,08 4,32 7,56

    P ( ) 0.178571429 7,2 12,15 0,439814815 4,8 1,35 0,410052910

    P ( ) 0.14880 0,40476 1.9080

    x x x x x xx

    x x x x x x

    x x x

    Interpolao por Newton

    Usando os 3 primeiros pontos

    O polinmio geral resultante ser:

    ))(](,,[)](,[)()( 1001200102 xxxxxxxfxxxxfxfxP

    Onde os sd' so determinados por:

    0 0 0

    1 1 0

    2 2 1 0

    1 2 1 0

    [ ] ( )

    [ , ]

    [ , , ]

    [ , ,........, , , ]n n n

    d f x f x

    d f x x

    d f x x x

    d f x x x x x

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    4/14

    1 2 1 1 2 1 01 2 1 0

    0

    ( ) ( )[ , ]

    [ , ] [ , ][ , , ]

    [ , , ] [ , , ][ , , , ]

    [ , ,..., , ] [ , ,..., , ][ , ,........, , , ]

    i j

    i j

    i j

    i j j k

    i j k

    i k

    i j k j k l

    i j k l

    i l

    n n n nn n

    n

    f x f xf x x

    x x

    f x x f x xf x x x

    x x

    f x x x f x x xf x x x x

    x x

    f x x x x f x x x xf x x x x x

    x x

    Resultando na expresso:

    0 0 1 0 0 1 2 1 0

    0 1 1 1 2 1 0

    ( ) [ ] ( ) [ , ] ( )( ) [ , , ] ....

    ( )( )...( ) [ , ,..., , , ]

    n

    n n n

    P x f x x x f x x x x x x f x x x

    x x x x x x f x x x x x

    1 01 0

    1 0

    ( ) ( ) 1,9 1,8 0,1[ , ] 0, 4166667

    2,7 0,3 2,4

    f x f xf x x

    x x

    2 12 1

    2 1

    ( ) ( ) 3,1 1,9 1,2[ , ] 0,666666667

    4,5 2,7 1,8

    f x f xf x x

    x x

    2 1 1 02 1 0

    2 0

    [ , ] [ , ] 0,625000[ , , ] 0,1488095244,2

    f x x f x xf x x xx x

    2 1 0 2 1 0

    2 1 0 2 1 0

    2

    2

    2

    ( ) 1.8 [ , ]( 0,3) [ , , ]( 0,3)( 2, 7)

    ( ) 1.8 [ , ]( 0,3) [ , , ]( 0,3)( 2, 7)

    ( ) 1.8 0,4166667( 0,3) 0,148809524( 0,3)( 2,7)

    ( ) 1.8 0, 4166667( 0, 3) 0,148809524( 3 0

    P x f x x x f x x x x x

    P x f x x x f x x x x x

    P x x x x

    P x x x x

    2

    22

    2

    2

    ,81)

    ( ) 1.8 0,4166667( 0,3) 0,148809524( 0,3)( 2,7)

    ( ) 1.8 0,4166667( 0,3) 0,148809524( 3 0,81)

    ( ) 1.908035 0, 404761905 0,148809524

    P x x x x

    P x x x x

    P x x x

    Ajustes usando MMQ

    1-

    Caso Linear

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    5/14

    Para o modelo Linear temos:

    1 1

    2

    1 1 1

    + )5 +21,2 14

    21,2 123,28 68,38

    m m

    k k

    k k

    m m m

    k k k k

    k k k

    mb x a yb a

    b ax b x a x y

    Na forma matricial pode ser escrito como:

    5 21,2 14 5 21,2 14

    21,2 123,28 68,38 21,2 123,28 68,38

    b

    a

    Usando da eliminao de Gauss:

    5 21,2 14L2 = L1 * (-1) * (21,2 / 5) + L2

    21,2 123,28 68,38

    5 21,2 14 9,0199990,271245

    0 33,392 9,019999 33,392

    21, 2 0, 271245 14 8,2496061,6499212

    5 5

    a

    b

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    6/14

    Para um ajuste quadrtico teremos os seguintes clculos:

    i x y x^2 x^3 x^4 x*y x^2*y

    1 0,3 1,8 0,09 0,027 0,0081 0,54 0,16

    2 2,7 1,9 7,29 19,683 53,1441 5,13 13,9

    3 4,5 3,1 20,25 91,125 410,063 14 62,8

    4 5,9 3,9 34,81 205,38 1211,74 23 136

    5 7,8 3,3 60,84 474,55 3701,51 25,7 201

    soma 21,2 14 123,28 790,77 5376,46 68,4 413

    2

    1 1 1

    2 3

    1 1 1 1

    2 3 4 2

    1 1 1 1

    + )

    5

    m m m

    k k k

    k k k

    m m m m

    k k k k k

    k k k k

    m m m m

    k k k k k

    k k k k

    ma x b x c y

    a

    x a x b x c x y

    x a x b x c x y

    + 21,2 123,28 14

    21,2 123,8 790,77 68,4

    123,8 790,77 5376,46 413

    b c

    a b c

    a b c

    Na forma matricial:

    y = 0,2698x + 1,6559

    R = 0,7235

    0

    0,5

    1

    1,5

    2

    2,5

    3

    3,5

    4

    4,5

    0 2 4 6 8 10

    Eixod

    osvaloresde

    Y

    Eixo dos valores de x

    Ajuste Linear

    Srie1

    Linear (Srie1)

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    7/14

    5 21,2 123,28 141) L2 = L1 * (-1) * (21,2 / 5) + L2

    21, 2 123, 28 790,77 68, 42) L3 = L1 * (-1) * (123,28 / 5) + L3

    123,28 790,77 5376,46 413

    5 21,2 123,28 14

    0 33,392 268,0628 9,04

    0 268,0628 2336,86832 67,816

    3) L3 = L2 * (-1) * (268,0628 / 33,392) + L3

    21, 2* 0, 4771139 123, 28* 0, 0257128 141,410902

    55 21,2 123,28 14

    9,04 268,0628* 0,02571280 33,392 268,0628 9,04 0,4771

    33,3920 0 184,925796 4,754965

    a

    b

    139

    4,7549650,0257128

    184,925796c

    O polinmio tem a forma:

    22 1,410902 0,47711139 0,0257128P x b c

    Para o ajuste exponencial teremos:

    ; 0xf x e

    Propriedade dos logaritmos: () ()() () ()

    () ()

    ln lnf x f x

    y = -0,0227x2+ 0,4518x + 1,4433

    R = 0,7518

    0

    0,5

    1

    1,5

    2

    2,5

    33,5

    4

    4,5

    0 2 4 6 8 10

    Eixod

    osvaloresde

    Y

    Eixo dos valores de x

    Ajuste quadrtico

    Srie1

    Polinmio (Srie1)

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    8/14

    Desta forma, podemos fazer um ajuste linear para o modelo

    exponencial, pela facilidade de trabalhar, tomando a e lnb a equao

    da reta ajustada ou equao auxiliar :

    x y ln(y) x^2 ln(y)*x0,3 1,8 0,587787 0,09 0,176336

    2,7 1,9 0,641854 7,29 1,733005

    4,5 3,1 1,131402 20,25 5,09131

    5,9 3,9 1,360977 34,81 8,029762

    7,8 3,3 1,193922 60,84 9,312595

    21,2 4,915942 123,28 24,34301

    ; ,y ax b f x a b

    || [ () ()]

    5 21,2 4,915942 5 21,2 4,915942

    21,2 123,28 24,34301 21,2 123,28 24,34301

    b

    a

    Usando da eliminao de Gauss:

    5 21,2 4,915942L2 = L1 * (-1) * (21,2 / 5) + L2

    21,2 123,28 24,34301

    5 21,2 4,915942 3,4994159200,104798033

    0 33,392 33,392

    21,2 0,104798033 4,915942 2,6942236990,538844740

    5 5

    a

    b

    Usando os valores encontrados para:

    0,104798033 0,538844740

    0,538844740

    1,714025573

    ln

    ln

    e e

    Portanto,

    1,714025573

    0,104798033

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    9/14

    Para caso de um ajuste de polinmio de Grau 3 a tabela com os somatrios :

    0

    1

    2

    3

    11 5,51 3,8501 3,025 7,2051

    5,51 3,8501 3,025 2,5333 4,5127.

    3,8501 3,025 2,5333 2,2083 3,378

    3,025 2,5333 2,2083 1,97841 2,7514

    b

    b

    b

    b

    Soluo do sistema:

    b0=0,1011

    b1=2,0685b2=-2,1782

    b3=1,0186

    E o polinmio de ajuste ser:

    y=0,1011+2,0685.x-2,1782.x2+1,0186.x3

    y = 1,714e0,1048x

    R = 0,7609

    0

    0,5

    1

    1,5

    2

    2,5

    3

    3,5

    4

    4,5

    0 2 4 6 8 10

    Eixod

    osvaloresde

    Y

    Eixo dos valores de x

    Ajuste exponencial

    Srie1

    Exponencial (Srie1)

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    10/14

    2) Ajustar os dados da Tabela 2:

    Tabela 2Dados para juste pelo MMQ

    Para o modelo Linear temos:

    1 1

    2

    1 1 1

    + )8 +42,2 102

    42, 2 290, 04 657, 64

    m m

    k k

    k k

    m m m

    k k k k

    k k k

    mb x a yb a

    b ax b x a x y

    Na forma matricial pode ser escrito como:

    8 42,2 102 8 42,2 102

    42,2 290,04 657,64 42,2 290,04 657,64

    8 42,2 1021) L2 = L1 * (-1) * (42,2 / 8) + L2

    42,2 290,04 657,64

    42,2* 1,77341 1023,395254

    8 42,2 102 2

    0 67,435119,59

    b

    a

    b

    a

    119,59 1,77341

    67,435

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    11/14

    3) Calcular a integral

    3 2

    2

    0 1 2

    xxedx

    x usando as regras de integrao dadas em aula. Use

    algumas repeties para as mesmas e compare os resultados.

    y = 1,7918x + 3,2535

    R = 0,9193

    0

    5

    10

    15

    20

    25

    0 2 4 6 8 10

    Eixod

    osvaloresde

    y

    Eixo dos valores de x

    Ajuste Linear

    Srie1

    Linear (Srie1)

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    12/14

    4) Calcular

    2,7

    01 cos

    x sen xdx

    x

    usando as regras conhecidas com 0,3h .

    5) Calcular 0

    2xe sen x dx

    com 6m .

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    13/14

    6) Calcular o PVI ' 2 1y x y com 0 1y no intervalo 0,1 com 4 e 10intervalos. Use os mtodos numricos para EDO.

  • 7/25/2019 Lista de Exerccios MMQ in MNEDO

    14/14

    i Analtica Euler Euler Modificado

    0 1. 1. 1.

    1 0.9140481 0.9 0.915

    2 0.8527400 0.83 0.8543

    3 0.8116087 0.784 0.813526

    4 0.7869967 0.7572 0.78909135 0.7759096 0.74576 0.7780549

    6 0.7758957 0.746608 0.778005

    7 0.7849477 0.7572864 0.7869641

    8 0.8014224 0.7758291 0.8033106

    9 0.8239742 0.8006633 0.8257147

    10 0.8515015 0.8305306 0.8530860

    i Analtica Euler Euler

    Modificado

    Euler

    Melhorado

    0 1. 1. 1. 1.1 0.8298980 0.75 0.84375 0.84375

    2 0.7759096 0.6875 0.7929688 0.7929688

    3 0.7923476 0.71875 0.8081055 0.8081055

    4 0.8515015 0.796875 0.8644409 0.8644409