Numerical integration of a magnetic spin vector in a magnetic field

In summary, the conversation is about a first order differential equation involving a magnetism vector and an effective magnetic field. The person is trying to numerically integrate it with the Euler method but is having trouble with the damping term. Another person suggests writing out the equation for each component and using the Euler method to step forward in time. The first person is still unsure how to incorporate the time derivatives into the program.
  • #1
chaiyar
4
0

Homework Statement



Hi there, thanks in advance for any help!

I have a first order DE: [tex] \frac{\partial \vec{m}}{\partial t} = -\vec{m} \times \vec{h}_{eff} + \alpha \vec{m} \times \frac{\partial \vec{m}}{\partial t}[/tex] (a scaled Landau-Lifshitz-Gilbert equation)

where m is a magnetism vector, alpha is a damping factor and h is an effective uniform magnetic field.

I'm trying to numerically integrate it with the Euler method to get a precession of the spin vector around the h vector.

So far I've integrated the first term but the second, damping term I can't see how to translate into code.. (in C++)

So essentially what I've done is assumed the magnetic field to be aligned in the z-direction, and written
Code:
for(i=1 ; i<=tmax ; i++) {

					mx = mx + h * -my;
					my = my + h *  mx;
					t = t + h;
for the first term, where mx is the x-component of the m vector etc. and h is the timestep, and I need to add the damping term onto the end.

Considering the x-component first, presumably the derivative in the damping term has to be put down as m_x as well, but what direction is the other m vector to be taken in?

Sorry if that's not very well asked, but thanks a lot for any help!
 
Last edited:
Physics news on Phys.org
  • #2
Hello, chaiyar.

If you write out the DE for each component (x, y, z), you will get three equations that are linear in ##\dot{m_x}, \dot{m_y}, \dot{m_z}##, where the dot denotes time derivative.

Algebraically solving these simultaneously for ##\dot{m_x}, \dot{m_y}, \dot{m_z}##, you can get equations of the form

##\dot{m_x} = f_1(m_x, m_y, m_z)##
##\dot{m_y} = f_2(m_x, m_y, m_z)##
##\dot{m_z} = f_3(m_x, m_y, m_z)##

for certain functions ##f_1, f_2, f_3## .

Then you can use these equations with the Euler method to step forward in time.
 
  • Like
Likes 1 person
  • #3
Thanks for your help TSny, but I'm still a little lost.

I end up with three equations of the form

[tex]

\dot{m}_x = f_1 (m_y,m_z,\dot{m}_y,\dot{m}_z) \\
\dot{m}_y = f_2 (m_x,m_z,\dot{m}_x,\dot{m}_z) \\
\dot{m}_z = f_3 (m_x,m_y,\dot{m}_x,\dot{m}_y) \\

[/tex]

but I don't see how to incorporate the time derivatives into the program.. Do I have to take the equations further to get rid of the derivatives by using Lagrange multipliers or something like that?

Thanks again!
 
  • #4
You have three equations that are linear in ## \dot{m}_i ##, so you always can convert them to ## \dot{m}_i = f(...) ##, where the right hand side is independent of ## \dot{m}_i ##.
 
  • Like
Likes 1 person
  • #5



I would like to first commend you on your efforts to numerically integrate the first order DE for the magnetic spin vector. This is a complex and important problem in the field of magnetism and your approach is a good starting point.

In order to incorporate the damping term into your numerical integration, you will need to consider the direction of the magnetism vector in both the cross product and the derivative. The damping term essentially represents a torque acting on the spin vector, causing it to align with the effective magnetic field. Therefore, the direction of the damping term will depend on the orientation of the spin vector itself.

To incorporate this into your code, you will need to use the cross product between the spin vector and the derivative of the spin vector, as well as the cross product between the spin vector and the effective magnetic field. This will give you the direction of the torque acting on the spin vector, which you can then use to update the components of the spin vector in your numerical integration.

I would also recommend considering different numerical integration methods, such as the Runge-Kutta method, which may provide more accurate results for this type of problem.

Overall, I appreciate your approach and would encourage you to continue exploring this problem and seeking guidance from experts in the field. Good luck with your research!
 

Related to Numerical integration of a magnetic spin vector in a magnetic field

1. What is numerical integration?

Numerical integration is a method used to approximate the definite integral of a function by dividing the interval into smaller subintervals and using a numerical algorithm to calculate the area under the curve.

2. How is numerical integration applied to a magnetic spin vector?

In the context of magnetic spin vectors, numerical integration is used to calculate the trajectory of the vector as it moves in a magnetic field over a certain period of time.

3. What is the significance of numerical integration in studying magnetic spin vectors?

Numerical integration allows for the accurate prediction of the behavior of magnetic spin vectors in a magnetic field, which is crucial for understanding and manipulating their properties in various applications such as magnetic storage devices and spintronics.

4. What factors affect the accuracy of numerical integration in studying magnetic spin vectors?

The accuracy of numerical integration in studying magnetic spin vectors depends on the step size used in the calculation, the precision of the numerical algorithm, and the complexity of the magnetic field.

5. Are there any limitations to using numerical integration for studying magnetic spin vectors?

While numerical integration is a powerful tool, it may not accurately capture certain phenomena such as non-linear effects or quantum mechanical behavior. Therefore, it is important to carefully choose the appropriate numerical method and validate the results with experimental data.

Similar threads

  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
859
  • Advanced Physics Homework Help
Replies
3
Views
884
  • Advanced Physics Homework Help
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
5
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
413
  • Advanced Physics Homework Help
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
2
Views
2K
  • Advanced Physics Homework Help
Replies
4
Views
2K
  • Advanced Physics Homework Help
Replies
5
Views
2K
Back
Top