(*CONSIDERE EL PROBLEMA:dy/dt=f[t,y]=7t^2-(4y)/t con:y (1)=2; 1 t6*) (*tiene como solución exacta:y (t)=t^3+1/t^4*) (* los métodos de Euler modificado y Heun son casos particulares del RK2 PROCEDEREMOS EN EL SIGUIENTE ORDEN*) (*1)METODO DE EULER MODIFICADO 2)METODO DE HEUN 3)METODO RK4 DE (BURDEN MAS USADO)*) (*RK4*) f[t_,y_]:=7*t2-(4*y)/t; RK4[1,6,2,0.1] {{1,2},{1.1,2.0141},{1.2,2.21037},{1.3,2.54724},{1.4,3.00442},{1.5,3.57263}, {1.6,4.24868},{1.7,5.03281},{1.8,5.92734},{1.9,6.93581},{2.,8.06257},{2.1,9.31248}, {2.2,10.6907},{2.3,12.2028},{2.4,13.8542},{2.5,15.6507},{2.6,17.5979}, {2.7,19.7019},{2.8,21.9683},{2.9,24.4032},{3.,27.0124},{3.1,29.8019},{3.2,32.7776}, {3.3,35.9455},{3.4,39.3115},{3.5,42.8817},{3.6,46.662},{3.7,50.6584},{3.8,54.8768}, {3.9,59.3234},{4.,64.0039},{4.1,68.9246},{4.2,74.0912},{4.3,79.51},{4.4,85.1867}, {4.5,91.1275},{4.6,97.3383},{4.7,103.825},{4.8,110.594},{4.9,117.651},{5.,125.002}, {5.1,132.653},{5.2,140.609},{5.3,148.878},{5.4,157.465},{5.5,166.376}, {5.6,175.617},{5.7,185.194},{5.8,195.113},{5.9,205.38},{6.,216.001}} aproximada=w {2,2.0141,2.21037,2.54724,3.00442,3.57263,4.24868,5.03281,5.92734,6.93581,8.0625 7,9.31248,10.6907,12.2028,13.8542,15.6507,17.5979,19.7019,21.9683,24.4032,27.012 4,29.8019,32.7776,35.9455,39.3115,42.8817,46.662,50.6584,54.8768,59.3234,64.0039, 68.9246,74.0912,79.51,85.1867,91.1275,97.3383,103.825,110.594,117.651,125.002,13 2.653,140.609,148.878,157.465,166.376,175.617,185.194,195.113,205.38,216.001} solexacta=t3+t-4 {2,2.01401,2.21025,2.54713,3.00431,3.57253,4.24859,5.03273,5.92726,6.93573,8.062 5,9.31242,10.6907,12.2027,13.8541,15.6506,17.5979,19.7018,21.9683,24.4031,27.012 3,29.8018,32.7775,35.9454,39.3115,42.8817,46.662,50.6583,54.8768,59.3233,64.0039, 68.9245,74.0912,79.5099,85.1867,91.1274,97.3382,103.825,110.594,117.651,125.002, 132.652,140.609,148.878,157.465,166.376,175.617,185.194,195.113,205.38,216.001} errorglobal=Abs[aproximada-solexacta] {0,0.0000895131,0.000113235,0.000114397,0.000108145,0.0000999731,0.000091862 5,0.0000844666,0.0000779343,0.0000722292,0.0000672559,0.0000629093,0.0000590 925,0.0000557218,0.0000527274,0.0000500515,0.0000476467,0.0000454739,0.00004 35009,0.000041701,0.0000400521,0.0000385353,0.0000371352,0.0000358382,0.0000 346332,0.0000335103,0.0000324612,0.0000314786,0.0000305562,0.0000296884,0.00 00288704,0.0000280978,0.0000273669,0.0000266743,0.0000260169,0.0000253921,0. 0000247975,0.0000242308,0.0000236901,0.0000231735,0.0000226795,0.0000222066, 0.0000217535,0.0000213188,0.0000209014,0.0000205004,0.0000201148,0.000019743 6,0.0000193861,0.0000190415,0.0000187091}
eglobal=ListPlot[errorglobal,PlotStyle {Green,PointSize[0.02]}]
0
. 0
0
0
1
0
. 0
0
0
0
8
0
. 0
0
0
0
6
0
. 0
0
0
0
4
0
. 0
0
0
0
2
1
0
2
0
3
0
saprox=ListPlot[RK4[1,6,2,0.1],PlotStylePointSize[0.01]]
4
0
5
0
2
0
0
1
5
0
1
0
0
5
0
2
3
4
5
6
4
5
6
curvaExacta=Plot[t3+1/t4,{t,1,6},PlotStyleRed]
2
0
0
1
5
0
1
0
0
5
0
2
3