24 Hour Competition The Classical Heisenberg ...

3 downloads 0 Views 398KB Size Report
May 10, 2015 - static int niter = 50; static float h=0.001; void rk4(int ,float [][niter][npart] ); float func(int ,int ,float [3][niter][npart],int). ; void sum(float [3][niter][npartΒ ...
24 Hour Competition

The Classical Heisenberg Model Magnetism in 1-D lattice Using RK4 & RK45 Methods

Student’s Name: Sami Mukhiemer Sameh Othman Ikerma Asmar Date: 9-10th May 2015

Abstract magnetism is intrinsically a quantum phenomenon one common model is the classical Heisenberg model, at this report the solution of dynamic equation was solved by using RK4 for one dimensional lattice and for N=100 lattice points and periodic boundary conditions was chosen, and also the graph for the magnetization and energy was plotted as a function of time, and the main energy was calculated.

Introduction The Heisenberg model is a statistical mechanical model used in the phase transitions of magnetic systems, in which the spins of the magnetic systems are treated quantum mechanically. Model are not only able to explain the measured properties but also provided some general understanding of higher dimensional magnatics system , we will see that the time dependent spin–spin correlation decreases when the system is heated up, resulting in a decrease of the spindiffusion speed. The presence of the magnetic field contributes to the order, and therefore produces an increase of the spindiffusion speed .

Partition function The energy of the magnetic spin system defined as the following E=-𝐽𝐽 βˆ‘π‘π‘ 𝑖𝑖=1 𝑆𝑆𝑖𝑖 𝑆𝑆𝑖𝑖+1 where S is the spin of the particle and J is a measure the strength between of the interaction between the two spins ,for simplicity the first neighbor approximation was used in order to get a very nice formula the following tricks was used as the following 1. Assume that 𝑆𝑆𝑖𝑖 𝑆𝑆𝑖𝑖+1 = πœ‡πœ‡π‘–π‘– = πœ‡πœ‡1 + πœ‡πœ‡2 + πœ‡πœ‡3 + β‹― 2. But πœ‡πœ‡1 =s1s2,πœ‡πœ‡2 = 𝑠𝑠2 𝑠𝑠3 , so πœ‡πœ‡π‘–π‘– = 𝑠𝑠1 𝑠𝑠2 𝑠𝑠2 𝑠𝑠3 𝑠𝑠3 … … . 𝑠𝑠𝑛𝑛 𝑠𝑠𝑛𝑛 𝑠𝑠𝑛𝑛+1

So our energy becomes 𝑁𝑁

𝑁𝑁

𝑖𝑖=1

𝑖𝑖=1

𝐸𝐸 = βˆ’π½π½ οΏ½ πœ‡πœ‡π‘–π‘– βˆ’ 𝐽𝐽𝐽𝐽 𝑖𝑖𝑖𝑖 π‘‘π‘‘β„Žπ‘–π‘–π‘–π‘–π‘–π‘– 𝑖𝑖𝑠𝑠 𝑛𝑛𝑛𝑛 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝐸𝐸 = βˆ’π½π½ οΏ½ πœ‡πœ‡π‘–π‘–

So the partition function of the system becomes as the following 𝑛𝑛

𝑛𝑛

𝑍𝑍 = βˆ‘π‘›π‘›π‘–π‘–=1 𝑒𝑒 βˆ’π›½π›½ βˆ‘π‘—π‘—=1 𝐸𝐸𝑗𝑗 so Z becomes 𝑍𝑍 = βˆ‘π‘›π‘›π‘–π‘–=1 𝑒𝑒 βˆ’π›½π›½π›½π›½ βˆ‘π‘—π‘—=1 πœ‡πœ‡π‘—π‘—

In view of quantum mechanics πœ‡πœ‡ β„Žπ‘Žπ‘Žπ‘Žπ‘Ž π‘œπ‘œπ‘œπ‘œπ‘œπ‘œπ‘œπ‘œ 𝑑𝑑𝑑𝑑𝑑𝑑 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 + 1 π‘œπ‘œπ‘œπ‘œ βˆ’ 1 so the solution will be very nice𝑍𝑍 = (2cosh(𝛽𝛽𝛽𝛽))π‘π‘βˆ’1 , as the spin goes to infinity the classical region were reached, but the Heisenberg model was considered and at this model πœ‡πœ‡ β„Žπ‘Žπ‘Žπ‘Žπ‘Ž π‘‘π‘‘β„Žπ‘’π‘’ 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 𝑏𝑏𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 βˆ’ 1 π‘Žπ‘Žπ‘Žπ‘Žπ‘Žπ‘Ž 1 so at this point the analytic solution dose not exists.

Magnetic interactions - seek to align spins relative to one another. - spins become effectively "randomized" when thermal energy is greater than the strength of the interaction. Energy of interaction J: J > 0 the interaction is called ferromagnetic (aligned spins) J < 0 the interaction is called antiferromagnetic (antialigned spins) J = 0 the spins are noninteracting

And the dynamic of the spin for the Heisenberg model expressed as follows 𝐽𝐽(𝑆𝑆𝑖𝑖 Γ— (π‘†π‘†π‘–π‘–βˆ’1 + 𝑆𝑆𝑖𝑖+1 )) the Runge-Kutta algorithm RK4 was used to solve the previous dynamic equation .

𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑

=

Runge-Kutta Algorithm The most often used is the classical fourth-order Runge-Kutta formula, which has a certain sleekness of organization about it: k1 = hf(xn, yn) k2 = hf(xn + h 2 , yn + k1 2 ) k3 = hf(xn + h 2 , yn + k2 2 ) k4 = hf(xn + h, yn + k3) yn+1 = yn + k1 /6 + k2/ 3 + k3 /3 + k4 /6 + O(h5). The fourth-order Runge-Kutta method requires four evaluations of the righthand side per step h. Runge-Kutta-Fehlberg Method (RKF45) One way to guarantee accuracy in the solution of an I.V.P. is to solve the problem twice using step sizes h and h/2 and compare answers at the mesh points corresponding to the larger step size. But this requires a significant amount of computation for the smaller step size and must be repeated if it is determined that the agreement is not good enough. The Runge-Kutta-Fehlberg method (denoted RKF45) is one way to try to resolve this problem. It has a procedure to determine if the proper step size h is being used. At each step, two different approximations for the solution are made and compared. If the two answers are in close agreement, the approximation is accepted. If the two answers do not agree to a specified accuracy, the step size is reduced. If the answers agree to more significant digits than required, the step size is increased. Each step requires the use of the following six values: k1 = h f (tk , yk ), k2 = h f (tk +( 1/ 4) h, yk +( 1/ 4) k1) k3 = h f( tk + (3/ 8) h, yk + (3 /32) k1 + (9/ 32) k2 ),

k4 = h f( tk + (12 /13) h, yk +( 1932/ 2197) k1 – (7200/2197)k2 + (7296/2197)k3) , k5 = h f( tk + h, yk + 439 216 k1 βˆ’ 8k2 + 3680 513 k3 βˆ’ 845 4104 k4 , k6 = h (f tk + 1/ 2 h, yk – (8/27) k1 + 2k2 βˆ’ 3544 /2565 k3 + 1859 4104 k4 – 11/40 k5 ). The two method was used and the total magnetization and energy of spin was calculated , c language was used and RK4 Algorithm was built to calculate one dimensional spin and then to calculate the three dimensional spin . then RK45 algorithm was built by using Matlab and the three dimensional spin energy and magnetization was calculated

Solution of the problem 1. One dimensional spin and one dimensional lattice In this part we use C-language and RK4 algorithm, and the magnetization and energy was calculated and the graph was plotted by using Microsoft Excel and the following results was gotten

Energy of time 0 -20

0

20

40

60

80

100

120

-40 -60 -80 -100 -120 -140 -160

Fig.1: energy verses time for one dimensional spins As the time goes the system go to more stable system so the energy increases with time.

2. Three dimensional spin and one dimensional lattice In this part c-language was used and RK4 algorithm was built and the magnetization and energy was calculated and the graph was built by using Microsoft Excel, and Matlab program was used and RK45 algorithm was built and the following results was gotten

Figure2: the matlab plot of magnetization verses time The previous results were expected because the values of the spins were random and black one was the sum of all magnetization in three dimensions.

Fig3. Energy of spins verses time And also the values of the energy were expected also because also random values of the spins so of course random values of the energy were expected. The following results were gotten by using C-language and RK4 algorithm

All spins up(1) but one down(-1)

48.0012

Magentaization

48.001 48.0008 48.0006 48.0004 48.0002 48 47.9998 0

10

20

30

40

50

60

Time

Fig.4: The total magnetization when all spins up but one only down

As seen from the graph the magnetization an first time does not change but as time goes on the magnetization increases with time to go to more stable state

Energy Vs time for random spin -46.95 0

10

20

30

40

50

60

-47 -47.05 -47.1 -47.15 -47.2 -47.25

Fig.5: the change in total energy of the system verses time As seen the time goes on the energy decreases and this is expected because the system got more stable so the energy was decreased

magnatizantion Vs time 43.450695 43.45069 43.450685 43.45068 43.450675 43.45067 43.450665 43.45066 0

10

20

30

40

50

60

Fig.6: the change in the total magnetization verses time The initial values of spins here also were random and as the time go the magnetization decreases with time as seen. It gone to more stable states and we expected that the energy increases with time as gotten by Matlab code

All up and one down 160 140

Energy

120 100 80 60 40 20 0 0

10

20

30

40

Time

Fig.7: when all were up and one down

50

60

No changes in the energy occur when all the spins were up and one down nothing change because the system reach the steady state very fast than a random systems

Conclusion: We studied the classical spin system in 1D & 3D for 1-D lattice. we obtained the Magnetization and Energy as function of Time using RK4 and RK45. And we found that using RK45 was more precise than RK4, using Matlab and C language. When we start from a random spin, the system is in chaos and has a higher energy but with time it become more stable and the energy decrease. But for the system were all the spin is up but one of them is down the system is almost stable and the change in energy is small.

Appendix 1 RK4 code by using c-language #include #include #include static int npart =50; static int niter = 50; static float h=0.001; void rk4(int ,float [][niter][npart] ); float func(int ,int ,float [3][niter][npart],int) ; void sum(float [3][niter][npart]); int main() { int seed = time(NULL); srand(seed); int l,k; int i=0,j; FILE *www; www = fopen("ttt.txt","a"); float spin[3][50][50]={0.0}; for(k=0;k