Your code isn't complete the X and Y Diffusion functions do nothing, and you never call them from your base code. Think about what you are doing, and make sure that the code reflects that thinking, algorithmically speaking.

So describe precisely what the equations are supposed to do - pseudo code helps - and make some effort to code the algorithms. Also, did you mean to output the value of an unmodified variable D, or did you mean to output the value of DeltaX in main()? In addition, the '\n' is not needed as endl will output a newline for you, as well as flushing the stream.

I defined the random number also as an array.
then I multiply(insert) these two array (of the magnetic filed ,and the random number) in the two equation above.
After defined the two equation correctly ,I will plot it.