Escolar Documentos
Profissional Documentos
Cultura Documentos
Nombre:…………………………………………………………………………………
Tiempo duración : 1:30 Fecha: 28 diciembre 2015
f (x ) f (x )
f ( x0 ) 2
i 1
i n
I (b a)
2n
2. (4 pts) Usar la derivación hacia adelante de la siguiente función:
Donde:
𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
1 1 1
𝑘2 = 𝑓 (𝑥𝑖 + 2 ℎ, 𝑦𝑖 + 2 𝑘1 ℎ) 𝑥𝑖 + 2 ℎ
1 1 1
𝑘3 = 𝑓 (𝑥𝑖 + 2 ℎ, 𝑦𝑖 + 2 𝑘2 ℎ) 𝑥𝑖 + 2 ℎ
𝑘4 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘3 ℎ) 𝑥𝑖 + ℎ
Nombre:…………………………………………………………………………………
Fecha: 28 diciembre 2015
f (x ) f (x )
f ( x0 ) 2
i 1
i n
I (b a)
2n
Solución
>> fx=inline('1-x-4*x.^3+3*x.^5')
fx =
Inline function:
fx(x) = 1-x-4*x.^3+3*x.^5
>> a=-3;b=5;n=6; >> fprintf('%10.2f%10.3f\n',tabla)
>> h=(b-a)/n -3.00 -617.000
h= -1.67 -17.395
1.3333 -0.33 1.469
>> x=[a:h:b] 1.00 -1.000
>> vfx=feval(fx,x) 2.33 155.346
>> tabla=[x;vfx]; 3.67 1788.432
5.00 8871.000
>> pend=vfx(1)+vfx(7)+2*(vfx(2)+vfx(3)+vfx(4)+vfx(5)+vfx(6))
pend =
1.2108e+04
>> InNu=(b-a)*pend/(2*n)
InNu = 8071.8
Solución
>> fx=inline('-0.1*x^4-0.15*x^3- >> vfx=feval(fx,x)
0.5*x^2-0.25*x+1.2') vfx = 0.9250
x=0.5;h=0.1; >> vfx1=feval(fx,x1)
>> x1=x+h vfx1 = 0.8246
x1 = >> dfx=(vfx1-vfx)/(x1-x)
0.6000 dfx = -1.0036
Solución numérica
>> dy=inline('2*x*y+x')
dy =
Inline function:
dy(x,y) = 2*x*y+x
>> x=0.5;y=1;h=0.1;
>> pe = feval(dy,x,y) >> x=x+h
pe = x=
1.5000 0.6000
>> y=y+pe*h >> pe = feval(dy,x,y)
y= pe =
1.1500 1.9800
>> y=y+pe*h
y=
1.3480
>> x=x+h >> x=x+h
x= x=
0.7000 0.8000
>> pe = feval(dy,x,y) >> pe = feval(dy,x,y)
pe = pe =
2.5872 3.3708
>> y=y+pe*h >> y=y+pe*h
y= y=
1.6067 1.9438
>> x=x+h
x=
0.9000
>> pe = feval(dy,x,y)
pe =
4.3988
>> y=y+pe*h
y=
2.3837
Solución analítica
dy=dsolve('Dy=2*x*y+x','y(0.5)=1','x')
dy =
(3*exp(x^2)*exp(-1/4))/2 - ½
dy=1.1682*exp(x^2)-1/2
>> x=[0.5:0.1:1]'; >> tabla=[x Y]
>> Y=1.1682*exp(x^2)-1/2; tabla =
0.5000 1.0000
0.6000 1.1744
0.7000 1.4069
0.8000 1.7155
0.9000 2.1260
1.0000 2.6755
x Y num Yanalit
Ing. Héctor Bolaños Sosa 3
Problemas para exámen
0.5 1.0000 1.0000
0.6 1.1500 1.1744
0.7 1.3480 1.4069
0.8 1.6067 1.7155
0.9 1.9438 2.1260
1.0 2.3837 2.6755
𝟏
𝒀𝒊+𝟏 = 𝒀𝒊 + (𝒌𝟏 + 𝟐𝒌𝟐 + 𝟐𝒌𝟑 + 𝒌𝟒 )𝒉
𝟔
Donde:
𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
Solución numérica
>> dy=inline('2*x*y+x')
dy = Inline function:
dy(x,y) = 2*x*y+x
>> x=0.5;y=1;h=0.1;
Tabla.- comparativa
x Ynum Yanaltic
0.5 1 1.0000
0.6 1.1744 1.1744
0.7 1.4069 1.4069
0.8 1.7155 1.7155
Ing. Héctor Bolaños Sosa 5
Problemas para exámen
0.9 2.1260 2.1260
1.0 2.6755 2.6755