activeX[
            u_] := {{1,  0,  0}, {0,  Cos[u],  -Sin [u]}, {0,  
              Sin [u],  Cos[u]}}; 
        activeY[u_] := {{ Cos[u], 0,  Sin [u]}, {0,  1,  
              0}, {-Sin [u], 0,   Cos[u]}};
activeZ[
              u_] := {{Cos[u],  -Sin [u],  0}, {Sin [u],  Cos[u], 
                0 },  {0,  0,  1}};

MatrixForm[activeX[a]]
MatrixForm[activeY[a]]
MatrixForm[activeZ[a]]

  
  
Ypulse = 
            activeX[Pi/2 - th] . activeY[-fAng] . 
              activeX[-Pi/2 + th];
Print["Y-pulse matrix:"]
MatrixForm[Ypulse]

Print["xcomponent of Y(t):"]

Mxvector  =  
          FullSimplify[Ypulse[[1 , 3]]]

xComponent[db0_]  =  
            Mxvector  /.  {
Cos[th]  ->  
                  db0/Sqrt[b1*b1 + db0*db0], 
Sin[
                    th]  -> 
                  b1/Sqrt[
                      b1*b1 + db0*db0], 
fAng  ->  
                  2  Pi*t*
                    Sqrt[b1*b1 + db0*db0], 
fAng2 ->  
                  2  Pi*tau*Sqrt[b1*b1 + db0*db0]
};

Print["ycomponent of Y(t):"]

Myvector  =  
          FullSimplify[Ypulse[[2 , 3]]]

yComponent[db0_]  =  
            Myvector  /.  {
Cos[th]  ->  
                  db0/Sqrt[b1*b1 + db0*db0], 
Sin[
                    th]  -> 
                  b1/Sqrt[
                      b1*b1 + db0*db0], 
fAng  ->  
                  2  Pi*t*
                    Sqrt[b1*b1 + db0*db0], 
fAng2 ->  
                  2  Pi*tau*Sqrt[b1*b1 + db0*db0]
};

Print["zcomponent of Y(t):"]

Mzvector  =  
          FullSimplify[Ypulse[[3 , 3]]]

zComponent[db0_]  =  
            Mzvector  /.  {
Cos[th]  ->  
                  db0/Sqrt[b1*b1 + db0*db0], 
Sin[
                    th]  -> 
                  b1/Sqrt[
                      b1*b1 + db0*db0], 
fAng  ->  
                  2  Pi*t*
                    Sqrt[b1*b1 + db0*db0], 
fAng2 ->  
                  2  Pi*tau*Sqrt[b1*b1 + db0*db0]
};

  
Print["-----------------------------------------------"]

  

b1 = 50;           
t = 0.005;       
nb = 1200;           

For[m = 0,  m  <=  nb,  m++ ];
offsetValue  =  
            Chop[Table[{off,  
                  off,  
NumberForm[xComponent[off],  
                    10] , 
NumberForm[yComponent[off],  
                    10], 
NumberForm[zComponent[off],  
                    10]},  {off,  -nb/2,  nb/2}]];
\(Print[
          TableForm[offsetValue, \ 
            TableHeadings\  -> \ {None, \ {Rang, \ 
                  offset/kHz, "xMagnetization", \ "yMagnetization", \ "zMagnetization"\ }}]]\)
Print["-----------------------------------------------"]

  

b1 = 50;           
t = 0.005;       
nb = 1200;           

\(plotOneYx\  = \ 
            ListPlot[
              Table[{off, \ xComponent[off]}, \ {off, \ \(-nb\)/2, \ 
                  nb/2}], 
PlotJoined\  -> \ 
                True, 
AxesLabel\  -> \ {"Offset (kHz)", \ \ "Mx"}, 
PlotStyle -> {Hue[ .1], \ 
                  Thickness[
                    0.005]}, 
TextStyle\  -> \ {FontSize\  -> \ 12}, 
PlotRange -> \ 
                All
]\)

\(plotOneYy\  = \ 
          ListPlot[
            Table[{off, \ yComponent[off]}, \ {off, \ \(-nb\)/2, \ 
                nb/2}], 
PlotJoined\  -> \ 
              True, 
AxesLabel\  -> \ {"Offset (kHz)", \ \ "My"}, 
PlotStyle -> {Hue[ .3], \ 
                Thickness[
                  0.005]}, 
TextStyle\  -> \ {FontSize\  -> \ 12}, 
PlotRange -> \ 
              All
]\)

\(plotOneYz\  = \ 
          ListPlot[
            Table[{off, \ zComponent[off]}, \ {off, \ \(-nb\)/2, \ 
                nb/2}], 
PlotJoined\  -> \ 
              True, 
AxesLabel\  -> \ {"Offset (kHz)", \ \ "Mz"}, 
PlotStyle -> {Hue[ .5], \ 
                Thickness[
                  0.005]}, 
TextStyle\  -> \ {FontSize\  -> \ 12}, 
PlotRange -> \ 
              All
]\)

Show[{plotOneYx,  plotOneYy,  
            plotOneYz}, 
AxesLabel  ->  {"Offset \
(kHz)",   "Mx, My, Mz"}]

\(courbe = 
            ParametricPlot[{yComponent[off], \ 
                xComponent[off]}, \ {off, \ \(-nb\)/2, \ 
                nb/2}, 
AspectRatio -> 
                1, 
PlotStyle -> {Hue[ .9], \ 
                  Thickness[0.01]}, 
Axes -> 
                Automatic, 
AxesLabel\  -> \ {"My", \ \ "Mx"}, 
PlotRange -> \ 
                All
];\)

couple = 
            Table[{yComponent[50*off],  
                xComponent[50*off]},  {off,  -nb/100,  nb/100}];

point = 
            ListPlot[
              couple,  
PlotStyle -> 
                PointSize[0.03], 
PlotStyle -> 
                Hue[0.1]
];

Show[{courbe,  point}
]

Remove[xComponent, yComponent, zComponent,  
            Mxvector,  Myvector, Mzvector, activeX,  activeY,  activeZ,  
            Xpulse, Ypulse,  offsetValue,  offset,  off,  nb,  t,  
            tau,  b1,  th,  fAng,  fAng2 ];