It is nuclear magnetic resonance simulation in classics mechanics approximation.
Red arrow is J vector, rotational momentum
Blue arrow is vector B, magnetic field.
It is solution of equation dJ/dt=gamma*[JxB] Where B is constant magnetic filed + small perpendicular harmonic magnetic field with frequency equal to Larmor precession frequency. That is why resonance take place: length of red vector J increase all time.
Run test_res.m to start animation.
Video on youtube:
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.