cdf =Manipulate[Column[{ SuFunc[ff, aa, yy0, nn, mm]}],Style[escriba@proposito,Bold,10],Spacer[{100,3}],
 (*Inicio contadores *)
 {{f,5t+3y,"f = "},ControlType->InputField},
{{a,2,"a = "},ControlType->InputField},
{{y0,1,"y(a) = "},ControlType->InputField},
{{b,3,"b = "},ControlType->InputField},
{{n,2,"n = "},ControlType->InputField},
 {{metodo,1,"Runge-Kutta -> "},{1-> "de Punto Medio", 2->"Euler Modificado", 3->"Heun", 4->"RK-4"},ControlType->PopupMenu},
Button["OK", ff=f; aa=a; bb=b; yy0=y0; mm=metodo; nn=n; ]
(* Fin contadores *)
,Alignment->Center,Deployed->True,AppearanceElements->"ResetButton",LocalizeVariables->True,ContinuousAction->False,FrameLabel->{{None,None},{Column[{,Row[{Style["Autores: Juan Félix Ávila Herrera y Enrique Vílchez Quesada",Bold,10,RGBColor[0,0,0.5]]}],Row[{Style["Escuela de Informática | Universidad Nacional de Costa Rica",Bold,10,RGBColor[0.5,0.1,0]]}]},Center],Style["Título: Método de Runge-Kutta para EDO.", Bold,14, RGBColor[0,0.33,0.33]]}},
Initialization:>(
ClearAll["Global`*"];
ff=f; aa=a; bb=b; yy0=y0; mm=metodo; nn=n;
 escriba[lista_]:=Style[Row@lista,Black];
 ($PreRead=(#/. s_String/;StringMatchQ[s,NumberString]&&Precision@ToExpression@s==MachinePrecision:>s<>"`6."&)) ;
proposito ={"Propósito: Usar el método de Runge-Kutta\npara aproximar la solución de la EDO y'=f(t, y)",  ", y(a)=", (Subscript[y, 0]),  ",\ncon ", "a≤ t≤ b. Se usa h =((b - a)/n)"};
SuFunc[f_, a_, y0_, n_, metodo_] := Module[{F,ti,  r={},  ww=a, h =((b-a)/n), pts={{a, y0}}, pol,  w, lw={y0}, k1, k2, k3, k4},
F[p_, q_] := f/.{t->p, y-> q} ;
 formula[ti_, w_]=0.+  
Which[metodo==1, w+h*F[ti+h/2,w+h/2*F[ti, w] ],
metodo==2, w+h/2 (F[ti, w]+F[ti+h,w+h*F[ti, w] ]),
metodo==3, w+h/4 (F[ti, w]+3F[ti+2/3h,w+2h/3*F[ti, w] ]),
metodo==4,
k1 = Simplify[h F[ti, w]];
k2 = Simplify[h F[ti+h/2, w+k1/2]];k3 = Simplify[h F[ti+h/2, w+k2/2]];k4 = Simplify[h F[ti+h, w+k3]]; 
Simplify[w+(k1+2k2+2k3+k4)/6]
]; 
ww=y0; 
Do[
 ww  =formula[a+i*h, ww];
lw =AppendTo[lw, ww];
pts =Join[pts, {{a+(i+1)*h, ww}}]; 
, {i, 0, n-1}];
pol = Expand@ InterpolatingPolynomial[pts,t];
 (* r=Join[r,{lw, "\n"}]*); 
 r= Join[r,{Grid[Transpose@N@pts, Frame->All], "\n"}]; 
  r= Join[r,{"Polinomio interpolante:\n", "P(t) =", pol}];  
rr =r;
escriba@r
];

)]
(*CloudDeploy[cdf, Permissions->"Public"]*)