function SM = RungeKutta (xb, xw, delx)
DD=length(xw);

K1=zeros(1,DD);
K2=zeros(1,DD);
K3=zeros(1,DD);
K4=zeros(1,DD);
XRK=zeros(1,DD);
SM=zeros(1,DD);
r1=zeros(1,DD);
r2=zeros(1,DD);
C=round(1+rand)*(1-rand);
r1=rand(1,DD);
r2=rand(1,DD);

K1=0.5.*(rand.*xw-C.*xb);
K2=0.5*(rand.*(xw+r2.*K1.*delx./2)-(C.*xb+r1.*K1.*delx./2));
K3=0.5*(rand.*(xw+r2.*K2.*delx./2)-(C.*xb+r1.*K2.*delx./2));
K4=0.5*(rand.*(xw+r2.*K3.*delx)-(C.*xb+r1.*K3.*delx));
XRK=K1+2.*K2+2.*K3+K4;
SM=XRK./6;

endfunction
