function curr = current(x,t)

global c Q num_ch gap m volt

q0 = -Q*num_ch/(2*pi);
a0 = num_ch*Q*volt/(2*m*gap);
d = gap+a0*t.^2;
v = 2*a0*t;
curr = q0*v.*x./(4*pi*(x.^2+d.^2).^(1/2).*((x.^2+d.^2).^(1/2)+v.*d/c).^2);