Sistemas de ecuaciones no lineales
Curso: M ´etodos Num ´ericos en Ingenier´ıa
Profesor: Dr. Jos ´e A. Otero Hern ´andez
Correo: [email protected]
beamer-tu-logo
T ´
opicos
1
INTRODUCCI ´
ON
Sistema de ecuaciones no lineales
2
ITERACI ´
ON DE PUNTO FIJO
Presentaci ´on del m ´etodo
Programa MATLAB
Condici ´on de convergencia
3
NEWTON-RAPHSON
Presentaci ´on del m ´etodo
Programa MATLAB
T ´
opicos
1
INTRODUCCI ´
ON
Sistema de ecuaciones no lineales
2
ITERACI ´
ON DE PUNTO FIJO
Presentaci ´on del m ´etodo
Programa MATLAB
Condici ´on de convergencia
3
NEWTON-RAPHSON
beamer-tu-logo Sistema de ecuaciones no lineales
¿Qu ´e es un sistema de ecuaciones no lineales?
f
1
(
x
1
, x
2
, ..., x
n
) = 0
,
f2
(
x1, x2
, ..., x
n
) = 0
,
..
.
f
n
(
x1, x2, ..., x
n
) = 0
.
¿Qu ´e es un sistema de ecuaciones no lineales?
x
i
, i
= 1
,
2
, . . . , n
→
Inc ´ognitas
f
i
, i
= 1
,
2
, . . . , n
→
Funciones no lineales con respecto
x
i
Ejemplos
u
(
x, y
) =
x
2
+
x y
−
10 = 0
Sistema de ecuaciones no lineales
Soluci ´
on
Si
x
s
= [
x
s
1
, x
s
2
, ..., x
s
n
], es la soluci ´on del sistema de
ecuaciones
Entonces:
f
i
(x
s
) = 0, para
i
= 1
,
2
, . . . , n
Soluci ´
on exacta
Los sistemas de ecuaciones no lineales no tienen soluci ´on
exacta o anal´ıtica.
beamer-tu-logo
T ´
opicos
1
INTRODUCCI ´
ON
Sistema de ecuaciones no lineales
2
ITERACI ´
ON DE PUNTO FIJO
Presentaci ´on del m ´etodo
Programa MATLAB
Condici ´on de convergencia
3
NEWTON-RAPHSON
Presentaci ´on del m ´etodo
Programa MATLAB
Presentaci ´on del m ´etodo
M ´etodos de iteraci ´
on de punto fijo
El m ´etodo de iteraci ´on de punto fijo estudiado anteriormente
puede modificarse para resolver un sistema de ecuaciones no
lineales simultaneas.
beamer-tu-logo Presentaci ´on del m ´etodo
Ejemplos I
Busquemos la soluci ´on del sistema de ecuaciones no lineales:
u
(
x, y
) =
x
2
+
x y
−
10 = 0
v
(
x, y
) =
y
+ 3
x y
2
−
57 = 0
Hallar la funci ´on
g
x
(
x, y
):
g
x
(
x, y
) =
10
−
x
2
y
Hallar la funci ´on
g
y
(
x, y
):
Presentaci ´on del m ´etodo
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−
x
2 iy
iy
i
+1
= 57
−
3
x
i
+1
y
i
2
beamer-tu-logo Programa MATLAB f u n c t i o n p u n t o f i j o s e n v 1 ( gx , gy , x0 , y0 , EE) % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % p u n t o f i j o s e n v 1 : Nombre de l a f u n c i o n % V a l o r e s de e n t r a d a % gx : f u n c i o n matematica de entrada−>x=gx ( x , y ) % gy : f u n c i o n matematica de entrada−>y=gy ( x , y ) % x0 : V a l o r de i n i c i a l de x % y0 : V a l o r de i n i c i a l de y % EE : E r r o r Estimado % V a l o r e s de s a l i d a % S a l i d a : Ra i z x , EA x , R ai z y , EA y % IM : I t e r a c i o n Maxima % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % IM = 1 ; x ( IM ) =x0 ; y ( IM ) =y0 ; EAx ( IM ) = 1 0 ˆ 3 ; EAy ( IM ) = 1 0 ˆ 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
S a l i d a 1 = [ ’ I t e r a c i o n Maxima= ’ ,num2str( IM−1) ] ;
S a l i d a 2 = [ x ( 2 :s i z e( x , 2 ) ) ’ EAx ( 2 :s i z e( x , 2 ) ) ’ y ( 2 :s i z e( y , 2 ) ) ’ EAy ( 2 :s i z e( y , 2 ) ) ’ ] ; disp( ’ ’ )
disp( S a l i d a 1 ) disp( ’ ’ )
disp( ’ Raiz x EApro x Raiz y EApro y ’ ) disp( S a l i d a 2 )
Programa MATLAB
>>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 . 0 e+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
beamer-tu-logo Programa MATLAB
Ejemplos II
Busquemos la soluci ´on del sistema de ecuaciones no lineales:
u
(
x, y
) =
x
2
+
x y
−
10 = 0
v
(
x, y
) =
y
+ 3
x y
2
−
57 = 0
Hallar la funci ´on
g
x
(
x, y
):
g
x
(
x, y
) =
p
10
−
xy
Hallar la funci ´on
g
y
(
x, y
):
g
y
(
x, y
) =
r
57
−
y
Programa MATLAB
Algoritmo
x
i
+1
=
√
10
−
x
i
y
i
y
i
+1
=
q
57−
y
i3
x
i+1beamer-tu-logo Programa MATLAB
>>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 ´on de convergencia
Convergencia
∂g
x
∂x
+
∂g
x
∂y
<
1
∂g
y
∂x
+
∂g
y
∂y
<
1
beamer-tu-logo
T ´
opicos
1
INTRODUCCI ´
ON
Sistema de ecuaciones no lineales
2
ITERACI ´
ON DE PUNTO FIJO
Presentaci ´on del m ´etodo
Programa MATLAB
Condici ´on de convergencia
3
NEWTON-RAPHSON
Presentaci ´on del m ´etodo
Programa MATLAB
Presentaci ´on del m ´etodo
M ´etodos de Newton-Raphson
El m ´etodo de Newton-Raphson estudiado anteriormente puede
modificarse para resolver un sistema de ecuaciones no lineales
simultaneas.
beamer-tu-logo Presentaci ´on del m ´etodo
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
x
i
+1
∂u
i
∂x
+
y
i
+1
∂u
i
∂y
=
−
u
i
+
x
i
∂u
i
∂x
+
y
i
∂u
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
Presentaci ´on del m ´etodo
F ´
ormula de Newton-Raphson
x
i
+1
=
x
i
−
u
i
∂v
∂y
i−
v
i
∂u
∂y
i∂u
i∂x
∂v
i∂y
−
∂u
i∂y
∂v
i∂x
y
i
+1
=
y
i
−
v
i
∂u
∂x
i−
u
i
∂v
∂x
i∂u
i∂x
∂v
i∂y
−
∂u
i∂y
∂v
i∂x
beamer-tu-logo Programa MATLAB f u n c t i o n newtonraphsonsenv1 ( u , v , x0 , y0 , EE) % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % newtonraphsonSENv1 : Nombre de l a f u n c i o n % V a l o r e s de e n t r a d a % u , v : f u n c i o n e s matematicas de e n t r a d a % x0 : V a l o r de i n i c i a l de x , y0 : V a l o r de i n i c i a l de y0 , EE : E r r o r Estimado % V a l o r e s de s a l i d a
% S a l i d a : IM : I t e r a c i o n Maxima , Raiz y E r r o r 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 ; r x ( IM ) =x0 ; r y ( IM ) =y0 ; EAx ( IM ) = 1 0 ˆ 3 ; EAy ( IM ) = 1 0 ˆ 3 ; while ( EAx ( IM )>EE) | | ( EAy ( IM )>EE)
r x ( IM +1)= r x ( IM )−(u ( r x ( IM ) , r y ( IM ) )∗dvy ( r x ( IM ) , r y ( IM ) )−v ( r x ( IM ) , r y ( IM ) ) . . . ∗duy ( r x ( IM ) , r y ( IM ) ) ) / ( dux ( r x ( IM ) , r y ( IM ) )∗dvy ( r x ( IM ) , r y ( IM ) )−. . . duy ( r x ( IM ) , r y ( IM ) )∗dvx ( r x ( IM ) , r y ( IM ) ) ) ; r y ( IM +1)= r y ( IM )−(v ( r x ( IM ) , r y ( IM ) )∗dux ( r x ( IM ) , r y ( IM ) )−u ( r x ( IM ) , r y ( IM ) ) . . . ∗dvx ( r x ( IM ) , r y ( IM ) ) ) / ( dux ( r x ( IM ) , r y ( IM ) )∗dvy ( r x ( IM ) , r y ( IM ) )−. . . duy ( r x ( IM ) , r y ( IM ) )∗dvx ( r x ( IM ) , r y ( IM ) ) ) ; EAx ( IM +1)=abs( ( r x ( IM +1)−r x ( IM ) ) / r x ( IM +1) )∗100; EAy ( IM +1)=abs( ( r y ( IM +1)−r y ( IM ) ) / r y ( IM +1) )∗100; IM=IM + 1 ; end
S a l i d a 1 = [ ’ I t e r a c i o n Maxima= ’ ,num2str( IM−1) ] ;
S a l i d a 2 = [ r x ( 2 :s i z e( rx , 2 ) ) ’ EAx ( 2 :s i z e( rx , 2 ) ) ’ r y ( 2 :s i z e( ry , 2 ) ) ’ EAy ( 2 :s i z e( ry , 2 ) ) ’ ] ; disp( ’ ’ ) ;disp( S a l i d a 1 )
disp( ’ ’ ) ;disp( ’ Raiz x EApro x Raiz y EApro y ’ ) disp( S a l i d a 2 )
Programa MATLAB
>>newtonraphsonsev1 (@( x , y ) x ˆ2+ x∗y−10,@( x , y ) y+3∗x∗y ˆ 2−5 7 , 1 . 5 , 3 . 5 , 0 . 0 0 1 )
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