Está en la página 1de 24

Instituto Politcnico Nacional

Escuela Superior de Ingeniera Mecnica y Elctrica


Unidad Zacatenco
Departamento Ingeniera en Sistemas Automotrices
Mtodos Numricos
Tercer Parcial
Mtodos de:
-

Trapecio
Simpson
Euler
Runge Kutta
Grupo: 2SM1

Equipo 5

Alumno
1. Castro Delgado Aldo Javier

Profesor: Cardoso Reyes Luis Fernando


Fecha de Entrega: lunes 29 de Junio del 2015

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Mtodos Numricos
Mtodo del Trapecio
Problema 1
Sea la funcin
o

[1,3]

f ( x )=x

, encontrar el rea bajo la curva en el interval

n=5 , aplicando el Mtodo del Trapecio, adems encontrar el

Error e interpretar grficamente.


Datos

f ( x )=x 4

[1,3]
n=5
Calcular

f ( x 0=1 ) =(1) 4=1


f ( x 5=3 )=(3)4=81
h=

x 5x 0 3(1 )
=
=0.8
5
5
4

x 1=x 0+ h=1+1(0.8)=0.2 f (0.2 ) =(0.2 ) =0.0016


4

x 2=x 0+ 2h=1+ 2 ( 0.8 )=0.6 f ( 0.6 ) =( 0.6 ) =0.1296


4

x 3=x 0+ 3 h=1+3 ( 0.8 )=1.4 f ( 1.4 )=( 1.4 ) =3.8416


x 4=x 0 + 4 h=1+ 4 ( 0.8 )=2.2 f ( 2.2 )=( 2.2 )4 =23.4256
Evaluar

f ( x 0 ) + f ( x 0 ) n1
A T =h
+ f ( x i )
2
i =1

1+81
+0.0016+ 0.1296+3.8416+23.4256=54.71872
2
A T =0.8

Ingeniera en Sistemas Automotrices


3

x 4 dx=
1

Mtodos Numricos

x
3 1 243 1 244
3=
=
=
5 1 5
5
5
5
5

|2445 54.71872|=5.91872=592

Err=

Problema 2
Sea la funcin

[1,10 ] y

f ( x )=1x

, encontrar el rea bajo la curva en el intervalo

n=5 , aplicando el Metodo del Trapecio, adems encontrar el Error

e interpretar grficamente
Datos

f ( x )=1x

[1,10 ]
n=5
Calcular

f ( x 0=1 ) =1(1)=0
f ( x 5=10 )=1 (10 )=9
h=

x 5x 0 (10 )( 1 )
=
=1.8
5
5

x 1=x 0+ h=1+1 ( 1.8 )=2.8 f ( 2.8 )=1( 2.8 )=1.8


x 2=x 0+ 2h=1+2 (1.8 )=4.6 f ( 4.6 )=1( 4.6 ) =3.6
x 3=x 0+ 3 h=1+3 ( 1.8 )=6.4 f ( 6.4 )=1( 6.4 ) =5.4
x 4=x 0 + 4 h=1+ 4 ( 1.8 ) =8.2 f ( 8.2 ) =1( 8.2 )=7.2

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Evaluar

A T =h

f ( x 0 ) + f ( x 0 ) n1
+ f ( x i )
2
i =1

( 0 )+ (9 )
1.83.65.47.2=40.5
2
A T =1.8
10

(1x) dx=xx 2101 = 10 102


0

Err=|40.540.5|=0=0

][ ]
1

12
100
=[10100][ 10.5 ] =10
1+0.5=401+ 0.5=40.
2
2

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Problema 3
Sea la funcin

[0, ]

f ( x )=sin x , encontrar el area bajo la curva en el intervalo

n=5 , aplicando el Metodo del Trapecio, adems encontrar el Error

e interpretar grficamente
Datos

f ( x )=sin x
[0, ]
n=5
Calcular

f ( x 0=0 )=sin 0=0


f ( x 5= ) =sin =0
h=

x 5x 0 ( ) ( 0 )
=
=
5
5
5

x 1=x 0+ h=0+ 1

( 5 )= 5 f ( 5 )=sin 5 =0.587785252
( 5 )= 25 f ( 25 )=sin 25 =0.951056516

x 2=x 0+ 2h=0+2

( 5 )= 35 f ( 35 )=sin 35 =0.951056516

x 3=x 0+ 3 h=0+ 3

x 4=x 0 + 4 h=0+4

( 5 )= 45 f ( 45 )=sin 45 =0.587785252

Evaluar

A T =h

f ( x 0 ) + f ( x 0 ) n1
+ f ( x i )
2
i =1

( 0 )+ ( 0 )
+ 0.587785252+ 0.951056516+0.951056516+0.587785252=1.933765598
2

AT =
5

Ingeniera en Sistemas Automotrices


10

sin x dx=cos x 0 =[ cos ] [ cos 0 ] =2


0

Err=|21.933765598|=0.066234402=6.62

Mtodos Numricos

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Problema 4
Sea la funcin

[0, ]

f ( x )=cos x , encontrar el area bajo la curva en el intervalo

n=5 , aplicando el Metodo del Trapecio, adems encontrar el Error

e interpretar grficamente
Datos

f ( x )=cos x
[0, ]
n=5
Calcular

f ( x 0=0 )=cos 0=1


f ( x 5= ) =cos =1
h=

x 5x 0 ( ) ( 0 )
=
=
5
5
5

x 1=x 0+ h=0+ 1

( 5 )= 5 f ( 5 )=cos 5 =0.809016994

x 2=x 0+ 2h=0+2

( 5 )= 25 f ( 25 )=cos 25 =0.309016994

x 3=x 0+ 3 h=0+ 3

( 5 )= 35 f ( 35 )=cos 35 =0.309016994

x 4=x 0 + 4 h=0+4

( 5 )= 45 f ( 45 )=cos 45 =0.809016994

Evaluar

A T =h

AT =

f ( x 0 ) + f ( x 0 ) n1
+ f ( x i )
2
i =1

( 0 ) +( 0 )
+0.809016994+ 0.3090169940.3090169940.809016994 =0
5
2

Ingeniera en Sistemas Automotrices


10

cos x dx=sen x 0 =[ sen ] [ sen 0 ] =0


0

Err=|00|=0=0

Mtodos Numricos

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Problema 5
Sea la funcin

f ( x )=x 3 , encontrar el rea bajo la curva en el intervalo

n=5 , aplicando el Mtodo del Trapecio, adems encontrar el Error e

interpretar grficamente.
Datos

f ( x )=x 3

[1,5 ]
n=5
Calcular

f ( x 0=1 ) =(1)3 =1
f ( x 5=5 )=(5)3 =125
h=

x 5x 0 5( 1 )
=
=0.8
5
5

x 1=x 0+ h=1+1(0.8)=1.8 f ( 1.8 )=( 1.8 )3 =5.832


x 2=x 0+ 2h=1+ 2 ( 0.8 )=2.6 f ( 2.6 )=( 2.6 )3=17.576
x 3=x 0+ 3 h=1+3 ( 0.8 )=3.4 f ( 3.4 )=( 3.4 )3=39.304
x 4=x 0 + 4 h=1+ 4 ( 0.8 )=4.2 f ( 4.2 )=( 4.2 )3 =74.088
Evaluar

A T =h

f ( x 0 ) + f ( x 0 ) n1
+ f ( x i )
2
i =1

(1 ) + ( 125 )
+ 5.832+17.576+ 39.304+74.088=159.84
2
AT =0.8
5

x 4 5 54 14 625 1 624
x dx= 4 1= 4 4 = 4 4 = 4 =156
1
3

[1,5 ]

Ingeniera en Sistemas Automotrices

Err=|156159.84|=3.84=384

Mtodos Numricos

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Mtodo de Simpson
Problema 1
f ( x )=x 4 , encontrar el rea bajo la curva en el interval

Sea la funcin
o

n=5 , aplicando el Mtodo de Simpson, adems encontrar el Error

[1,3]

e interpretar grficamente.
Datos

f ( x )=x

[ x 0 , x 2 n ]=[ x 0 , x 10 ]=[1,3]
n=5
Calcular
4

f ( x 0 ) =(1 ) =1
f ( x 10 )=( 3 )4=81
Para

i=1, ,2 n1
2 n2

f ( x i ); f ( xi )
i=2
2 n1

f ( x2 n )
i=1

h=

x 2 nx 0 x 10x 0 3(1 ) 4
=
=
=
2n
10
10
10
4

x 1=x 0+ h=1+

4 3
3
1
=
f
=
=0.1296
10 5
5
10

( )( )

x 2=x 0+ 2h=1+ 2

( 104 )=0.2 f (0.2)=0.0016

x 3=x 0+ 3 h=1+3

( 104 )=0.2 f ( 0.2) =0.0016

x 4=x 0 + 4 h=1+ 4

( 104 )=0.6 f ( 0.6)=0.1296

Ingeniera en Sistemas Automotrices

Mtodos Numricos

x 5=x 0+ 5 h=1+5

( 104 )=1 f ( 1)=1

x 6=x 0 +6 h=1+6

( 104 )=1.4 f ( 1.4 )=3.8416

x 7=x 0+ 7 h=1+7

( 104 )=1.8 f (1.8 )=10.49

x 8=x 0+ 8 h=1+8

( 104 )=2.2 f ( 2.2) =23.4256

x 9=x 0 +9 h=1+9

( 104 )=2.6 f ( 2.6)=45.6976

f ( x 1 ) + f ( x 3 ) + f ( x5 ) + f ( x 7 ) + f ( x 9 ) =57.3264
f ( x 2 ) + f ( x 4 ) +f ( x 6 ) + f ( x8 ) =27.3984

Evaluar
2 n1

2 n2

h
A T = f ( x 0 ) + f ( x 2 n ) + 4 f ( x i ) +2 f ( xi )
3
i=1
i=2

4
10
AT =
( 1+81+ 4(57.3264)+2 ( 27.3984 )) =48.81365333
3
3

3 = 3 1
x 4 dx= x5 1
5
5

243 1
=48.8
5
5

Err=|48.8136533348.8|=0.013653333=1.36
Problema 2
Sea la funcin

[1,10 ] y

f ( x )=1x

, encontrar el rea bajo la curva en el intervalo

n=5 , aplicando el Mtodo del Simpson, adems encontrar el Error

e interpretar grficamente.

Ingeniera en Sistemas Automotrices


Datos

f ( x )=1x

[ x 0 , x 2 n ]=[ x 0 , x 10 ]=[1,10]
n=5
Calcular

f ( x 0 ) =1(1)=0
f ( x 10 )=1(10)=9
Para

i=1, ,2 n1
2 n2

f ( x i ); f ( xi )
i=2
2 n1

f ( x2 n )
i=1

h=

x 2 nx 0 x 10x 0 10( 1 ) 9
=
=
=
2n
10
10
10

x 1=x 0+ h=1+

9 19
19
19 9
= f
=1 =
10 10
10
10 10

( )

x 2=x 0+ 2h=1+2

( 109 )= 1810 f ( 1810 )= 810

x 3=x 0+ 3 h=1+3

( 109 )= 2710 f ( 2710 )=2.7

x 4=x 0 + 4 h=1+ 4

( 109 )=4.6 f ( 4.6)=3.6

x 5=x 0+ 5 h=1+5

( 109 )=5.5 f ( 5.5 )=4.5

x 6=x 0 +6 h=1+ 6

( 109 )=6.4 f ( 6.4)=5.4

Mtodos Numricos

Ingeniera en Sistemas Automotrices

Mtodos Numricos

x 7=x 0+ 7 h=1+7

( 109 )=7.3 f ( 7.3)=6.3

x 8=x 0+ 8 h=1+ 8

( 109 )=8.2 f ( 8.2)=7.2

x 9=x 0 +9 h=1+ 9

( 109 )=9.1 f ( 9.1) =8.1

f ( x 1 ) + f ( x 3 ) + f ( x5 ) + f ( x 7 ) + f ( x 9 ) =22.5
f ( x 2 ) + f ( x 4 ) +f ( x 6 ) + f ( x8 ) =18
Evaluar

AT =

2 n1

2 n2

h
f ( x 0 ) + f ( x 2 n ) + 4 f ( x i ) +2 f ( xi )
3
i=1
i=2

9
10
AT =
( 09+ 4(22.5)+2 (18 ) ) =40.5
3
10

(1x) dx=xx 2101 = 10 102


0

][ ]
2

1
100
=[10100][ 10.5 ] =10
1+0.5=401+ 0.5=40.
2
2

Err=|40.540.5|=0=0
Problema 3
Sea la funcin

[0, ]

f ( x )=sin x , encontrar el area bajo la curva en el intervalo

n=5 , aplicando el Metodo del Simpson, adems encontrar el Error

e interpretar grficamente
Datos

f ( x )=sin x

[ x 0 , x 2 n ]=[ x 0 , x 10 ]=[0, ]
n=5
Calcular

f ( x 0 ) =sin 0=0

Ingeniera en Sistemas Automotrices

f ( x 10 )=sin =0
Para

i=1, ,2 n1
2 n2

f ( x i ); f ( xi )
i=2
2 n1

f ( x2 n )
i=1

h=

x 2 nx 0 x 10x 0 0
=
=
=
2n
10
10
10

x 1=x 0+ h=0+

= f
=sin =0.30901699
10 10
10
10

( )

x 2=x 0+ 2h=0+2

( 10 )= 210 f ( 210 )=0.58778525

x 3=x 0+ 3 h=0+ 3

( 10 )= 310 f ( 310 )=0.80901699


( 10 )= 410 f ( 410 )=0.95105652

x 4=x 0 + 4 h=0+4

x 5=x 0+ 5 h=0+5

( 10 )= 510 f ( 510 )=1

x 6=x 0 +6 h=0+6

( 10 )= 610 f ( 610 )=0.95105652

x 7=x 0+ 7 h=0+7

( 10 )= 710 f ( 710 )=0.80901699

x 8=x 0+ 8 h=0+8

( 10 )= 810 f ( 810 )=0.58778525

x 9=x 0 +9 h=0+9

( 10 )= 910 f ( 910 )=0.30901699

Mtodos Numricos

Ingeniera en Sistemas Automotrices

Mtodos Numricos

f ( x 1 ) + f ( x 3 ) + f ( x5 ) + f ( x 7 ) + f ( x 9 ) =3.236067977
f ( x 2 ) + f ( x 4 ) +f ( x 6 ) + f ( x8 ) =3.077683537
Evaluar
2 n1

2 n2

h
A T = f ( x 0 ) + f ( x 2 n ) + 4 f ( x i ) +2 f ( xi )
3
i=1
i=2

10
AT =
( 0+ 0+4 (3.236067977)+ 2 ( 3.077683537 )) =2.000109517
3
10

sin x dx=cos x 0 =[ cos ] [ cos 0 ] =2


0

Err=|22.000109517|=0.000109517=0.01

Problema 4
Sea la funcin

[0, ]

f ( x )=cos x , encontrar el area bajo la curva en el intervalo

n=5 , aplicando el Metodo de Simpson, adems encontrar el Error

e interpretar grficamente
Datos

f ( x )=cos x

[ x 0 , x 2 n ]=[ x 0 , x 10 ]=[0, ]
n=5
Calcular

f ( x 0 ) =cos 0=1
f ( x 10 )=sin =1
Para

i=1, ,2 n1

Ingeniera en Sistemas Automotrices


2 n2

f ( x i ); f ( xi )
i=2
2 n1

f ( x2 n )
i=1

h=

x 2 nx 0 x 10x 0 0
=
=
=
2n
10
10
10

x 1=x 0+ h=0+

= f
=cos =0.951056516
10 10
10
10

( )

( 10 )= 210 f ( 210 )=0.809016994

x 2=x 0+ 2h=0+2

x 3=x 0+ 3 h=0+ 3

( 10 )= 310 f ( 310 )=0.587785252

x 4=x 0 + 4 h=0+4

( 10 )= 410 f ( 410 )=0.309016994

x 5=x 0+ 5 h=0+5

( 10 )= 510 f ( 510 )=0

x 6=x 0 +6 h=0+6

( 10 )= 610 f ( 610 )=0.309016994

x 7=x 0+ 7 h=0+7

( 10 )= 710 f ( 710 )=0.587785252

x 8=x 0+ 8 h=0+8

( 10 )= 810 f ( 810 )=0.809016994

x 9=x 0 +9 h=0+9

( 10 )= 910 f ( 910 )=0.951056516

f ( x 1 ) + f ( x 3 ) + f ( x5 ) + f ( x 7 ) + f ( x 9 ) =0
f ( x 2 ) + f ( x 4 ) +f ( x 6 ) + f ( x8 ) =0

Mtodos Numricos

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Evaluar

AT =

2 n1

2 n2

h
f ( x 0 ) + f ( x 2 n ) + 4 f ( x i ) +2 f ( xi )
3
i=1
i=2

10
AT=
( 11+ 4( 0)+ 2 ( 0 )) =0
3
10

cos x dx=sen x 0 =[ sen ] [ sen 0 ] =00=0


0

Err=|00|=0=0

Problema 5
Sea la funcin
y

f ( x )=x 3 , encontrar el rea bajo la curva en el intervalo

n=5 , aplicando el Mtodo de Simpson, adems encontrar el Error e

interpretar grficamente.
Datos

f ( x )=x 3

[ x 0 , x 2 n ]=[ x 0 , x 10 ]=[1,5]
n=5
Calcular

f ( x 0 ) =( 1 )3 =1
3

f ( x 10 )=( 5 ) =125
Para

i=1, ,2 n1
2 n2

f ( x i ); f ( xi )
i=2
2 n1

f ( x2 n )
i=1

h=

x 2 nx 0 x 10x 0 5( 1 ) 4
=
=
=
2n
10
10
10

[1,5 ]

Ingeniera en Sistemas Automotrices

x 1=x 0+ h=1+

Mtodos Numricos

4
3
=1.4 f ( 1.4 ) =( 1.4 ) =2.744
10

x 2=x 0+ 2h=1+2

( 104 )=1.8 f ( 1.8)=5.832

x 3=x 0+ 3 h=1+3

( 104 )=2.2 f ( 2 .2)=10.648

x 4=x 0 + 4 h=1+ 4

( 104 )=2.6 f ( 2.6 )=17.576

x 5=x 0+ 5 h=1+5

( 104 )=3 f (3 )=27

x 6=x 0 +6 h=1+ 6

( 104 )=3.4 f ( 3 .4 )=39.304

x 7=x 0+ 7 h=1+7

( 104 )=3.8 f ( 3 .8)=54.872

x 8=x 0+ 8 h=1+ 8

( 104 )=4.2 f ( 4 .2)=74.088

x 9=x 0 +9 h=1+ 9

( 104 )=4.6 f ( 4 .6 )=97.336

f ( x 1 ) + f ( x 3 ) + f ( x5 ) + f ( x 7 ) + f ( x 9 ) =192.6
f ( x 2 ) + f ( x 4 ) +f ( x 6 ) + f ( x8 ) =136.8
Evaluar

AT =

2 n1

2 n2

h
f ( x 0 ) + f ( x 2 n ) + 4 f ( x i ) +2 f ( xi )
3
i=1
i=2

4
10
AT =
( 1+125+ 4(192.6)+2 ( 136.8 ) )=156
3

Ingeniera en Sistemas Automotrices


5

x 3 dx=
1

Mtodos Numricos

x 5 5 1 625 1 624
= =
=
=156
4 1 4 4
4
4
4

Err=|156156|=0=0

Mtodo de Euler
Problema 1
Encontrar la solucin aproximada de las siguientes ecuaciones diferenciales, en
los intervalos dados y condiciones iniciales indicadas.
Ecuacion

f (x , y )

1
y ' = ( 1+ x ) y 2
2
Intervalo de anlisis

[0,0.5]
Condicion inicial

xi
y
y )= i

1
Iteraciones n

5
Solucion aproximada Euler

1.3898

Datos

[ x i , x f ] [ 0,0.5]
y ( xi ) = y i y ( 0 )=1
h=

x f x i 0.50 1
=
=
n
5
10

n=1

y i+1

Ingeniera en Sistemas Automotrices

Mtodos Numricos

y = y + hf ( x i , y i)
x i=0 i+1 i
1
y i=1 f ( x , y )= ( 1+ x ) y 2
2

| |

21
1
1 1
21 20
1
2
y i+1=1+
( 1+ 0 ) 1 = ,
= 100=4.76
10 2
20
21
21
20

n=2

y i+1=1.05+

1 1
( 1+0.1 ) 1.05 2 =1.1106375 ,
10 2

21
20
= 0.054597022100=5.46
1.1106375

1.1106375

n=3
y i+1=1.1106375 +

1 1
1.1846484391.1106375
( 1+0.2 ) 1.11063752 =1.184648439 ,
=0.062475024100
10 2
1.184648439

n=4

y i+1=1.184648439+

1 1
1.2758689151.184648439
( 1+ 0.3 ) 1.1846484392 =1.275868915 ,
=0.0714967
10 2
1.275868915

n=5
y i+1=1.275868915+

n
1
2
3
4
5

xi
0
0.1
0.2
0.3
0.4

1 1
1.3898178191.275868915
( 1+ 0.4 ) 1.2758689152 =1.389817819,
=0.0819883
10 2
1.389817819

yi
1
1.05
1.1106375
1.184648439
1.275868915

y i+1
1.05
1.1106375
1.184648439
1.275868915
1.389817819

Error %
4.76%
5.46%
6.25%
7.15%
8.20%

Ingeniera en Sistemas Automotrices

Mtodos Numricos

Problema 2
Encontrar la solucin aproximada de las siguientes ecuaciones diferenciales, en
los intervalos dados y condiciones iniciales indicadas.
Ecuacin

f (x , y )

y ' =x 2 y
Intervalo de anlisis

[0,1]
Condicin inicial

xi
y
y )= i

1
Iteraciones n

5
Solucion aproximada Euler

y i+1

0.5379
Datos

[ x i , x f ] [ 0,1]
y ( xi ) = y i y ( 0 )=1
h=

x f x i 10 1
=
=
n
5
5

n=1

x i=0 y i +1= y i +hf ( x i , y i )


y i=1 f ( x , y ) =x2 y

1
0.81
y i+1=1+ ( 021 ) =0.8 ,
=0.25100=25
5
0.8

Ingeniera en Sistemas Automotrices

Mtodos Numricos

n=2

1
0.6480.8
y i+1=0.8+ ( 0.221 ) =0.648 ,
=0.234567901100=23.46
5
0.648
n=3

1
0.55040.648
y i+1=0.648+ ( 0.4 21 )=0.5504 ,
=0.177325581100=17.73
5
0.5504
n=4

1
0.512320.5504
y i+1=0.5504+ ( 0.6 21 )=0.51232,
=0.074328545100=7.43
5
0.51232
n=5

1
0.5378560.51232
y i+1=0.51232+ ( 0.821 ) =0.537856 ,
=0.047477392100=4.75
5
0.537856

Metodo de Runge-Kutta
Problema 1
y ' =3 x+3 y

[ 0,0.5 ] y i =1n=5
n=1

x i=0 y i=1
h=

0.50
=0.1
5

y i+1= yi + f ( x i , y i )h
y i+1=1+ 0.1 ( 3 ( 0 ) +3 ( 1 ) ) =1.3
100=23.07
|1.31
1.3 |

Ingeniera en Sistemas Automotrices

n=2

y i+1=1 .3+0.1 ( 3 ( 0 .1 )+ 3 (1 .3 ) ) =1.72


100=24.41
|1.721.3
1. 72 |
n=3

y i+1=1 .72+0.1 ( 3 ( 0.2 ) +3 ( 1 .72 ) )=2.296


72
100=25.08
|2.2961.
2.296 |

n=4

y i+1=2.296 +0.1 ( 3 ( 0.3 ) +3 ( 2.296 ) ) =3.0448

|3.04482.296
|100=24.59
3.0448
n=5

y i+1=3.0448+ 0.1 ( 3 ( 0. 4 ) +3 ( 3.0448 ) )=4.0782

|4.07823.0448
|100=25.33
4.0782

Mtodos Numricos

También podría gustarte