function E=getxerr(J,timesteps);
  [x,yn]=xtgrid(J,timesteps);
  J2=J*2;
  [x2,yn2]=xtgrid(J2,timesteps);
  Ey=0;
  Ex=0;
  for k=0:J
   Ey=Ey+(yn(k+1)-yn2(2*k+1))^2;
   Ex=Ex+(x(k+1)-x2(2*k+1))^2;
  end
  E=sqrt(Ey/(J-1));
end