In computing temperature changes in wall of the borehole when i use the fast Fourier transform, values obtained from this are very large, for example they should be: 0
As far as I can tell, Matlab does exactly what you're telling it to do, but its a bit hard to understand what you're actually trying to achieve. It looks a bit as if you're trying to convolve a temperature signal (q) with some sort of impulse response (g) of your system. If so, g should propbably be normalised such that sum(g) = 1.
To solve a temporal superposition problem through a convolution in the spectral domain, you have to convolve the incremental heat flux function f, not the heat flux signal itself.
Using the infinite line source model to get the normalized transfer function g for a field composed of a single borehole, a solution is easily obtained in Matlab with: