Sistemas de ecuaciones no lineales Curso: Métodos Numéricos en Ingeniería Profesor: Dr. José A. Otero Hernández Correo: j.a.otero@itesm.mx web: http://metodosnumericoscem.weebly.com Universidad: ITESM CEM
Tópicos 1 INTRODUCCIÓN Sistema de ecuaciones no lineales 2 ITERACIÓN DE PUNTO FIJO Condición de convergencia 3 NEWTON-RAPHSON
Tópicos 1 INTRODUCCIÓN Sistema de ecuaciones no lineales 2 ITERACIÓN DE PUNTO FIJO Condición de convergencia 3 NEWTON-RAPHSON
Sistema de ecuaciones no lineales Qué es un sistema de ecuaciones no lineales? f 1 (x 1, x 2,..., x n ) = 0, f 2 (x 1, x 2,..., x n ) = 0,. f n (x 1, x 2,..., x n ) = 0. Qué es un sistema de ecuaciones no lineales? x i, i = 1, 2,..., n Incógnitas f i, i = 1, 2,..., n Funciones no lineales con respecto x i Ejemplos u(x, y) = x 2 + x y 10 = 0 v(x, y) = y + 3x y 2 57 = 0
Sistema de ecuaciones no lineales Solución Si x s = [x s 1, xs 2,..., xs n], es la solución del sistema de ecuaciones Entonces: f i (x s ) = 0, para i = 1, 2,..., n Solución exacta Los sistemas de ecuaciones no lineales no tienen solución exacta o analítica. Soluciones numéricas son necesarias
Tópicos 1 INTRODUCCIÓN Sistema de ecuaciones no lineales 2 ITERACIÓN DE PUNTO FIJO Condición de convergencia 3 NEWTON-RAPHSON
Métodos de iteración de punto fijo El método de iteración de punto fijo estudiado anteriormente puede modificarse para resolver un sistema de ecuaciones no lineales simultaneas.
Ejemplos I Busquemos la solución del sistema de ecuaciones no lineales: u(x, y) = x 2 + x y 10 = 0 v(x, y) = y + 3x y 2 57 = 0 Hallar la función g x (x, y): Hallar la función g y (x, y): g x (x, y) = 10 x2 y g y (x, y) = 57 3xy 2
Algoritmo x i+1 = g x (x i, y i ) y i+1 = g y (x i+1, y i ) Algoritmo: Ejemplos I x i+1 = 10 x2 i y i y i+1 = 57 3x i+1 y 2 i
function p u n t o f i j o s e n v 1 ( gx, gy, x0, y0,ee) % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % puntofijosenv1 : Nombre de la funcion % Valores de entrada % gx : funcion matematica de entrada >x=gx ( x, y ) % gy : funcion matematica de entrada >y=gy ( x, y ) % x0 : Valor de i n i c i a l de x % y0 : Valor de i n i c i a l de y % EE: E r r o r Estimado % Valores de s a l i d a % Salida : Raiz x, EA x, Raiz y, EA y % IM : Iteracion Maxima % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % IM=1; x ( IM ) =x0 ; y ( IM ) =y0 ; EAx( IM ) =10ˆ3; EAy( IM ) =10ˆ3; while EAx ( IM )>EE EAy ( IM )>EE x ( IM+1)=gx ( x ( IM ), y ( IM ) ) ; y ( IM+1)=gy ( x ( IM+1), y ( IM ) ) ; EAx( IM+1)=abs ( ( x ( IM+1) x ( IM ) ) / x ( IM+1) ) 100; EAy( IM+1)=abs ( ( y ( IM+1) y ( IM ) ) / y ( IM+1) ) 100; IM=IM+1; end Salida1 =[ Iteracion Maxima=,num2str ( IM 1) ] ; Salida2 =[ x ( 2 : size ( x, 2 ) ) EAx ( 2 : size ( x, 2 ) ) y ( 2 : size ( y, 2 ) ) EAy ( 2 : size ( y, 2 ) ) ] ; disp ( ) disp ( Salida1 ) disp ( ) disp ( Raiz x EApro x Raiz y EApro y ) disp ( Salida2 )
>> p u n t o f i j o s e n v 1 (@( x, y ) (10 x ˆ 2 ) / y,@( x, y ) 57 3 x y ˆ 2, 1. 5, 3. 5, 0. 0 0 1 ) I t e r a c i o n Maxima=106 Raiz x EApro x Raiz y EApro y 1.0e+154 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000........................................................................................................................ 0.0000 0.0000 0.0066 0.0000 0.0000 0.0000 0.1976 0.0000 0.0000 0.0000 5.9275 0.0000 0.0000 0.0000 I n f NaN
Ejemplos II Busquemos la solución del sistema de ecuaciones no lineales: Hallar la función g x (x, y): Hallar la función g y (x, y): u(x, y) = x 2 + x y 10 = 0 v(x, y) = y + 3x y 2 57 = 0 g x (x, y) = 10 xy g y (x, y) = 57 y 3x
Algoritmo x i+1 = 10 x i y i y i+1 = 57 yi 3x i+1
>> p u n t o f i j o s e n v 1 (@( x, y ) (10 x y ) ˆ 0. 5,@( x, y ) ((57 y ) /(3 x ) ) ˆ 0. 5, 1. 5, 3. 5, 0. 0 0 1 ) I t e r a c i o n Maxima=11 Raiz x EApro x Raiz y EApro y 2.1794 31.1753 2.8605 22.3560 1.9405 12.3118 3.0496 6.1991 2.0205 3.9557 2.9834 2.2171 1.9930 1.3762 3.0057 0.7419 2.0024 0.4673 2.9981 0.2552 1.9992 0.1601 3.0007 0.0870 2.0003 0.0547 2.9998 0.0298 1.9999 0.0187 3.0001 0.0102 2.0000 0.0064 3.0000 0.0035 2.0000 0.0022 3.0000 0.0012 2.0000 0.0007 3.0000 0.0004
Condición de convergencia Convergencia g x x + g x y < 1 g y x + g y y < 1
Tópicos 1 INTRODUCCIÓN Sistema de ecuaciones no lineales 2 ITERACIÓN DE PUNTO FIJO Condición de convergencia 3 NEWTON-RAPHSON
Métodos de Newton-Raphson El método de Newton-Raphson estudiado anteriormente puede modificarse para resolver un sistema de ecuaciones no lineales simultaneas.
Serie de Taylor de multiples variables u i+1 = u i + (x i+1 x i ) u i x + (y i+1 y i ) u i y v i+1 = v i + (x i+1 x i ) v i x + (y i+1 y i ) v i y Considerando u i+1 = v i+1 = 0, para las raíces aproximadas, llegamos a un sistema de ecuaciones para determinar x i+1 y y i+1 : Serie de Taylor de multiples variables u i x i+1 x + y u i i+1 y = u u i i + x i x + y u i i y x i+1 v i x + y i+1 v i y = v i + x i v i x + y i v i y
Fórmula de Newton-Raphson x i+1 = x i u i v i y v i u i y u i v i x y u i y v i x y i+1 = y i v i u i x u i v i x u i x v i y u i y v i x
function newtonraphsonsenv1 ( u, v, x0, y0,ee) % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % newtonraphsonsenv1 : Nombre de la funcion % Valores de entrada % u, v : funciones matematicas de entrada % x0 : Valor de i n i c i a l de x, y0 : Valor de i n i c i a l de y0, EE: E r r o r Estimado % Valores de s a l i d a % Salida : IM : Iteracion Maxima, Raiz y Error Aproximado % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % syms x y dux=@( xx, yy ) subs ( d i f f ( u, x ),{x, y},{xx, yy }) ; duy=@( xx, yy ) subs ( d i f f ( u, y ),{x, y},{xx, yy }) ; dvx=@( xx, yy ) subs ( d i f f ( v, x ),{x, y},{xx, yy }) ; dvy=@( xx, yy ) subs ( d i f f ( v, y ),{x, y},{xx, yy }) ; IM=1; rx ( IM ) =x0 ; ry ( IM ) =y0 ; EAx( IM ) =10ˆ3;EAy( IM ) =10ˆ3; while (EAx ( IM )>EE) (EAy ( IM )>EE) rx ( IM+1)= rx ( IM ) (u ( rx ( IM ), ry ( IM ) ) dvy ( rx ( IM ), ry ( IM ) ) v ( rx ( IM ), ry ( IM ) )... duy ( rx ( IM ), ry ( IM ) ) ) / ( dux ( rx ( IM ), ry ( IM ) ) dvy ( rx ( IM ), ry ( IM ) )... duy ( rx ( IM ), ry ( IM ) ) dvx ( rx ( IM ), ry ( IM ) ) ) ; ry ( IM+1)= ry ( IM ) (v ( rx ( IM ), ry ( IM ) ) dux ( rx ( IM ), ry ( IM ) ) u ( rx ( IM ), ry ( IM ) )... dvx ( rx ( IM ), ry ( IM ) ) ) / ( dux ( rx ( IM ), ry ( IM ) ) dvy ( rx ( IM ), ry ( IM ) )... duy ( rx ( IM ), ry ( IM ) ) dvx ( rx ( IM ), ry ( IM ) ) ) ; EAx( IM+1)=abs ( ( rx ( IM+1) rx ( IM ) ) / rx ( IM+1) ) 100; EAy( IM+1)=abs ( ( ry ( IM+1) ry ( IM ) ) / ry ( IM+1) ) 100; IM=IM+1; end Salida1 =[ Iteracion Maxima=,num2str ( IM 1) ] ; Salida2 =[ rx ( 2 : size ( rx, 2 ) ) EAx ( 2 : size ( rx, 2 ) ) ry ( 2 : size ( ry, 2 ) ) EAy ( 2 : size ( ry, 2 ) ) ] ; disp ( ) ; disp ( Salida1 ) disp ( ) ; disp ( Raiz x EApro x Raiz y EApro y ) disp ( Salida2 )
>> newtonraphsonsev1 (@( x, y ) xˆ2+x y 10,@( x, y ) y+3 x yˆ2 57,1.5,3.5,0.001) I t e r a c i o n Maxima=4 Raiz x EApro x Raiz y EApro y 2.0360 26.3272 2.8439 23.0715 1.9987 1.8676 3.0023 5.2764 2.0000 0.0650 3.0000 0.0763 2.0000 0.0000 3.0000 0.0000