File:Nuclear magnetization relaxation.gif

Summary

Description
English: Relaxation of the nuclear magnetization in the presence of an external magnetic field, as described by the Bloch equations. The chosen values for the relaxation times are not realistic and were selected to result in a simple visualization more than Physical realism.
Date
Source https://twitter.com/j_bertolotti/status/1369962983074455552
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929
GIF development
InfoField

Mathematica 12.0 code

\[Gamma] = 1; (*gyromagnetic ratio*)
m0 = {1, 0, 0}; (*initial magnetization*)
b = {0, 0, 1}; (*external magnetic field*)
T1 = 1; T2 = 1; (*relaxation times*)
meq = {0, 0, 0.1}; (*equilibrium magnetization*)
matrix[B_] := {{-1/T2, \[Gamma] B[[3]], -\[Gamma] B[[2]]}, {-\[Gamma] B[[3]], -1/T2, \[Gamma] B[[1]]}, {\[Gamma] B[[2]], -\[Gamma] B[[1]], -1/T1}}; (*evolution matrix*)
dt = 0.05; (*time step*)
m = m0;
evo = Reap[Do[
     m = m/Norm[m]; (*make sure the vector is normalized*)
     m = m + dt*(matrix[b] . m + meq/T1);
     Sow[m]
     , 1000]][[2, 1]];
frames = Table[
   Graphics3D[{
     Black, Sphere[{0, 0, 0}, 0.05], Sphere[evo[[j]], 0.02], Thick, Line[{{0, 0, 0}, evo[[j]]}],
     Orange, Line[evo[[1 ;; j]] ],
     Black, Arrow[{{-1, -1, 0}, {-1, -1, 0.8}}],
     Text[Style["\!\(\*SubscriptBox[OverscriptBox[\(B\), \(\[Rule]\)], \\(ext\)]\)", Black, Bold], {-1, -1, 1}],
     Thin, Gray, 
     Line[{{-1, -1, 0}, {-1, 1, 0}, {1, 1, 0}, {1, -1, 0}, {-1, -1, 0}}],
     Black, Thick,
     Arrow[{{-1, 1, 0}, {-1, 1, 0.5}}], 
     Arrow[{{-1, 1, 0}, {-0.5, 1, 0}}], 
     Arrow[{{-1, 1, 0}, {-1, 0.5, 0}}],
     Text[Style["y", Black, Bold], {-0.4, 1, 0}],
     Text[Style["x", Black, Bold], {-1, 0.4, 0}],
     Text[Style["z", Black, Bold], {-1, 1, 0.6}]
     }, PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}, {0, 1.2}}, 
    Boxed -> False, ImageSize -> 400]
   , {j, 2, 1000, 5}];
ListAnimate[frames]

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#Nuclear%20magnetization%20relaxation.gifCategory:Self-published work
Category:Animated GIF files Category:Spin (intrinsic angular momentum) Category:Nuclear magnetic resonance Category:Images with Mathematica source code Category:Animated GIF files between 50 MP and 100 MP
Category:Animated GIF files Category:Animated GIF files between 50 MP and 100 MP Category:CC-Zero Category:Images with Mathematica source code Category:Nuclear magnetic resonance Category:PNG created with Mathematica Category:Self-published work Category:Spin (intrinsic angular momentum)