10.05.2013 Views

Resolución de sistemas de ecuaciones - OCW

Resolución de sistemas de ecuaciones - OCW

Resolución de sistemas de ecuaciones - OCW

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.6. Sistemas <strong>de</strong> <strong>ecuaciones</strong> no lineales 11<br />

Test <strong>de</strong> parada<br />

||x (k+1) − x (k) ||<br />

⎧<br />

⎨<br />

⎩<br />

< tol P arar.Solución x (k+1)<br />

≥ tol ∧ k ≤ Max − iteraciones Siguiente iteración<br />

≥ tol ∧ k > Max − iteraciones Parar. No converge<br />

Ejercicio 16 Programar el método <strong>de</strong> Gauss-Sei<strong>de</strong>l a partir <strong>de</strong>l <strong>de</strong> Jacobi.<br />

Ejercicio 17 Repetir el ejercicio 15 utilizando el método <strong>de</strong> Gauss-Sei<strong>de</strong>l.<br />

1.6. Sistemas <strong>de</strong> <strong>ecuaciones</strong> no lineales<br />

Ahora consi<strong>de</strong>raremos un sistema <strong>de</strong> n <strong>ecuaciones</strong> y n incógnitas<br />

f1(x1, . . . , xn) = 0<br />

. . .<br />

fn(x1, . . . , xn) = 0<br />

<strong>de</strong>notando f = (f1, . . . , fn) y x = (x1, . . . , xn), el sistema pue<strong>de</strong> representarse por:<br />

f(x) = 0<br />

Se consi<strong>de</strong>ra entonces el problema <strong>de</strong> hallar r ∈ R n tal que f(r) = 0.<br />

1.6.1. Método <strong>de</strong> punto fijo<br />

Al igual que en una variable, el método <strong>de</strong> punto fijo consiste en hallar una función continua<br />

g <strong>de</strong> forma que si g(r) = r entonces f(r) = 0.<br />

A partir <strong>de</strong> la función <strong>de</strong> iteración g se plantea el procedimiento iterativo:<br />

Para x (0) dado<br />

x (m+1) = g(x (m) ) con m ∈ N<br />

Programación <strong>de</strong>l método:<br />

function [x,iter]= ptofijoN(fun,x0,tol,maxiter)<br />

% function [x,iter]= ptofijoN(fun,x0,tol,maxiter)<br />

% Método <strong>de</strong> punto fijo para resolver el<br />

% sistema n x n : fun(x) = x<br />

% x ...... Solución<br />

% iter..... Número <strong>de</strong> iteraciones empleadas<br />

% x0 ...... Estimación inicial (DIMENSION n x 1)<br />

% fun ..... Función vectorial (DIMENSION n x 1)<br />

% tol ..... Tolerancia relativa permitida<br />

% maxiter . Numero Máximo <strong>de</strong> Iteraciones<br />

if nargin == 2 , maxiter=500; tol=5e-6; end<br />

if nargin == 3 , maxiter=500; end

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!