I'm beginning to learn computer programming. I have to do a program in fortran 95 which gives the following account:
1 - generate a 4x4 matrix "A" where I can give the values that I want to each element.
2 - take one element, for example, Aij = A32
3 - multiply A32 by its four nearest neighbors and make the sum of the results, eg, A32xA31+A32xA33+A32xA22+A32xA42.
4-Add all the elements of this matrix and compare with the sum of the four elements mentioned above.
5 - depending on the outcome of the comparison between this two sum, I should change the element A32 by another number and repeat the step again. then I do the same procedure for each element of the array.
6 - then I want to print and write this matrix as a 4x4.
This is called the Metropolis algorithm for two-dimensional Ising model.
I'm not able to do this, so I wish someone would do me a small example for this program, step by step, very didactic way because I am a beginning programmer.
Thanks.
1 - generate a 4x4 matrix "A" where I can give the values that I want to each element.
2 - take one element, for example, Aij = A32
3 - multiply A32 by its four nearest neighbors and make the sum of the results, eg, A32xA31+A32xA33+A32xA22+A32xA42.
4-Add all the elements of this matrix and compare with the sum of the four elements mentioned above.
5 - depending on the outcome of the comparison between this two sum, I should change the element A32 by another number and repeat the step again. then I do the same procedure for each element of the array.
6 - then I want to print and write this matrix as a 4x4.
This is called the Metropolis algorithm for two-dimensional Ising model.
I'm not able to do this, so I wish someone would do me a small example for this program, step by step, very didactic way because I am a beginning programmer.
Thanks.