Está en la página 1de 12

INSTITUTO TECNOLGICO DE

MATEHUALA

MTODOS NUMRICOS
Solucin del Problema 5.4
Equipo # 1
09660296

Ballejo Moran Yosu Sinoe

09660006

Calvo Ontiveros Sandra Ivett

09660019

Grimaldo Perez Luis Angel

09660041

Rangel Gonzalez Ricardo

09660043

Robles Rodriguez Luis Angel

Carrera:

Ingeniera Civil

Semestre: Quinto
Docente:

Ing. Martn Luis Ledezma Hernndez

Periodo:

Agosto-Diciembre 2011

Matehuala, S.L.P.

18 de Octubre 2011

SOLUCIN GRFICA

Como se puede observar en la solucin grfica, tenemos tres races, las cules se
calcularn con el mismo mtodo cada una, llamndolas raz a, b y c
respectivamente.

A) SOLUCIN GFICA: Raz (a), tiene xl=-0.5 y xu=0

B) CDIGO MATLAB PARA ESTA RAZ


i=1;
es=0.05;
ea=100;
xl=-0.5;
xu=0;
x=xl;
fxl=-11-22*x+17*x.^2-2.5*x.^3;
x=xu;
fxu=-11-22*x+17*x.^2-2.5*x.^3;
while es<ea
xr=xu-((fxu*(xl-xu))/(fxl-fxu));
if i~=1; ea=abs(((xr-xra)/xr)*100); end
x=xr;
fxr=-11-22*x+17*x.^2-2.5*x.^3;
if fxl*fxr<0; xu=xr;end
if fxl*fxr>0; xl=xr;end
xra=xr;
ITERACION = [i,xl,xu,xr,ea,es]
i=i+1
end

RESULTADOS QUE SE OBTUVIERON AL CORRER EL CDIGO MATLAB


ITERACION =
1.0000

-0.5000

-0.3534

-0.3534

100.0000

0.0500

-0.4570

-0.3534

-0.4570

22.6708

0.0500

i =
2
ITERACION =
2.0000
i =
3

ITERACION =
3.0000

-0.4266

-0.3534

-0.4266

7.1197

0.0500

-0.4052

-0.3534

-0.4052

5.2990

0.0500

-0.3900

-0.3534

-0.3900

3.8913

0.0500

-0.3900

-0.3793

-0.3793

2.8282

0.0500

-0.3869

-0.3793

-0.3869

1.9599

0.0500

-0.3846

-0.3793

-0.3846

0.5779

0.0500

-0.3831

-0.3793

-0.3831

0.4102

0.0500

-0.3820

-0.3793

-0.3820

0.2908

0.0500

i =
4
ITERACION =
4.0000
i =
5
ITERACION =
5.0000
i =
6
ITERACION =
6.0000
i =
7
ITERACION =
7.0000
i =
8
ITERACION =
8.0000
i =
9
ITERACION =
9.0000
i =
10
ITERACION =
10.0000

i =
11
ITERACION =
11.0000

-0.3820

-0.3812

-0.3812

0.2059

0.0500

-0.3817

-0.3812

-0.3817

0.1453

0.0500

-0.3816

-0.3812

-0.3816

0.0426

0.0500

i =
12
ITERACION =
12.0000
i =
13
ITERACION =
13.0000
i =
14

A) SOLUCIN GRFICA: Raz (b), tiene xl=2 y xu=2.5

B) CDIGO MATLAB PARA ESTA RAZ


i=1;
es=0.05;
ea=100;
xl=2;
xu=2.5;
x=xl;
fxl=-11-22*x+17*x.^2-2.5*x.^3;
x=xu;
fxu=-11-22*x+17*x.^2-2.5*x.^3;
while es<ea
xr=xu-((fxu*(xl-xu))/(fxl-fxu));
if i~=1; ea=abs(((xr-xra)/xr)*100); end
x=xr;
fxr=-11-22*x+17*x.^2-2.5*x.^3;
if fxl*fxr<0; xu=xr;end
if fxl*fxr>0; xl=xr;end
xra=xr;
ITERACION = [i,xl,xu,xr,ea,es]
i=i+1
end

RESULTADOS QUE SE OBTUVIERON AL CORRER EL CDIGO MATLAB


ITERACION =

1.0000

i =

2.0000

2.4275

2.4275

100.0000

0.0500

ITERACION =

2.0000

2.3655

2.4275

2.3655

2.6211

0.0500

2.4185

2.4275

2.4185

2.1918

0.0500

2.4262

2.4275

2.4262

0.3169

0.0500

2.4262

2.4273

2.4273

0.0459

0.0500

i =

ITERACION =

3.0000

i =

ITERACION =

4.0000

i =

ITERACION =

5.0000

i =
6

A) SOLUCIN GRFICA: Raz (c), tiene xl=4.5 y xu=5

B) CDIGO MATLAB PARA ESTA RAZ


i=1;
es=0.05;
ea=100;
xl=4.5;
xu=5;
x=xl;
fxl=-11-22*x+17*x.^2-2.5*x.^3;
x=xu;
fxu=-11-22*x+17*x.^2-2.5*x.^3;
while es<ea
xr=xu-((fxu*(xl-xu))/(fxl-fxu));
if i~=1; ea=abs(((xr-xra)/xr)*100); end
x=xr;
fxr=-11-22*x+17*x.^2-2.5*x.^3;
if fxl*fxr<0; xu=xr;end
if fxl*fxr>0; xl=xr;end
xra=xr;
ITERACION = [i,xl,xu,xr,ea,es]
i=i+1
end

RESULTADOS QUE SE OBTUVIERON AL CORRER EL CDIGO MATLAB


ITERACION =

1.0000

i =

2.0000

2.4275

2.4275

100.0000

0.0500

ITERACION =

2.0000

2.3655

2.4275

2.3655

2.6211

0.0500

2.4185

2.4275

2.4185

2.1918

0.0500

2.4262

2.4275

2.4262

0.3169

0.0500

2.4262

2.4273

2.4273

0.0459

0.0500

i =

ITERACION =

3.0000

i =

ITERACION =

4.0000

i =

ITERACION =

5.0000

i =

ITERACION =

1.0000

4.7155

5.0000

4.7155

100.0000

0.0500

4.7155

4.8381

4.8381

2.5344

0.0500

4.7155

4.7683

4.7683

1.4633

0.0500

4.7383

4.7683

4.7383

0.6346

0.0500

i =

ITERACION =

2.0000

i =

ITERACION =

3.0000

i =

ITERACION =

4.0000

i =

ITERACION =

5.0000

4.7512

4.7683

4.7512

0.2728

0.0500

4.7512

4.7586

4.7586

0.1550

0.0500

4.7544

4.7586

4.7544

0.0883

0.0500

i =

ITERACION =

6.0000

i =

ITERACION =

7.0000

i =

ITERACION =

8.0000

i =

4.7544

4.7562

4.7562

0.0380

0.0500

También podría gustarte