βUNIVERSIDAD NACIONAL DE SAN MARTINβ FACULTAD DE INGENIERIA AGROINDUSTRIAL DEPARTAMENTO ACADEMICO PROFESIONAL DE INGENIERIA AGROINDUSTRIAL
ASIGNATURA
TEMA
:
ALUMNO
DOCENTE
:
METODOS NUMERICOS
EJERCICIOS DE DSOLVE, EULER Y EULER MODIFICADO
:
GINO. J. RENGIFO GANOZA
:
ING. ARBEL DAVILA RIVERA
CICLO
:
TARAPOTO-PERU 2018
V
METODO βDSOLVEβ ECUACIONES DIFERENCIALES 1) π₯
ππ¦ + 2π¦ = π₯π ππ(π₯) ππ₯
ππ¦ 2π¦ = π ππ(π₯) β ππ₯ π₯ π¦=
π 2 cos(π₯) β π₯ 2 cos(π₯) + 2π₯π ππ(π₯) β π₯2 π₯2
MATLAB >>Y=dsolve('Dy=sin(x)-2*Y/X','X'); >>simplify(y) ans= (c2+2*cos(x)+2*x*sin(x)/XαΆΊ2-COS(X) >>pretty(y) π2 2 cos(π₯) β π₯ 2 cos(π₯) 2 π₯ sin(π₯) + π₯2 π₯2
2) ππ¦ = π¦π‘ π π¦ = ππ‘
ππ¦ = ππ‘ = π¦ π π¦ = πΆπ π‘ π¦(0) = 1 C=1
MATLAB
>> dsolve('Dy=y ' , ' y (0)=1 ') ans = exp(t)
3) ππ¦ 2π¦ = ππ‘ π‘ π¦ = π‘2 ππ¦ 2π‘ 2 2π¦ = 2π‘ = = ππ‘ π‘ π‘ Y(-1)=1
MATLAB >> dsolve( 'Dy=2*y/t ' , ' y( -1 ) =1 ' ) ans = t^2 >> dsolve( 'Dy=2*y/x ' , ' y( - 1 ) = 1 ' , ' x ' ) ans = x^2
4) yο’ = 2x ππ¦ = 2π₯ ππ₯ β« ππ¦ =β« 2π₯ ππ₯ y ο½ π₯ 2+ C
MATLAB >>dsolve('Dy=2*x','x')
METODO DE EULER:
1)
ππ¦ ππ₯
= 2π₯π¦ ; π¦(0) = 1 ; π¦(0.5) =?
β=
0.5β0 5
= 0.1
Manual: π₯0 = 0.0
π¦1 = π¦0 + βπ(2π₯0 π¦0 ) π¦1 = 1 + 0.1(2(0.0)(1)) π¦1 = 1
π₯1 = ππ + π = 0.0 + 0.1 = 0.1 π₯2 = 0.1 + 0.1 = 0.2 π₯3 = 0.2 + 0.1 = 0.3
π¦2 = 1 + 0.1(2(0.1)(1)) π¦2 = 1.02
π₯4 = 0.3 + 0.1 = 0.4 π₯5 = 0.4 + 0.1 = 0.5 n
π₯π+1 = ππ + π
π₯π
π¦1 = π¦0 + βπ(2π₯0 π¦0 )
π¦1
0 1 2 3 4 5
0 0.0 + 0.1 = 0.1 0.1 + 0.1 = 0.2 0.2 + 0.1 = 0.3 0.3 + 0.1 = 0.4 0.4 + 0.1 = 0.5
0 0.1 0,2 0,3 0,4 0,5
1,0 1+0,1(2(0,0)(0,1)) 1+0,1(2(0,1)(1)) 1,02+0,1(2(0,2)(1,02)) 1,0608+0,1(2(0,3)(1,0608)) 1,124448+0,1(2(0,4)(1,124448))
1,0000 1,000 1,02 1,0608 1,124448 1,214403
MATLAB: Ingrese la derivada:2*x*y Ingrese el valor de X inicial:0 Ingrese el valor de X final:0.5 Ingrese el valor de Y inicial:1 Ingrese el paso:0.1 n= 5 x y
0.0 1.0000 0.1 1.0000 0.2 1.0200 0.3 1.0608 0.4 1.1244 0.5 1.2144
2) π¦ β² = π₯ 2 + 0.5π¦ 2 ; π₯0 = 1 ; π¦(1) = 2 ; π¦(1.3) =?
1.3β1 3
= 0.1
Manual: n π₯π+1 = ππ + π
π₯π
π¦1 = π¦0 + βπ(π₯02 + 0.5π¦02 )
π¦1
1 1 + 0.1 = 1.1 1.1 + 0.1 = 1.2 1.2 + 0.1 = 1.3
1 1.1 1,2 1,3
2.0 2+0,1((1)2 +0,5(2)2 2,3+0,1((1,1)2 +0,5(2,3)2 ) 2,6855+0,1((1,2)2 +0,5(2,6855)2 )
2,00000 2,3000 2,6855 3,19009
0 1 2 3 MATLAB:
Ingrese la derivada:x^2+0.5*y^2 Ingrese el valor de X inicial:1 Ingrese el valor de X final:1.3 Ingrese el valor de Y inicial:2 Ingrese el paso:0.1 n= 3.0000 x
β=
y
1.0 2.0000
1.1 2.3000 1.2 2.6855 1.3 3.1901
METODO DE UELER MODIFICADO:
1)
ππ¦ = 2π₯π¦ ; π¦(0) = 1 ; π¦(0.5) =? ππ₯
Manual: π₯0 = 0.0 π₯1 = ππ + π = 0.0 + 0.1 = 0.1 π₯2 = 0.1 + 0.1 = 0.2 π₯3 = 0.2 + 0.1 = 0.3 π₯4 = 0.3 + 0.1 = 0.4 π₯5 = 0.4 + 0.1 = 0.5
β=
0.5 β 0 = 0.1 5
π¦1 = π¦0 + βπ(2π₯0 π¦0 ) π¦1 = 1 + 0.1(2(0.0)(1)) π¦1 = 1
1 ππππ = [(2(π₯0 )(π¦0 ) + (2(π₯1 )(π¦1 )] 2 1 ππππ = [(2(0.0)(1) + (2(0.1)(1)] 2 π¦1 = 0.1
π¦(0,1) = π¦0 + β(ππππ) π¦1 = 1 + 0.1(0.1) π¦1 = 1.01
1 [(2(π₯0 )(π¦0 ) + (2(π₯1 )(π¦1 )] 2
ππππ
π¦0 + β(ππππ)
1
1 [(2(0.0)(1) + (2(0.1)(1)] 2
0.1
1 + 0.1(0.1)
1.01 + 0.1(2(0.1)(1.01))
1.0302
1 [(2(0.1)(1.01) + (2(0.2)(1.0302)] 2
0.30704
1.01+0.1(0.30704)
1.040704
0.3
1.040704+0.1(2(0.2)(1.040704))
1.0823
0.53283
1.040704+0.1(0.53283)
1.093987
0.3 + 0.1
0.4
1.093987+0.1(2(0.3)(1.093987))
1.1596
0.79203
1.093987+0.1(0.79203)
1.17319
0.4 + 0.1
0.5
1.17319+0.1(2(0.4)(1.17319))
1.2670
1.102776
1.17319+0.1(1.102776)
1.2834
n
π₯1 = ππ + π
π₯1
π¦1 = π¦0 + βπ(2π₯0 π¦0 )
π¦1
0
0
0
1.0
1.000
1
0.0 + 0.1
0.1
1 + 0.1(2(0.0)(1))
2
0.1 + 0.1
0.2
3
0.2 + 0.1
4 5
MATLAB: Ingrese la derivada:2*x*y Ingrese el valor de x:0 Ingrese el valor de x final:0.5 Ingrese el valor de y:1 Ingrese el paso:0.1 n= 5 x(n) yΒ΄(n), p hyΒ΄(n+1)
1 [(2(0.2)(1.040704) + (2(0.3)(1.0823)] 2 1 [(2(0.3)(1.093987) + (2(0.4)(1.1596)] 2 1 [(2(0.4)(1.17319) + (2(0.5)(1.2670)] 2
π¦1
1.01
0.0 1.00000000 1.00000000 0.1 1.01000000 1.03020000 0.2 1.04070400 1.08233216 0.3 1.09398804 1.15962733 0.4 1.17319278 1.26704820 0.5 1.28347290 1.41182019 >>
2) π¦ β² = π₯ 2 + 0.5π¦ 2 ; π₯0 = 1 ; π¦(1) = 2 ; π¦(1.3) =?
β=
1.3β1 3
= 0.1
Manual: π¦1 = π¦0 + βπ(π₯02 + 0.5π¦02 ) π¦1 = 2 + 0.1(12 + 0.5(22 ) π¦1 = 2.3
1 ππππ = [π(π₯02 + 0.5π¦02 ) + ππ₯12 + 0.5π¦12 ] 2 1 2 ππππ = [(1 ) + 0.5(22 ) + (1.12 ) + 0.5(2.32 )] 2 π¦1 = 3.4275
π¦(0,1) = π¦0 + β(ππππ) π¦1 = 2 + 0.1(3.4275) π¦1 = 2.34275
n
π₯1 = ππ + π
π₯1
π¦0 + βπ(π₯02 + 0.5π¦02 )
π¦1
0
1
1
2.0
2.000
1
1 + 0.1
1.1
2+0.1(12 + 0.5(22 )
2.3
2
1.1 + 0.1
1.2
2.34275+0.1(1.12 + 0.5(2.342752 )
2.7381
3
1.2 + 0.1
1.3
2.79989+0.1(1.22 + 0.5(2.799892 )
3.3358
MATLAB: Ingrese la derivada:x^2+0.5*y^2 Ingrese el valor de x:1 Ingrese el valor de x final:1.3 Ingrese el valor de y:2 Ingrese el paso:0.1 n= 3.0000 x(n) yΒ΄(n), p hyΒ΄(n+1)
1.0 2.00000000 2.30000000 1.1 2.34275000 2.73817388 1.2 2.79990184 3.33587436
1 [π(π₯02 + 0.5π¦02 ) + ππ₯12 + 0.5π¦12 ] 2
ππππ
π¦0 + β(ππππ)
1 2 [(1 + 0.5(22 ) + 1.12 + 0.5(2.32 ) 2 1 [(1.12 + 0.5(2.342752 ) + 1.22 2 + 0.5(22.73812 ) 1 [(1.22 + 0.5(2.799892 ) + 1.32 2 + 0.5(3.33582 )
3.4275
2 + 0.1(3.4275)
2.34275
4.5714
2.34275+0.1(4.5714)
2.79989
6.306736
2.79989+0.1(6.306736)
3.4305
π¦1
1.3 3.43058955 4.18803678 >>