Está en la página 1de 14

PRACTICA 8

METODO NUMERICO

1.- >> simpsontruncado

ingresa la funcion=(x^5)+x+2

f1 =

(x^5)+x+2

limite inferior intervalo=-1

a=

-1

limite superior intervalo=0

b=

ingrese numero de divisines=2

n=

H=

0.5000

h=

0.2500

X=

0 0 0

X=

-1 0 0

X=

-1.0000 -0.5000 0

X=

-1.0000 -0.5000 0

f=

Inline function:

f(x) = (x^5)+x+2

d4x =
120*x

I=

ET =

C=

120

ET =

0.0013

C=

60

ET =

0.0020

el resultado de la I

1.332

el error es

0.001953

2.-

>> simpsontruncado

ingresa la funcion=(exp(x/2))/x

f1 =

(exp(x/2))/x

limite inferior intervalo=1

a=

limite superior intervalo=3

b=

ingrese numero de divisines=2

n=

2
H=

h=

0.5000

X=

0 0 0

X=

1 0 0

X=

1 2 0

X=

1 2 3

f=

Inline function:

f(x) = (exp(x/2))/x

d4x =

exp(x/2)/(16*x) - exp(x/2)/(2*x^2) + (3*exp(x/2))/x^3 - (12*exp(x/2))/x^4 + (24*exp(x/2))/x^5

I=

ET =

C=

24.0095

ET =

0.0083

C=

0.7645

ET =

0.0086

el resultado de la I

2.848
el error es

0.008602

3.-

>> simpsontruncado

ingresa la funcion=sin(2*x)

f1 =

sin(2*x)

limite inferior intervalo=0

a=

limite superior intervalo=pi/2

b=

1.5708

ingrese numero de divisines=2

n=

H=

0.7854

h=

0.3927

X=

0 0 0

X=

0 0 0

X=

0 0.7854 0

X=

0 0.7854 1.5708

f=

Inline function:

f(x) = sin(2*x)
d4x =

16*sin(2*x)

I=

ET =

C=

16

ET =

0.0017

C=

16

ET =

0.0033

el resultado de la I

1.002

el error es

0.003321

4.-

>> simpsontruncado

ingresa la funcion=log(x/3)

f1 =

log(x/3)

limite inferior intervalo=2

a=

limite superior intervalo=3

b=

ingrese numero de divisines=2

n=
2

H=

0.5000

h=

0.2500

X=

0 0 0

X=

2 0 0

X=

2.0000 2.5000 0

X=

2.0000 2.5000 3.0000

f=

Inline function:

f(x) = log(x/3)

d4x =

-6/x^4

I=

ET =

C=

0.3750

ET =

4.0690e-06

C=

0.1536

ET =

5.7357e-06
el resultado de la I

-0.1891

el error es

5.736e-6

5.-

>> simpsontruncado

ingresa la funcion=(x-2)^6

f1 =

(x-2)^6

limite inferior intervalo=1

a=

limite superior intervalo=3

b=

ingrese numero de divisines=2

n=

H=

h=

0.5000

X=

0 0 0

X=

1 0 0

X=

1 2 0

X=

1 2 3

f=
Inline function:

f(x) = (x-2)^6

d4x =

360*(x - 2)^2

I=

ET =

C=

360

ET =

0.1250

C=

360

ET =

0.2500

el resultado de la I

0.3542

el error es

0.25

METODO DE EULER:

1.-

>> euler

ingresa funcion=y/x

g=

y/x

ingresa valor X1=3

X1 =

ingresa valor Y1=4


Y1 =

ingresa valor b=4

b=

ingresa valor n=2

n=

h=

0.5000

X=

3 0 0

X=

3.0000 3.5000 0

X=

3.0000 3.5000 4.0000

Y=

4 0 0

mostrar x

3.0000 3.5000 4.0000

mostrar Y

4.0000 4.6667 5.3333

2.-

>> euler

Undefined function or variable 'euler'.

>> euler

ingresa funcion=x-6*y

g=

x-6*y

ingresa valor X1=0


X1 =

ingresa valor Y1=4

Y1 =

ingresa valor b=2

b=

ingresa valor n=4

n=

h=

0.5000

X=

0 0 0 0 0

X=

0 0.5000 0 0 0

X=

0 0.5000 1.0000 0 0

X=

0 0.5000 1.0000 1.5000 0

X=

0 0.5000 1.0000 1.5000 2.0000

Y=

4 0 0 0 0

mostrar x

0 0.5000 1.0000 1.5000 2.0000

mostrar Y

4.0000 -8.0000 16.2500 -32.0000 64.7500

3.-

>> euler
ingresa funcion=(-3*x)/2*y

g=

(-3*x)/2*y

ingresa valor X1=1

X1 =

ingresa valor Y1=-1

Y1 =

-1

ingresa valor b=3

b=

ingresa valor n=4

n=

h=

0.5000

X=

1 0 0 0 0

X=

1.0000 1.5000 0 0 0

X=

1.0000 1.5000 2.0000 0 0

X=

1.0000 1.5000 2.0000 2.5000 0

X=

1.0000 1.5000 2.0000 2.5000 3.0000

Y=

-1 0 0 0 0

mostrar x

1.0000 1.5000 2.0000 2.5000 3.0000


mostrar Y

-1.0000 -0.2500 0.0313 -0.0156 0.0137

4.-

>> euler

ingresa funcion=(-(2*x^2*y)+4)/((2*x*y^2)-3)

g=

(-(2*x^2*y)+4)/((2*x*y^2)-3)

ingresa valor X1=1

X1 =

ingresa valor Y1=3

Y1 =

ingresa valor b=3

b=

ingresa valor n=8

n=

h=

0.2500

X=

1 0 0 0 0 0 0 0 0

X=

1.0000 1.2500 0 0 0 0 0 0 0

X=

1.0000 1.2500 1.5000 0 0 0 0 0 0

X=

1.0000 1.2500 1.5000 1.7500 0 0 0 0 0

X=

1.0000 1.2500 1.5000 1.7500 2.0000 0 0 0 0


X=

1.0000 1.2500 1.5000 1.7500 2.0000 2.2500 0 0 0

X=

1.0000 1.2500 1.5000 1.7500 2.0000 2.2500 2.5000 0 0

X=

1.0000 1.2500 1.5000 1.7500 2.0000 2.2500 2.5000 2.7500 0

X=

1.0000 1.2500 1.5000 1.7500 2.0000 2.2500 2.5000 2.7500 3.0000

Y=

3 0 0 0 0 0 0 0 0

mostrar x

1.0000 1.2500 1.5000 1.7500 2.0000 2.2500 2.5000 2.7500 3.0000

mostrar Y

3.0000 2.9667 2.8973 2.7955 2.6608 2.4901 2.2771 2.0103 1.6670

5.-

>> euler

ingresa funcion=((-x^2*y)+y)/(x*y^2)-(cos(x)*sin(x))

g=

((-x^2*y)+y)/(x*y^2)-(cos(x)*sin(x))

ingresa valor X1=2

X1 =

ingresa valor Y1=1

Y1 =

ingresa valor b=4

b=

ingresa valor n=4

n=

4
h=

0.5000

X=

2 0 0 0 0

X=

2.0000 2.5000 0 0 0

X=

2.0000 2.5000 3.0000 0 0

X=

2.0000 2.5000 3.0000 3.5000 0

X=

2.0000 2.5000 3.0000 3.5000 4.0000

Y=

1 0 0 0 0

mostrar x

2.0000 2.5000 3.0000 3.5000 4.0000

mostrar Y

1.0000 0.4392 -1.7118 -0.8630 0.8350

También podría gustarte