Você está na página 1de 14

MÉTODO DE BISECCION CON MATLAB – GRUPO B

a) Ubicar gráficamente el cero (o ceros) de cada una de las funciones, procurando convertir
la ecuación 𝑓(𝑥) = 0 en otra ecuación de la forma 𝑓1 (𝑥) = 𝑓2 (𝑥), donde 𝑓1 𝑦 𝑓2 sean
funciones cuyas gráficas sean conocidas.
b) Utilice el programa para el método de bisección en MATLAB para hallar en forma
aproximada el cero (o ceros) de 𝑓1 con la tolerancia especificada para dada función.

Ejercicio 1:

F(x)=𝑥 2 − 1 − 2𝑥, tolerancia = 10−8

FUNCIÓN GENERAL:
function y=F1(x)
y=x^2-1-2*x;
end

SUBFUNCIONES:
clc
clear
x=-4:0.01:4;
y1=x^2;
y2=1+2*x
plot(x,y1,'r',x,y2,'k')
grid on

20

15

10

-5

-10
-4 -3 -2 -1 0 1 2 3 4

SOLUCIÓN: [c]=bisec('F1',2,3,10^-8)
1 2.000000000000 3.000000000000 2.500000000000 0.250000000000

2 2.000000000000 2.500000000000 2.250000000000 -0.437500000000

3 2.000000000000 2.250000000000 2.125000000000 -0.734375000000

4 2.125000000000 2.250000000000 2.187500000000 -0.589843750000

5 2.187500000000 2.250000000000 2.218750000000 -0.514648437500

6 2.218750000000 2.250000000000 2.234375000000 -0.476318359375

7 2.234375000000 2.250000000000 2.242187500000 -0.456970214844

8 2.242187500000 2.250000000000 2.246093750000 -0.447250366211

9 2.246093750000 2.250000000000 2.248046875000 -0.442378997803

10 2.248046875000 2.250000000000 2.249023437500 -0.439940452576

11 2.249023437500 2.250000000000 2.249511718750 -0.438720464706

12 2.249511718750 2.250000000000 2.249755859375 -0.438110291958

13 2.249755859375 2.250000000000 2.249877929688 -0.437805160880

14 2.249877929688 2.250000000000 2.249938964844 -0.437652584165

15 2.249938964844 2.250000000000 2.249969482422 -0.437576293014

16 2.249969482422 2.250000000000 2.249984741211 -0.437538146740

17 2.249984741211 2.250000000000 2.249992370605 -0.437519073428

18 2.249992370605 2.250000000000 2.249996185303 -0.437509536729

19 2.249996185303 2.250000000000 2.249998092651 -0.437504768368

20 2.249998092651 2.250000000000 2.249999046326 -0.437502384185

21 2.249999046326 2.250000000000 2.249999523163 -0.437501192093

22 2.249999523163 2.250000000000 2.249999761581 -0.437500596046

23 2.249999761581 2.250000000000 2.249999880791 -0.437500298023

24 2.249999880791 2.250000000000 2.249999940395 -0.437500149012

25 2.249999940395 2.250000000000 2.249999970198 -0.437500074506

26 2.249999970198 2.250000000000 2.249999985099 -0.437500037253

27 2.249999985099 2.250000000000 2.249999992549 -0.437500018626

c=

2.2500
Ejercicio 2:
2
F(x)=𝑥 2 − 𝑐𝑜𝑠𝑥, tolerancia = 5x10−8
3

FUNCIÓN GENERAL:
function y=F2(x)
y=x.^2-(2/3)*cos(x);
end

SUBFUNCIONES:
clc
clear
x=-1:0.01:3;
y1=x.^2;
y2=(2/3)*cos(x);
plot(x,y1,'r',x,y2,'k')
grid on

-1
-1 -0.5 0 0.5 1 1.5 2 2.5 3

SOLUCIÓN: [c]=bisec('F2',0.7,1.5,5*10^-8)

1 0.700000000000 1.500000000000 1.100000000000 0.907602585716

2 0.700000000000 1.100000000000 0.900000000000 0.395593354486

3 0.700000000000 0.900000000000 0.800000000000 0.175528860435

4 0.700000000000 0.800000000000 0.750000000000 0.074707420751

5 0.700000000000 0.750000000000 0.725000000000 0.026625385356


6 0.700000000000 0.725000000000 0.712500000000 0.003169634413

7 0.700000000000 0.712500000000 0.706250000000 -0.008411547285

8 0.700000000000 0.706250000000 0.703125000000 -0.014165418182

9 0.703125000000 0.706250000000 0.704687500000 -0.011291544105

10 0.704687500000 0.706250000000 0.705468750000 -0.009852310935

11 0.705468750000 0.706250000000 0.705859375000 -0.009132120407

12 0.705859375000 0.706250000000 0.706054687500 -0.008771881669

13 0.706054687500 0.706250000000 0.706152343750 -0.008591726432

14 0.706152343750 0.706250000000 0.706201171875 -0.008501639847

15 0.706201171875 0.706250000000 0.706225585937 -0.008456594313

16 0.706225585937 0.706250000000 0.706237792969 -0.008434070986

17 0.706237792969 0.706250000000 0.706243896484 -0.008422809182

18 0.706243896484 0.706250000000 0.706246948242 -0.008417178245

19 0.706246948242 0.706250000000 0.706248474121 -0.008414362768

20 0.706248474121 0.706250000000 0.706249237061 -0.008412955027

21 0.706249237061 0.706250000000 0.706249618530 -0.008412251156

22 0.706249618530 0.706250000000 0.706249809265 -0.008411899220

23 0.706249809265 0.706250000000 0.706249904633 -0.008411723253

24 0.706249904633 0.706250000000 0.706249952316 -0.008411635269

c=

0.7062
Ejercicio 3:

F(x) = cos 3𝑥 + 𝑥 3 , tolerancia = 10−9

FUNCIÓN GENERAL:
function y=F3(x)
y=cos(3*x)+x.^3;
end

SUBFUNCIONES:

clc
clear
x=-1:0.01:1;
y1=-cos(3*x);
y2=x.^3;
plot(x,y1,'g',x,y2,'c')
grid on

0.8

0.6

0.4

0.2

-0.2

-0.4

-0.6

-0.8

-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1

SOLUCIÓN: [c]=bisec('F3',-2,1,10^-9)

1 -2.000000000000 1.000000000000 -0.500000000000 -0.054262798332

2 -2.000000000000 -0.500000000000 -1.250000000000 -2.773684357340

3 -1.250000000000 -0.500000000000 -0.875000000000 -1.539429056466

4 -0.875000000000 -0.500000000000 -0.687500000000 -0.797079583172

5 -0.687500000000 -0.500000000000 -0.593750000000 -0.418223653157


6 -0.593750000000 -0.500000000000 -0.546875000000 -0.233327084360

7 -0.546875000000 -0.500000000000 -0.523437500000 -0.142931147437

8 -0.523437500000 -0.500000000000 -0.511718750000 -0.098364133297

9 -0.511718750000 -0.500000000000 -0.505859375000 -0.076253146038

10 -0.505859375000 -0.500000000000 -0.502929687500 -0.065242628738

11 -0.502929687500 -0.500000000000 -0.501464843750 -0.059748844754

12 -0.501464843750 -0.500000000000 -0.500732421875 -0.057004850234

13 -0.500732421875 -0.500000000000 -0.500366210938 -0.055633580942

14 -0.500366210938 -0.500000000000 -0.500183105469 -0.054948128738

15 -0.500183105469 -0.500000000000 -0.500091552734 -0.054605448302

16 -0.500091552734 -0.500000000000 -0.500045776367 -0.054434119508

17 -0.500045776367 -0.500000000000 -0.500022888184 -0.054348457968

18 -0.500022888184 -0.500000000000 -0.500011444092 -0.054305627912

19 -0.500011444092 -0.500000000000 -0.500005722046 -0.054284213063

20 -0.500005722046 -0.500000000000 -0.500002861023 -0.054273505683

21 -0.500002861023 -0.500000000000 -0.500001430511 -0.054268152004

22 -0.500001430511 -0.500000000000 -0.500000715256 -0.054265475167

23 -0.500000715256 -0.500000000000 -0.500000357628 -0.054264136749

24 -0.500000357628 -0.500000000000 -0.500000178814 -0.054263467541

25 -0.500000178814 -0.500000000000 -0.500000089407 -0.054263132937

26 -0.500000089407 -0.500000000000 -0.500000044703 -0.054262965634

27 -0.500000044703 -0.500000000000 -0.500000022352 -0.054262881983

28 -0.500000022352 -0.500000000000 -0.500000011176 -0.054262840158

29 -0.500000011176 -0.500000000000 -0.500000005588 -0.054262819245

30 -0.500000005588 -0.500000000000 -0.500000002794 -0.054262808789

31 -0.500000002794 -0.500000000000 -0.500000001397 -0.054262803560

32 -0.500000001397 -0.500000000000 -0.500000000698 -0.054262800946

c=

-0.5000
Ejercicio 4:

F(x) = 𝑥 3 − 𝑥 2 + 2𝑥 + 8, tolerancia = 5x10−8

FUNCIÓN GENERAL:
function y=F4(x)
y=x.^3-x.^2+2*x+8;
end

SUBFUNCIONES:

clc
clear
x=-3:0.01:3;
y1=x.^3;
y2=x.^2-2*x-8;
plot(x,y1,'c',x,y2,'b')
grid on

30

20

10

-10

-20

-30
-3 -2 -1 0 1 2 3

SOLUCIÓN: [c]=bisec('F4',-1.5,0,5*10^-7)

1 -1.500000000000 0.000000000000 -0.750000000000 5.515625000000

2 -1.500000000000 -0.750000000000 -1.125000000000 3.060546875000

3 -1.500000000000 -1.125000000000 -1.312500000000 1.391357421875

4 -1.500000000000 -1.312500000000 -1.406250000000 0.429046630859

5 -1.500000000000 -1.406250000000 -1.453125000000 -0.086200714111

6 -1.500000000000 -1.453125000000 -1.476562500000 -0.352617740631


7 -1.476562500000 -1.453125000000 -1.464843750000 -0.218668401241

8 -1.464843750000 -1.453125000000 -1.458984375000 -0.152249954641

9 -1.458984375000 -1.453125000000 -1.456054687500 -0.119179259054

10 -1.456054687500 -1.453125000000 -1.454589843750 -0.102678477182

11 -1.454589843750 -1.453125000000 -1.453857421875 -0.094436719475

12 -1.453857421875 -1.453125000000 -1.453491210938 -0.090317997898

13 -1.453491210938 -1.453125000000 -1.453308105469 -0.088259176299

14 -1.453308105469 -1.453125000000 -1.453216552734 -0.087229900281

15 -1.453216552734 -1.453125000000 -1.453170776367 -0.086715295966

16 -1.453170776367 -1.453125000000 -1.453147888184 -0.086458002231

17 -1.453147888184 -1.453125000000 -1.453136444092 -0.086329357469

18 -1.453136444092 -1.453125000000 -1.453130722046 -0.086265035615

19 -1.453130722046 -1.453125000000 -1.453127861023 -0.086232874819

20 -1.453127861023 -1.453125000000 -1.453126430511 -0.086216794454

21 -1.453126430511 -1.453125000000 -1.453125715256 -0.086208754280

22 -1.453125715256 -1.453125000000 -1.453125357628 -0.086204734195

c=

-1.4531
Ejercicio 5:
𝑥⁄
F(x) = 𝑥𝑒 4 – 6, tolerancia = 10−8

FUNCIÓN GENERAL:
function y=f5(x)
y=x*exp(x)^(x/4)-6;
end

SUBFUNCIONES:
clc
clear
x=-25:0.01:25;
y1=exp(x).^(x./4);
y2=6./x;
plot(x,y1,'b',x,y2,'c')
grid on
axis([-5 5 -500 500])

500

400

300

200

100

-100

-200

-300

-400

-500
-5 -4 -3 -2 -1 0 1 2 3 4 5

SOLUCIÓN: [c]=bisec('F5',2,10,10^-6)

1 2.000000000000 10.000000000000 6.00000000000048612.503565452302

2 2.000000000000 6.000000000000 4.000000000000 212.392600132577

3 2.000000000000 4.000000000000 3.000000000000 22.463207509076

4 2.000000000000 3.000000000000 2.500000000000 5.926832954919

5 2.000000000000 2.500000000000 2.250000000000 1.976942687753


6 2.000000000000 2.250000000000 2.125000000000 0.571079013206

7 2.000000000000 2.125000000000 2.062500000000 -0.026127352776

8 2.000000000000 2.062500000000 2.031250000000 -0.301827509555

9 2.031250000000 2.062500000000 2.046875000000 -0.165791811149

10 2.046875000000 2.062500000000 2.054687500000 -0.096419986033

11 2.054687500000 2.062500000000 2.058593750000 -0.061389633648

12 2.058593750000 2.062500000000 2.060546875000 -0.043787592942

13 2.060546875000 2.062500000000 2.061523437500 -0.034964761423

14 2.061523437500 2.062500000000 2.062011718750 -0.030547880948

15 2.062011718750 2.062500000000 2.062255859375 -0.028338073037

16 2.062255859375 2.062500000000 2.062377929688 -0.027232826977

17 2.062377929688 2.062500000000 2.062438964844 -0.026680118398

18 2.062438964844 2.062500000000 2.062469482422 -0.026403742718

19 2.062469482422 2.062500000000 2.062484741211 -0.026265549530

20 2.062484741211 2.062500000000 2.062492370605 -0.026196451599

21 2.062492370605 2.062500000000 2.062496185303 -0.026161902299

22 2.062496185303 2.062500000000 2.062498092651 -0.026144627565

23 2.062498092651 2.062500000000 2.062499046326 -0.026135990178

c=

2.0625
Ejercicio 6:

F(x) = (𝑥 − 3)3 − ln(2𝑥), tolerancia = 10−10

FUNCIÓN GENERAL:
function y=F6(x)
y=(x-3).^3-log(2*x);
end

SUBFUNCIONES:
clc
clear
x=0:0.01:11;
y1=(x-3).^3;
y2=log(2*x);
plot(x,y1,'r',x,y2,'c')
grid on

600

500

400

300

200

100

-100
0 2 4 6 8 10 12

SOLUCIÓN: [c]=bisec('F6',4.2,9.99,10^-10)

1 4.200000000000 9.990000000000 7.095000000000 66.016619883828

2 4.200000000000 7.095000000000 5.647500000000 16.132645771955

3 4.200000000000 5.647500000000 4.923750000000 4.832223436871

4 4.200000000000 4.923750000000 4.561875000000 1.599240555933

5 4.200000000000 4.561875000000 4.380937500000 0.463021841355

6 4.200000000000 4.380937500000 4.290468750000 -0.000513182195

7 4.200000000000 4.290468750000 4.245234375000 -0.208073019303


8 4.245234375000 4.290468750000 4.267851562500 -0.106252802536

9 4.267851562500 4.290468750000 4.279160156250 -0.053877237820

10 4.279160156250 4.290468750000 4.284814453125 -0.027319311388

11 4.284814453125 4.290468750000 4.287641601563 -0.013947339640

12 4.287641601563 4.290468750000 4.289055175781 -0.007238042568

13 4.289055175781 4.290468750000 4.289761962891 -0.003877558849

14 4.289761962891 4.290468750000 4.290115356445 -0.002195857271

15 4.290115356445 4.290468750000 4.290292053223 -0.001354641437

16 4.290292053223 4.290468750000 4.290380401611 -0.000933942244

17 4.290380401611 4.290468750000 4.290424575806 -0.000723569827

18 4.290424575806 4.290468750000 4.290446662903 -0.000618377913

19 4.290446662903 4.290468750000 4.290457706451 -0.000565780530

20 4.290457706451 4.290468750000 4.290463228226 -0.000539481481

21 4.290463228226 4.290468750000 4.290465989113 -0.000526331868

22 4.290465989113 4.290468750000 4.290467369556 -0.000519757039

23 4.290467369556 4.290468750000 4.290468059778 -0.000516469619

24 4.290468059778 4.290468750000 4.290468404889 -0.000514825908

25 4.290468404889 4.290468750000 4.290468577445 -0.000514004052

26 4.290468577445 4.290468750000 4.290468663722 -0.000513593123

27 4.290468663722 4.290468750000 4.290468706861 -0.000513387659

28 4.290468706861 4.290468750000 4.290468728431 -0.000513284927

29 4.290468728431 4.290468750000 4.290468739215 -0.000513233561

30 4.290468739215 4.290468750000 4.290468744608 -0.000513207878

31 4.290468744608 4.290468750000 4.290468747304 -0.000513195037

32 4.290468747304 4.290468750000 4.290468748652 -0.000513188616

33 4.290468748652 4.290468750000 4.290468749326 -0.000513185406

34 4.290468749326 4.290468750000 4.290468749663 -0.000513183800

35 4.290468749663 4.290468750000 4.290468749831 -0.000513182998

36 4.290468749831 4.290468750000 4.290468749916 -0.000513182597

c=

4.2905
Ejercicio 7:

F(x) = 𝑥 3 + 3 − exp(𝑥); tolerancia = 10−6

FUNCIÓN GENERAL:
function y=F7(x)
y=x.^3+3-exp(x);
end

SUBFUNCIONES:
clc
clear
x=-4:0.01:4;
y1=x.^3+3;
y2=exp(x);
plot(x,y1,'r',x,y2,'b')
grid on

80

60

40

20

-20

-40

-60

-80
-4 -3 -2 -1 0 1 2 3 4

SOLUCIÓN: [c]=bisec('F7',-2,2.7,10^-6)

1 -2.000000000000 2.700000000000 0.350000000000 1.623807451407

2 -2.000000000000 0.350000000000 -0.825000000000 2.000249382535

3 -2.000000000000 -0.825000000000 -1.412500000000 -0.061691890383

4 -2.000000000000 -1.412500000000 -1.706250000000 -2.148932275534

5 -1.706250000000 -1.412500000000 -1.559375000000 -1.002122275177

6 -1.559375000000 -1.412500000000 -1.485937500000 -0.507255330902

7 -1.485937500000 -1.412500000000 -1.449218750000 -0.278453537913


8 -1.449218750000 -1.412500000000 -1.430859375000 -0.168585531202

9 -1.430859375000 -1.412500000000 -1.421679687500 -0.114769142989

10 -1.421679687500 -1.412500000000 -1.417089843750 -0.088138403133

11 -1.417089843750 -1.412500000000 -1.414794921875 -0.074892153164

12 -1.414794921875 -1.412500000000 -1.413647460938 -0.068286277724

13 -1.413647460938 -1.412500000000 -1.413073730469 -0.064987648584

14 -1.413073730469 -1.412500000000 -1.412786865234 -0.063339410684

15 -1.412786865234 -1.412500000000 -1.412643432617 -0.062515560842

16 -1.412643432617 -1.412500000000 -1.412571716309 -0.062103703191

17 -1.412571716309 -1.412500000000 -1.412535858154 -0.061897791182

18 -1.412535858154 -1.412500000000 -1.412517929077 -0.061794839381

19 -1.412517929077 -1.412500000000 -1.412508964539 -0.061743364532

20 -1.412508964539 -1.412500000000 -1.412504482269 -0.061717627370

21 -1.412504482269 -1.412500000000 -1.412502241135 -0.061704758854

22 -1.412502241135 -1.412500000000 -1.412501120567 -0.061698324613

23 -1.412501120567 -1.412500000000 -1.412500560284 -0.061695107497

c=

-1.4125

Você também pode gostar