Sie sind auf Seite 1von 18

METODOS NUMERICOS

TAREA NUMERO 1

WILLIAM VARGAS MORENO

MARTIN BARBOSA GARZON

Profesor: LUZ ANGELA SUCERQUIA

UNIVERSIDAD DE ANTIOQUIA
FACULTAD DE INGENIERIA
INGENIERIA DE TELECOMUNICACIONES
METODOS NUMERICOS
2017

PRIMERA PARTE. (Mdulos 1-4)


f ( x) e x x 2 sen( x) 3
1) Considere la funcin:

a. Elabore una tabla de 11 valores igualmente espaciados en el intervalo


2 x2
y llene la siguiente tabla con aproximacin de tres cifras
decimales con redondeo.

f ( x) e x x 2 sen ( x) 3
Tabla 1 Valores igualmente espaciados en el intervalo

k 1 2 3 4 5 6 7 8 9 10 11

x(k ) -2.000 - - - - 0,0000 0.4000 0.8000 1.2000 1.600 2.000


0 1.6000 1.2000 0.8000 0.4000 0 0
y (k ) 0.2260 - - - - - - 0.5830 2.6920 5.513 9.298
1.2380 2.1910 2.6280 2.5590 2.0000 0.9590 0 0
Fuente: Autor
f ( x) e x x 2 sen( x) 3
b. Haga una grfica aproximada de la funcin: .
f ( x) e x x 2 sen( x) 3
Ilustracin 1 Aproximacin de la funcin

Fuente: Autor

>> h=(2+2)/10; -2.0000 0.2260


>> a=[h]; -1.6000 -1.2380
>> b=roundn (h,-3); -1.2000 -2.1910
>> x=-2:b:2; -0.8000 -2.6280
>> y1=roundn (y,-3); -0.4000 -2.5590
>> y=exp(x) 0 -2.0000
+x.^2+sin(x)-3; 0.4000 -0.9590
>> m=[y]; 0.8000 0.5830
>> y1=roundn (y,-3) 1.2000 2.6920
[x' y1'] 1.6000 5.5130
Ans = 2.0000 9.2980
>> plot(x,y1);grid on;

y1 0.2260 -1.2380 -2.1910 -2.6280 -2.5590 -2.0000


-0.9590 0.5830 2.6920 5.5130 9.2980

f ( x) 0 0.0,1.0
c. Para la ecuacin , tomando el intervalo y aplicando el
x4
mtodo de biseccin, determine
f ( x) e x x 2 sen( x) 3
=0
Intervalo [0.0 , 1.0] existe una raz , empleando Matlab en el intervalo
f ( x) 0 0.0,1.0
Ilustracin 2 , tomando el intervalo y aplicando el mtodo de biseccin

Fuente: Autor

k ak bk F ( ak F ( bk xk F( xk
) ) )
1 0.0000 1.0000 -2.0000 1.560 0.5000 -0.622
2 0.5000 1.0000 -0.622 -1.560 0.750 0.361
3 0.500 0.750 0.622 0.361 0.625 -0.156
4 0.625 0.750 -0.156 0.361 0.688 0.098
El valor de x 4 =0.688
f ( x) 0 0.0,1.0
d. Para la ecuacin , tomando el intervalo y aplicando el
x4
mtodo de la regla falsa, determine
k ak bk F ( ak ) F ( mk xk F (
bk ) xk )

1 0.0000 1.0000 -2.0000 1.560 3.560 0.562 -0.397


2 0.562 1.000 -0.397 1.560 4.468 0.651 -0.053
3 0.651 1.0000 -0.053 1.560 4.622 0.662 -0.040
4 -0.662 1.0000 -0.040 1.560 4.734 0.670 0.024

El valor de x 4 =0.670

x1 0.50
e. Determine la raz de la ecuacin 3 con la semilla aplicando la
tcnica SOR.
Solucin:
Intervalo [0.0 1.0]
g ( x) e x x 2 sen( x) 3 x
=0
Despejando
x=g ( x ) =3sen ( x )e x x 2
m
optimo=
m1
m=pendiente
x=G ( X )=X + ( 1 ) g ( x)
El intervalo
[ ak , b ] = [0.0 , 1.0] de esta ecuacin se tiene que: ak =0.0
k ; bk =1.0

Evaluando:
x=g ( x ) =3sen ( x )x 2e x
g ( a )=g ( 0.0 )=3s e n ( 0 )( 0 )2e 0=2

g ( b )=g ( 1.0 ) =3sen ( 1 )12e1=1.5598


g (b)g (a) 3.5598
m= = =3.5598
ba 1
m 3.5598
optimo = =
m1 4.5598 =0.7807
x=G ( X )= X + ( 1 ) g (x)
x=G ( X )=0.7807 X + ( 10.7807 ) ( 3sen ( x )e x x 2

SEMILLA X 1 =0.5
K Xk G (
XK

1 0.5 semilla 0.5267


2 0.5267 0.5267
3 0.5267 0.5267

La convergencia es hacia el valor de la raz X k=0.5267

Tecnica SOR c=m/(m-1);


>> %Tecnica SOR G=cat(2,'c*x+(1-
clear all; close all; c)*','(',g,')');
n=input('numero de iteraciones= '); xe(1)=(a+b)/2;
a=input('limite inferior= '); for k=1:n-1;
b=input('limite superior= '); x=xe(k);
g=input('entre g(x)= '); xe(k+1)=eval(G);
x=b; end
gb=eval(g); xe'sol=xe(n)
x=a; numero de iteraciones= 20
ga=eval(g); limite inferior= 0
m=(gb-ga)/(b-a); limite superior= 1
entre g(x)= '3-sin(x)-x.^2-
exp(x)'

Ans 0.5000 0.5267 0.5267 0.5267 0.5267 0.5267


0.5267 0.5267 0.5267 0.5267 0.5267 0.5267
0.5267 0.5267 0.5267 0.5267 0.5267 0.5267
0.5267 0.5267
Sol 0.5267

x1 0.50
f. Usando el mtodo de Newton-Raphson con la semilla , determine
la raz de la funcin.
Ecuaciones:
f ( x k)
x k+1=x k
f ' ( xk)

f ( x k ) =e x +sen ( x )3

f ' ( x k )=e x +2 x +cos ( x)

k xk f ( x k) f ' (x k ) f ( xk )
f ' ( xk )

1 0.5000 -0.6219 3.5263 -0.1764


2 0.6764 0.0503 4.0994 0.0123
3 0.6641 0.0001 4.0584 0.0000
4 0.6641 0.0001 4.0584 0.0000
La raz de la funcin es 0.6641

x1 0.00 , x 2 1.00
g. Usando el mtodo de la secante con las semillas ,
x6
determine .

Ecuaciones:

f ( x k +1 )f ( x k )
m k+1=
x k+1 xk

f (x k +1)
x k+2=x k +1
mk+ 1

f ( x k ) =e x +sen ( x )3
k xk f ( x k) mk f ( xk )
mk

1 0.0000 -2.0000 xxxx xxxx


2 1.0000 1.5598 3.5598 0.4382
3 0.5618 -0.9208 5.6608 -0.1627
4 0.7245 -0.3988 3.2083 -0.1243
5 0.8488 0.0721 3.7884 0.0190
6 0.8298

x6 = 0.8298

h. Usando el mtodo de Newton-Raphson determine el punto de mnima de la


funcin. Se sugiere llenar la siguiente tabla.

f ( x k ) =e x +sen ( x )3

f ' ( x k )=e x +2 x +cos ( x)


'' x
f ( x k ) =e +2sen ( x)

k xk f ' ( xk ) f ' ' ( xk ) f ' ( xk ) / f ' ' ( xk )

1 -0.5000 0.6064 2.6152 0.2319


2 -0.7319 0.0171 2.4938 0.0068
3 -0.7387 0.0002 2.4906 0.0000
4 -0.7387

El punto de Mnima es -0.7387

f ( x) xe x 2 x 1
2) Considere la funcin:

2 x 2
a. Elabore una tabla de 11 valores igualmente espaciados en el intervalo y llene
la siguiente tabla con aproximacin de tres cifras decimales con redondeo
k 1 2 3 4 5 6 7 8 9 10 11

x(k ) -2.00 - - - - 0.000 0.400 0.800 1.200 1.600 2.00


1.6000 1.200 0.800 0.400 0 0 0 0 0
y (k ) -19.77 -12.12 - - - - 0.068 0.959 1.761 2.523 3.271-
7.380 4.380 2.397 1.000 0 0 0 0 1

b. Haga una grfica aproximada de la funcin

Fuente: Autor
>> h=(2+2)/10; ans =
>> a=[h]; -2.0000 -19.7780
>> b=roundn(h,-3); -1.6000 -12.1250
>> x:-2:b:2; -1.2000 -7.3840
>> y1=roundn(y,-3); -0.8000 -4.3800
>> y=x.*exp(-x)+2.*x-1; -0.4000 -2.3970
>> m=[y]; 0 -1.0000
>> y1=roundn(y,-3); 0.4000 0.0680
>> [x' y1'] 0.8000 0.9590
1.2000 1.7610
1.6000 2.5230
2.0000 3.2710
> plot(x,y1);grid on
c. Puede verse que la ecuacin se puede escribir como:
g ( x) xe x 2 x 1 x
, Complete la siguiente informacin

g (1.0) g (0.0) m
m 3.3679
1.0 (0.0) m 1 =1.4223
2.3679
3.3679
=m=3.3679
1
G ( x ) x (1 ) g ( x)
1.4223 x (0.4223)( x ex +3 x1)

d. Con los resultados previos llene la siguiente tabla

k xk G( xk )

1 0.5000 0.3719
2 0.3719 0.3718
3 0.3718 0.3718
4 0.3718 0.3718
El punto de convergencia es x=0,3718
>> %Tecnica SOR G=cat(2,'c*x+(1-c)*','(',g,')');
clear all; close all; xe(1)=(a+b)/2;
n=input ('numero de iteraciones= for k=1:n-1;
'); x=xe(k);
a=input ('limite inferior= '); xe(k+1)=eval(G);
b=input ('limite superior= '); end
g=input ('entre g(x)= '); xe'sol=xe(n)
x=b; numero de iteraciones= 12
gb=eval(g); limite inferior= -2
x=a; limite superior= 2
ga=eval(g); entre g(x)= 'x.*exp(-x)+3.*x-
m=(gb-ga)/(b-a); 1'
c=m/(m-1);
Ans 0 0.1735 0.2615 0.3094 0.3361 0.3513
0.360 0.3650 0.3679 0.3696 0.3705 0.3711
0
Sol 0.3711

x1 0.50
e. Usando el mtodo de Newton-Raphson con la semilla , determine
la raz de la funcin.

Ecuaciones:
f ( x k)
x k+1=x k
f ' ( xk)

f ( x k ) xe x 2 x 1
f ' ( x k )=ex ex x +2

k xk f (x k ) f ' (x k ) f ( xk )
f ' ( xk )

1 0.5000 0.3033 2.3033 0.1316


2 0.3684 -0.0084 2.4370 -0.0034
3 0.3718 -0.0001 2.4332 -0.0000
4 0.3718

La raz de la funcin es 0.3718

x1 0.0 , x 2 1.0
f. Usando el mtodo de la secante con las semillas ,
x6
determine

Ecuaciones:

f ( x k +1 )f ( x k )
m k+1=
x k+1 xk

f (x k +1)
x k+2=x k +1
mk+ 1

f ( x k ) xe x 2 x 1

k xk f ( x k) mk f ( xk )
mk

1 0.0000 -1.0000 xxxx xxxx


2 1.0000 1.3679 2.3679 0.5777
3 0.4223 0.1214 2.1577 0.0563
4 0.3660 -0.0142 2.4085 -0.0059
5 0.3719 0.0002 2.4407 0.0000
6 0.3719

x6 = 0.3719
SEGUNDA PARTE. (Mdulos 5-8)

1) Considere el sistema de ecuaciones:

x2 y z 4

x y z 2
2

y x z2 3

a. Despeje la variable z de la ecuacin 1 y reemplcela en las ecuaciones 2 y 3.
Grafique el sistema 2x2 resultante.

SOLUCION
2
Despejando z en la primera ecuacin z=4 + yx y sustituirla en la ecuacin
dos y tres.
F ( X , Y )= X 2Y 2 XY 2

G ( X ,Y ) =X 4 +Y 2+ 8 X 22 Y X 2X + 9Y + 13

F='x^2-y^2-x-y-2';
>> G='x^4+y^2-8*x^2-2*x*y^2-x+9*y+13';
>> ezplot(F)
>> hold on; grid on
>> ezplot(G)
>> ezplot('x*y')
>> legend('F','G')
b. Determine todas las races usando el mtodo de Gauss-Seidel
calculo de las races mtodo Gauss -seidel.
c. Determine todas las soluciones del sistema por el mtodo de Newton de tercer orden.

Z =4+ yx 2

Coord. Cuadrante 1
semilla
X 2.2
Y 0.4
Z -0.440
numero de iteraciones= 10
semilla x= 2.2
semilla y= 0.4
semilla z= -0.040
entre F (x, y, z) ='x^2-y+z-4'
entre G (x, y, z) ='x+y^2+z-2'
entre W (x, y, z) ='y-x+z^2-3'

ans =

2.2000 0.4000 -0.0400


6.5362 8.6351 -11.2843
4.3607 4.5148 -5.7682
3.2909 2.4705 -3.2153
2.8313 1.5278 -2.2769
2.7136 1.2255 -2.1240
2.7049 1.1919 -2.1244
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245

>>
Z =4+ yx 2

Coord. semilla Cuadrante III


X= -1.5
Y= -2
Z= 2
numero de iteraciones= 10
semilla x= -1.5
semilla y= -2
semilla z= 2
entre F(x,y,z)='x^2-y+z-4';
entre G(x,y,z)=x+y^2+z-2';
Error using input
Undefined function or variable 'x'.

entre G(x,y,z)='x+y^2+z-2';
entre W(x,y,z)='y-x+z^2-3';

ans =

-1.5000 -2.0000 2.0000


-1.0425 -1.3066 1.8160
-1.0459 -1.1449 1.7613
-1.0514 -1.1378 1.7568
-1.0514 -1.1378 1.7568
-1.0514 -1.1378 1.7568
-1.0514 -1.1378 1.7568
-1.0514 -1.1378 1.7568
-1.0514 -1.1378 1.7568
-1.0514 -1.1378 1.
2
Z =4+ yx

Coord. Cuadrante 1
semilla
X 1
Y -1
Z 2
numero de iteraciones= 10
semilla x= 1
semilla y= -1
semilla z= 2
entre F(x,y,z)='x^2-y+z-4';
entre G(x,y,z)='x+y^2+z-2';
entre W(x,y,z)='y-x+z^2-3';

ans =

1.0000 -1.0000 2.0000


1.6429 0.3571 2.0714
0.8701 -1.5065 2.3335
1.3501 -0.2543 2.1533
4.0384 6.3242 1.2425
2.6714 2.9741 1.7067
1.9367 1.1686 1.9573
1.4292 -0.0834 2.1314
-5.0352 -16.0761 4.3595
Z =4+ yx 2

Coord. Cuadrante 1
semilla
X 3.6
Y 3.7
Z -5.360

numero de iteraciones= 10
semilla x= 3.6
semilla y= 3.7
semilla z= -5.3
entre F(x,y,z)='x^2-y+z-4';
entre G(x,y,z)='x+y^2+z-2';
entre W(x,y,z)=y-x+z^2-3';
Error using input
Undefined function or variable 'y'.

entre W(x,y,z)='y-x+z^2-3';

ans =

3.6000 3.7000 -5.3000


3.0691 2.1141 -3.0231
2.7787 1.4016 -2.2355
2.7085 1.2060 -2.1248
2.7048 1.1916 -2.1244
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245
2.7048 1.1915 -2.1245

2) Un polinomio de variable compleja viene dado por:

P ( z ) a n z n a n 1 z n 1 ... a 2 z 2 a1 z a 0 ; a i C

El polinomio se puede expresar mediante su parte real y su parte imaginaria haciendo


z x jy
as:

P( x jy) u ( x, y ) jv( x, y )

A partir del teorema fundamental del lgebra se puede concluir que un polinomio de grado
n n
tiene exactamente races en el campo de los complejos. Las races se calculan
resolviendo el sistema de ecuaciones no lineales:

u ( x, y ) 0

v ( x, y ) 0

Con base en lo presentado, dado el polinomio de tercer grado:

P ( z ) z 3 jz 2 j 4 z 2 j 5

a. Exprese el polinomio mediante su parte real y su parte imaginaria.


z=x + jy
3
z 3=( x+ jy ) =x ( x 23 y 2 ) + jy ( 3 x 2 y 2)
2 2 2 2
z =( x+ jy ) = x y + j2 xy

j z 2= j ( x+ jy ) =2 xyj 2 xy y 2

j 4 z = j 4 x+jy) =-4y+j4x
p ( z ) =(x^3-3xy^2-2xy-4y+2) +j(3x^2y-y^3+x^2-y^2+4x-5)

p Represente grficamente el sistema


b. >> U='x^3-3*x*y^2-2*x*y-4*y+2';
c. >> v='3*x^2*y-y^3+x^2-y^2+4*x-5';
d. >> ezplot(U)
e. >> hold on; grid on
f. >> ezplot(v)
g. >> ezplot('u*v')
h. >> legend('u','v')

i. Determine las tres races por el mtodo de Newton.

j. Halle las races de manera directa usando roots y compare

Das könnte Ihnen auch gefallen