deber2

UNIVERSIDAD DE LAS FUERZAS ARMADAS - ESPE M´etodos Num´ericos Mario Navarrete DEBER No 2 Sistema de ecuaciones linea

Views 175 Downloads 1 File size 302KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

UNIVERSIDAD DE LAS FUERZAS ARMADAS - ESPE

M´etodos Num´ericos

Mario Navarrete

DEBER No 2

Sistema de ecuaciones lineales y ajuste de curvas

Segundo Parcial

Docente: Ing. Patricio Pugar´ın D.

1

1. EJERCICIO: En el sistema siguiente, pruebe que Ax = B es equivalente al sistema triangular ´ superior U x = y que se da y halle su solucion.

  4x1 + 8x2 + 4x3 + 0x4 = 8        x1 + 5x2 + 4x3 − 3x4 = −4    x1 + 4x2 + 7x3 + 2x4 = 10      x1 + 3x2 + 0x3 − 2x4 = −4

  4x1 + 8x2 + 4x3 + 0x4 = 8       3x2 + 3x3 − 3x4 = −6     4x3 + 4x4 = 12      x4 = 2

Primeramente se plantea la matriz ampliada del sistema de ecuaciones con sus coeficientes:  4  1  1  1

8 5 4 3

 4 0 8   4 −3 −4  7 2 10   0 −2 −4

Posteriormente se escalona esta matriz hasta que se forme una matriz triangular superior: F4 = 4F4 − F1 F3 = 4F3 − F1 F2 = 4F2 − F1   0 8  4 8 4   0 12 12 −12 −24   0 8 24 8 32    0 4 −4 −8 −24 F4 = 3F4 − F2 F3 = 23 F3 − F2   4 0 8  4 8   0 12 12 −12 −24   0 0 24 24 72    0 0 −24 −12 −48 F4 = F3 + F4   0 8  4 8 4   0 12 12 −12 −24   0 0 24 24 72    0 0 0 12 24 F4 =

1 12 F4

F3 = 16 F3 F2 = 14 F2  4  0  0  0

8 3 0 0

 4 0 8   3 −3 −6  4 4 12   0 1 2 2

Con lo que se llega al sistema U x = y. Con este sistema triangular superior, se calcula sus soluciones: x4 = 2 x3 = x2 =

12−4x4 4

−6−3x3 +3x4 3

x1 =

8−8x2 −4x3 4

x3 = 1 x2 = −1 x1 = 3

2. EJERCICIO: Resolver con calculadora (a mano) el siguiente sistema de ecuaciones, aplicando ´ gaussiana. la eliminacion

  x1 + 8x2 − 5x3 = 3     3x1 − 2x2 + 3x3 = 1      2x + 3x − x = 4 1 2 3 Primeramente se plantea la matriz ampliada del sistema de ecuaciones con sus coeficientes:   1 8 −5 3 3 −2 3 1     2 3 −1 4 Posteriormente se escalona esta matriz hasta que se forme una matriz triangular superior: F1 ⇐⇒ F2   3 −2 3 1 1 8 −5 3     2 3 −1 4 F2 = 3F2 − F1 F3 = 1,5F3 − F1   3 1 3 −2   0 26 −18 8   0 6,5 −4,5 5 F3 = 4F3 − F2   1  3 −2 3   0 26 −18 8    0 0 0 12 ´ regresiva, se calcular el valor de las incognitas. ´ Luego por medio del algoritmo de sustitucion Se tiene que: 0x3 = 12 ´ El sistema presenta una inconsistencia, por lo tanto este no tiene solucion.

3

´ del siguiente sistema lineal, con calculadora y a mano. 3. EJERCICIO: Halle la solucion

  x1 + x2 = 5        2x1 − x2 + 5x3 = −9    3x2 − 4x3 + 2x4 = 19      2x3 + 6x4 = 2 Primeramente se plantea la matriz ampliada del sistema de ecuaciones con sus coeficientes:   0 0 5  1 1   2 −1 5 0 −9   0 3 −4 2 19    0 0 2 6 2 Posteriormente se escalona esta matriz hasta que se forme una matriz triangular superior: F1 ⇐⇒ F2   2 −1 5 0 −9   1 1 0 0 5    0 3 −4 2 19    0 0 2 6 2 F2 = 2F2 − F1   2 −1 5 0 −9 0 3 −5 0 19    0 3 −4 2 19      0 0 2 6 2 F3 = F3 − F2   2 −1 5 0 −9   0 3 −5 0 19    0 0 1 2 0    0 0 2 6 2 F3 ⇐⇒ F4   2 −1 5 0 −9   0 3 −5 0 19    0 0 2 6 2    0 0 1 2 0 F4 = 2F4 − F3   0 −9 2 −1 5   0 3 −5 0 19    0 0 2 6 2    0 0 0 −2 −2 Luego se procede a calcular las soluciones del sistema:

4

x4 =

−2 −2

x4 = 1

x3 =

2−6x4 2

x2 =

19+5x3 3

x3 = −2 x2 = 3

−9+x2 −5x3 2

x1 =

x1 = 2

4. EJERCICIO: Demuestre que la inversa de una matriz triangular superior es una matriz triangular superior. Se tiene una matriz triangular superior de esta manera:   1 6 8   0 4 3   0 0 2 Posteriormente se plantea la matriz ampliada con la matriz identidad para calcular la inversa de la matriz:   1 6 8 1 0 0   0 4 3 0 1 0   0 0 2 0 0 1 Luego se procede a escalonar esta matriz: F1 = 41 F1 − F3 F2 = 23 F2 − F3 1  4   0  0 F1 =

3 2 8 3

0 14 0 0 0 2 0

 0 −1  2  3 −1  0 1

16 9 F1 − F2

4  9   0  0

0 0 49 − 23 8 2 3 0 0 3 0 2 0 0

F1 = 94 F1 F2 = 38 F2 F3 = 12 F3 Con lo que se obtiene la matriz inversa:  1 − 32  0 14  0 0

5

 − 74   − 38  1  2

 − 97   −1   1

Con esto se demuestra que la inversa de una matriz triangular superior es de igual manera una matriz triangular superior. 5. EJERCICIO: Resolver el sistema lineal de ecuaciones Ax = B, calculando a mano solo las ma´ P A = LU . trices correspondientes a la factorizacion   1   2 −3 8   4 0 1 −10  A =  16 4 −2 1    0 7 −1 5   1   2 −3 8    4 0 1 −10 1   A =  16 4 −2 1    0 7 −1 5

b1 = P1 A1 A

m21 =

4 16

m31 =

0 1 0 0

1 0 0 0

2 16 0 1 0 0

m41 = 0 0 1 0

0 16

 0  0  0  1

  16 4 −2 1   0 −1 3 − 41  2 4  A2 =   7   0 − 72 33  4 8   0 7 −1 5  1  0 P2 =  0  0

b2 = P2 A2 A

 0  0 P1 =  1  0

  16 4 −2 1     4 0 1 −10 1 b   A =  1   2 −3 8   0 7 −1 5

  1  4 − L1 =  16 2 − 16  0

b1 A2 = L1 A

  1   1  B =   1   1

0 0 0 1

0 0 1 0

 0  1  0  0

  16 4 −2 1     0 7 −1 5  2 b  A =   7   0 − 72 33  4 8   0 −1 32 − 41 4 1 1 m42 = − 2 7   1 0 0 0   0 1 0 0  L2 =  0 12 1 0   0 17 0 1

m32 = −

b2 A3 = L 2 A

 16  0 A3 =   0  0 6

 4 −2 1   7 −1 5   27  0 31 4 8   19 0 14 − 267 28

 0  0  0  1

 1  0 P3 =  0  0

0 1 0 0

0 0 1 0

 0  0  0  1

  1  16 4 −2   5  b3 = P3 A3 b3 =  0 7 −1 A A  27   0 0 31 4 8    19 267  0 0 14 − 28   0 0 1 0   38 0 1 0 0  L3 =  m43 = 1 0 217 0 0   38 1 0 0 − 217   1  16 4 −2   5  b3 U = A4 =  0 7 −1  A4 = L 3 A 27 31   0 0 4 8    4395  0 0 0 − 434   0 0 1 0   0 0 0 1   P = P1 P2 P3 P =  1 0 0 0   0 1 0 0   0 0  1 0   0 1 0 0  L = L−1 L−2 L−3 L =  1  8 − 21 1 0 1  1 38 4 − 7 217 1 A partir de las matrices L,P y U se puede calcular las soluciones de mi sistema de ecuaciones:

Fig. 1.- Soluciones del sistema de ecuaciones.

7

Fig. 2.- Soluciones del sistema de ecuaciones. 2

´ f (x) = x2 e−x . Se pide calcular un valor aproximado para 6. EJERCICIO: Considere la funcion la integral de f (x) en el intervalo [−2, 2] usando el polinomio de Lagrange, calculado a mano, que interpola f (x en los puntos x0 = −2, x1 = −1, x2 = 0, x3 = 1 y x4 = 2. ´ los puntos en nuestra funcion ´ f (x): Primero se evalua

x0 = −2

f (x0 ) = 0,073

x1 = −1

f (x0 ) = 0,3679

x2 = 0 x3 = −1 x4 = 2

f (x0 ) = 0 f (x0 ) = 0,3679 f (x0 ) = 0,073

P (x) =

4 X

f (xk )L4,k (x)

k=0

P (x) = f (x0 )L4,0 (x) + f (x1 )L4,1 (x) + f (x2 )L4,2 (x) + f (x3 )L4,3 (x) + f (x4 )L4,4 (x)

P (x) = 0,073L4,0 (x) + 0,3679L4,1 (x) + 0,3679)L4,3 (x) + 0,073L4,4 (x)

Qn

j=0 (x − xj )

L4,k (x) = Qn

j=0 (xk

k=0 8

− xj )

k,j

L4,0 (x) =

(x − x1 )(x − x2 )(x − x3 )(x − x4 ) 1 = (x + 1)(x − 1)(x − 2)(x) (x0 − x1 )(x0 − x2 )(x0 − x3 )(x0 − x4 ) 24

L4,1 (x) =

(x − x0 )(x − x2 )(x − x3 )(x − x4 ) 1 = − (x + 2)(x − 1)(x − 2)(x) (x1 − x0 )(x1 − x2 )(x1 − x3 )(x1 − x4 ) 6

L4,3 (x) =

(x − x0 )(x − x1 )(x − x2 )(x − x4 ) 1 = − (x + 2)(x + 1)(x − 2)(x) (x3 − x0 )(x3 − x1 )(x3 − x2 )(x3 − x4 ) 6

L4,4 (x) =

(x − x0 )(x − x1 )(x − x2 )(x − x3 ) 1 = (x + 2)(x + 1)(x − 1)(x) (x4 − x0 )(x4 − x1 )(x4 − x2 )(x4 − x3 ) 24

k=1

k=3

k=4

P (x) = 3,041667E−03(x4 −2x3 −x2 +2x)−0,0613(x4 −x3 −4x2 +4x)−0,0613(x4 +x3 −4x2 −4x)+3,041667E−03(x4 +2x3 −x P (x) = −0,12x4 + 0,48x2

Z

2

(−0,12x4 + 0,48x2 )dx = 1,024

−2

7. EJERCICIO: Con el siguiente conjunto de nodos.

Fig. 3.- Conjunto de nodos.

´ para x = 90, con un polinomio de segundo grado, utilizando los Obtener el valor de la funcion siguientes m´etodos: ´ polinomial simple. a) Por interpolacion ´ de Lagrange. (Aplicando el programa) b) Por interpolacion c) Construya solo la matriz de diferencias divididas para aproximar todos los puntos de la tabla. d) Evaluar el polinomio interpolador de Newton, de tercer grado, para x = 1,75. Literal a) Se escoje 3 nodos de la tabla: x0 = 40

x1 = 60

f (x0 ) = 0,63

x2 = 80

f (x1 ) = 1,36

f (x2 ) = 2,18 9

f2 (x) = b0 + b1 (x − x0 ) + b2 (x − x0 )(x − x1 ) Donde el valor de los coeficientes es:

b0 = f (x0 ) b1 =

b2 =

f (x1 ) − f (x0 ) x1 − x0

f (x2 )−f (x1 ) x2 −x1



f (x1 )−f (x0 ) x1 −x0

x2 − x0

Se procede a calcular el valor de los coeficientes:

b0 = 0,63 b1 =

1,36 − 0,63 = 0,0365 60 − 40

2,18−1,36 80−60

− 1,36−0,63 60−40 = 1,125E − 04 80 − 40 ´ en x = 90: Se reemplaza estos valores en la formula inicial y se evalua b2 =

f2 (x) = 0,63 + 0,0365(x − 40) + 1,125E − 04(x − 40)(x − 60) f2 (90) = 2,62 Literal b) De igual manera se escoje 3 nodos de la tabla: x0 = 40

x1 = 60

f (x0 ) = 0,63

x2 = 80

f (x1 ) = 1,36

f (x2 ) = 2,18

10

Fig. 4.- Interpolador de Lagrange.

Se obtiene el polinomio de Lagrange y se evalua en x = 90: P2 (x) = 0,0001x2 + 0,0252x − 0,56 P2 (90) = 2,52 Literal c) xk 40 60 80 100 120 140 160

f [xk ] 0.63 1.36 2.18 3 3.93 6.22 8.59

a1

a2

a3

a4

a5

a6

0.037 0.041 0.041 0.047 0.115 0.119

1.13E-4 0 1.38E-4 1.7E-3 1E-4

-1.88E-6 2.29E-6 2.60E-5 -2.67E-5

5.21E-8 2.97E-7 -6.59E-7

2.45E-9 -9.56E-9

-1E-10

´ en x = 90: Se obtiene el polinomio interpolador de Newton de segundo grado y se evalua

P2 (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) P2 (x) = 0,63 + 0,037(90 − 40) + 1,13E − 4(90 − 40)(90 − 60) P2 (90) = 2,6495 Literal d) ´ en x = 1,75: Se obtiene el polinomio interpolador de Newton de tercer grado y se evalua

P3 (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) + a3 (x − x0 )(x − x1 )(x − x2 )

P3 (x) = 0,63+0,037(1,75−40)+1,13E −4(1,75−40)(1,75−60)−1,88E −6(1,75−40)(1,75−60)(1,75−80) P3 (1,75) = −0,2057 ´ x − 9−x = 0 tiene una solucion ´ en el intervalo [0, 1]. Utilice la teor´ıa de 8. EJERCICIO: La ecuacion ´ polinomial en los nodos x0 = 0, x1 = 0, 5, x2 = 1 para encontrar una solucion ´ aproximainterpolacion ´ (Aplicar los programas) da b x de la ecuacion. Con los puntos x0 = 0, x1 = 0, 5, x2 = 1 se obtiene sus correspondientes f (xi ) evaluando en la ´ ecuacion: x0 = 0 x1 = 0,5 x2 = 1

f (x0 ) = −1 f (x0 ) = 0,1667 f (x0 ) = 0,8889

11

Posteriormente se encuentra un polinomio interpolador de newton para este conjunto de nodos y por ultimo se calcula las ra´ıces de este polinomio:

´ aproximada. Fig. 6.- Solucion

´ aproximada de nuestra ecuacion ´ en el intervalo [0, 1] que es: Con esto se encuentra una solucion

b x = 0,4151

12