sistemas de ecuaciones no lineales · beamer-tu-logo introduccion´ iteracion de punto fijo´...

Post on 14-Mar-2020

24 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

beamer-tu-logo

Sistemas de ecuaciones no lineales

Curso: Metodos Numericos en IngenierıaProfesor: Dr. Jose A. Otero HernandezCorreo: j.a.otero@tec.mxweb: http://metodosnumericoscem.weebly.comUniversidad: ITESM CEM

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Topicos

1 INTRODUCCIONSistema de ecuaciones no lineales

2 ITERACION DE PUNTO FIJOPresentacion del metodoPrograma MATLABCondicion de convergencia

3 NEWTON-RAPHSONPresentacion del metodoPrograma MATLAB

4 Problema

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Topicos

1 INTRODUCCIONSistema de ecuaciones no lineales

2 ITERACION DE PUNTO FIJOPresentacion del metodoPrograma MATLABCondicion de convergencia

3 NEWTON-RAPHSONPresentacion del metodoPrograma MATLAB

4 Problema

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Sistema de ecuaciones no lineales

¿Que es un sistema de ecuaciones no lineales?

f1(x1, x2, ..., xn) = 0,f2(x1, x2, ..., xn) = 0,

...fn(x1, x2, ..., xn) = 0.

¿Que es un sistema de ecuaciones no lineales?xi, i = 1, 2, . . . , n→ Incognitasfi, i = 1, 2, . . . , n→ Funciones no lineales con respecto xi

Ejemplos

u(x, y) = x2 + x y − 10 = 0v(x, y) = y + 3x y2 − 57 = 0

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Sistema de ecuaciones no lineales

SolucionSi xs = [xs1, x

s2, ..., x

sn], es la solucion del sistema de

ecuacionesEntonces: fi(xs) = 0, para i = 1, 2, . . . , n

Solucion exactaLos sistemas de ecuaciones no lineales no tienen solucionexacta o analıtica.Soluciones numericas son necesarias

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Topicos

1 INTRODUCCIONSistema de ecuaciones no lineales

2 ITERACION DE PUNTO FIJOPresentacion del metodoPrograma MATLABCondicion de convergencia

3 NEWTON-RAPHSONPresentacion del metodoPrograma MATLAB

4 Problema

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Presentacion del metodo

Metodos de iteracion de punto fijoEl metodo de iteracion de punto fijo estudiado anteriormentepuede modificarse para resolver un sistema de ecuaciones nolineales simultaneas.

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Presentacion del metodo

Ejemplos IBusquemos la solucion del sistema de ecuaciones no lineales:

u(x, y) = x2 + x y − 10 = 0v(x, y) = y + 3x y2 − 57 = 0

Hallar la funcion gx(x, y):

gx (x, y) =10− x2

y

Hallar la funcion gy(x, y):

gy (x, y) = 57− 3xy2

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Presentacion del metodo

Algoritmoxi+1 = gx (xi, yi)

yi+1 = gy (xi+1, yi)

Algoritmo: Ejemplos I

xi+1 =10−x2

iyi

yi+1 = 57− 3xi+1 y2i

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

function pun to f i j osenv1 ( gx , gy , x0 , y0 ,EE)% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% punto f i j osenv1 : Nombre de l a func ion% Valores de entrada% gx : func ion matematica de entrada−>x=gx ( x , y )% gy : func ion 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: Er ro r Estimado% Valores de s a l i d a% Sal ida : Raiz x , EA x , Raiz y , EA y% IM : I t e r a c i o n 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;

endSal ida1 =[ ’ I t e r a c i o n Maxima= ’ ,num2str ( IM−1) ] ;Sal ida2 =[ x ( 2 : size ( x , 2 ) ) ’ EAx ( 2 : size ( x , 2 ) ) ’ y ( 2 : size ( y , 2 ) ) ’ EAy ( 2 : size ( y , 2 ) ) ’ ] ;disp ( ’ ’ )disp ( Sal ida1 )disp ( ’ ’ )disp ( ’ Raiz x EApro x Raiz y EApro y ’ )disp ( Sal ida2 )

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

>> pun to f i j osenv1 (@( x , y ) (10−x ˆ 2 ) / y ,@( x , y ) 57−3∗x∗y ˆ2 ,1 .5 ,3 .5 ,0 .001 )

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

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

Ejemplos IIBusquemos la solucion del sistema de ecuaciones no lineales:

u(x, y) = x2 + x y − 10 = 0v(x, y) = y + 3x y2 − 57 = 0

Hallar la funcion gx(x, y):

gx (x, y) =√

10− xy

Hallar la funcion gy(x, y):

gy (x, y) =

√57− y

3x

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

Algoritmo

xi+1 =√10− xiyi

yi+1 =√

57−yi3xi+1

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

>> pun to f i j osenv1 (@( 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 y2.1794 31.1753 2.8605 22.35601.9405 12.3118 3.0496 6.19912.0205 3.9557 2.9834 2.21711.9930 1.3762 3.0057 0.74192.0024 0.4673 2.9981 0.25521.9992 0.1601 3.0007 0.08702.0003 0.0547 2.9998 0.02981.9999 0.0187 3.0001 0.01022.0000 0.0064 3.0000 0.00352.0000 0.0022 3.0000 0.00122.0000 0.0007 3.0000 0.0004

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Condicion de convergencia

Convergencia

∣∣∣∣∂gx∂x

∣∣∣∣+ ∣∣∣∣∂gx∂y

∣∣∣∣ < 1∣∣∣∣∂gy∂x

∣∣∣∣+ ∣∣∣∣∂gy∂y

∣∣∣∣ < 1

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Topicos

1 INTRODUCCIONSistema de ecuaciones no lineales

2 ITERACION DE PUNTO FIJOPresentacion del metodoPrograma MATLABCondicion de convergencia

3 NEWTON-RAPHSONPresentacion del metodoPrograma MATLAB

4 Problema

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Presentacion del metodo

Metodos de Newton-RaphsonEl metodo de Newton-Raphson estudiado anteriormente puedemodificarse para resolver un sistema de ecuaciones no linealessimultaneas.

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Presentacion del metodo

Serie de Taylor de multiples variables

ui+1 = ui + (xi+1 − xi)∂ui∂x

+ (yi+1 − yi)∂ui∂y

vi+1 = vi + (xi+1 − xi)∂vi∂x

+ (yi+1 − yi)∂vi∂y

Considerando ui+1 = vi+1 = 0, para las raıces aproximadas,llegamos a un sistema de ecuaciones para determinar xi+1 yyi+1:

Serie de Taylor de multiples variables

xi+1∂ui∂x

+ yi+1∂ui∂y

= −ui + xi∂ui∂x

+ yi∂ui∂y

xi+1∂vi∂x

+ yi+1∂vi∂y

= −vi + xi∂vi∂x

+ yi∂vi∂y

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Presentacion del metodo

Formula de Newton-Raphson

xi+1 = xi −ui

∂vi∂y − vi

∂ui∂y

∂ui∂x

∂vi∂y −

∂ui∂y

∂vi∂x

yi+1 = yi −vi

∂ui∂x − ui

∂vi∂x

∂ui∂x

∂vi∂y −

∂ui∂y

∂vi∂x

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

function newtonraphsonsenv1 ( u , v , x0 , y0 ,EE)% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %% newtonraphsonSENv1 : Nombre de l a func ion% Valores de entrada% u , v : func iones 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: Er ro r Estimado% Valores de s a l i d a% Sal ida : IM : I t e r a c i o n Maxima , Raiz y Er ro r Aproximado% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %syms x ydux=@( 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;

endSal ida1 =[ ’ I t e r a c i o n Maxima= ’ ,num2str ( IM−1) ] ;Sal ida2 =[ rx ( 2 : size ( rx , 2 ) ) ’ EAx ( 2 : size ( rx , 2 ) ) ’ r y ( 2 : size ( ry , 2 ) ) ’ EAy ( 2 : size ( ry , 2 ) ) ’ ] ;disp ( ’ ’ ) ; disp ( Sal ida1 )disp ( ’ ’ ) ; disp ( ’ Raiz x EApro x Raiz y EApro y ’ )disp ( Sal ida2 )

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Programa MATLAB

>> 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 y2.0360 26.3272 2.8439 23.07151.9987 1.8676 3.0023 5.27642.0000 0.0650 3.0000 0.07632.0000 0.0000 3.0000 0.0000

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

Topicos

1 INTRODUCCIONSistema de ecuaciones no lineales

2 ITERACION DE PUNTO FIJOPresentacion del metodoPrograma MATLABCondicion de convergencia

3 NEWTON-RAPHSONPresentacion del metodoPrograma MATLAB

4 Problema

beamer-tu-logo

INTRODUCCION ITERACION DE PUNTO FIJO NEWTON-RAPHSON Problema

ProblemaEncuentre las raıces de las ecuaciones simultaneas siguiente:

y = x2 + 1

y = 2 cos(x)

a) Utilizando el metodo de punto fijo con los valoresiniciales x0 = 1 y y0 = 1 hasta que el erroraproximado porcentual sea menor que el errorestimado de 0.2%

b) Utilizando el metodo de Newton-Raphson con losvalores iniciales x0 = 1 y y0 = 1 hasta que el erroraproximado porcentual sea menor que el errorestimado de 0.5%.

top related