GraphingCalculator 4; Window 46 6 856 1097; PaneDivider 329; FontSizes 18; BackgroundType 0; BackgroundColor 255 255 255; Slider 0 1; SliderSteps 500; SliderControlValue 0; 3D.X -0.5 0.5; 3D.Y -0.5 0.5; 3D.Z -0.5 0.5; 3D.Axes 0; 3D.Depth 2.5730909743; 3D.View 0.8253769188578144 -0.5294686249902821 -0.195999788238626 0.5134086846038671 0.8483060059914251 -0.1295702234084174 0.2348711655610321 0.006316278310263355 0.9720059877585737; 3D.Speed 0; Text "PNMR. Version 0.32 To do: (i) Finish spin echo dephasing/rephasing demo (ii) Give M an initial y-component as well? [Currently the time offset o is the way to do this] Gyromagnetic ratio."; Color 2; Expr g=1; Text "Applied and pulsed magnetic field strengths. [b1 kept slightly above 0 to keep C and S well defined at resonance when b1=0 => b_E =0s.]"; MathPaneSlider 200; Expr b_0=slider([0,1]); Color 3; MathPaneSlider 101; Expr b_1=slider([sn(1,-5),0.5]); Text "Toggle for rotating frame. q=0 is as observed from rotating frame; q=-1 (for g>0) is as observed from stationary (lab) frame."; Color 4; MathPaneSlider 1; Expr q=slider([-1,1,2]); Text "Magnitude of pulse frequency is pgb0; p=1 is resonance condition."; Color 5; MathPaneSlider 200; Expr p=slider([0,1]); Color 6; Expr W=p*g*b_0,Q=q*W; Text "Orthonormal bases in lab and rotating frames. I1 is counterrotating."; Color 7; Expr O=vector(0,0,0),I_0=vector(1,0,0),J_0=vector(0,1,0),K=vector(0,0,1); Color 8; Expr function(I,s)=vector(cos([Q*s]),sin([Q*s]),0),function(J,s)=vector(-sin([Q*s]),cos([Q*s]),0),function(I_1,s)=vector(cos([Q*s]),-sin([Q*s]),0); Color 17; Expr O,I_0; Color 17; Expr O,J_0; Color 17; Expr O,K; Color 17; Expr O,function(I,N); Color 17; Expr O,function(J,N); Color 17; Expr O,function(I_1,N); Text "Applied (B0) and rotating pulsed (B1) magnetic field; B2 is the actual pulsed rf field; B is the total field. BE is the effective magnetic field in the rotating frame and bE its magnitude."; Expr B_0=b_0*K,function(B_1,s)=b_1*function(I,s),function(B_2,s)=function(B_1,s)+b_1*function(I_1,s),function(B,s)=B_0+function(B_1,s); Color 2; Expr function(B_E,s)=function(B,s)-(W/g*K),b_E=sqrt(b_1^2+[b_0-W/g]^2); Color 3; Expr O,B_0; Color 17; Expr O,function(B_1,N); Color 17; Expr O,b_1*function(I_1,N); Color 17; Expr O,function(B_2,N); Color 17; Expr O,function(B,N); Expr O,function(B_E,N); Color 17; Expr function(B_E,N*t); Text "Basis fixed in rotating frame with K_E axis along the direction of B_E, the effective magnetic field."; Color 5; Expr C=b_1/b_E,S=(b_0-W/g)/b_E; Color 6; Expr function(I_E,s)=-(S*function(I,s))+C*K,function(J_E,s)=-function(J,s),function(K_E,s)=C*function(I,s)+S*K; Color 17; Expr O,function(I_E,N); Color 17; Expr O,function(J_E,N); Color 17; Expr O,function(K_E,N); Text "Magnetization M. Initial x- and z-components. M precesses around direction of the effective field B_E at frequency gb_E."; Color 3; MathPaneSlider 140; Expr M_1=slider([0,1]); Color 4; MathPaneSlider 115; Expr M_3=slider([0,1]); Color 4; Expr m_1=-(S*M_1)+C*M_3,m_3=C*M_1+S*M_3; Color 5; Expr function(M,s)=m_1*[cos([g*b_E*s])*function(I_E,s)+[-sin([g*b_E*s])]*function(J_E,s)]+m_3*function(K_E,s); Text "T_L is the Larmor period. T_p is the period of precession of M around B_E. L/f and P/f are the corresponding number of full periods as n runs from 0 to 1. [Usually set L=0.] R sets the overall time scale, and N the appropriately scaled time. Pi/2 and pi pulses. T_p/f is time for which rf perturbation is applied. With L=0 and P = 1, f=2 is a pi-pulse; f=4 is pi/2-pulse. Otherwise f should be 1. o is a time-offset."; Expr T_L=2*pi/(g*b_0),T_p=2*pi/(g*b_1); Color 7; Expr L=slider([0,10,10]); Color 8; MathPaneSlider 1; Expr P=slider([0,10,10]); Color 6; MathPaneSlider 1; Expr f=slider([1,4,3]); Color 7; Expr o=slider([0,1]); Color 3; Expr R=[L*T_L+P*T_p]/f; Color 3; Expr N=R*n+R*o; Text "Magnetization and its z-component."; Color 2; Expr O,function(M,N); Color 17; Expr function(M,N*t); Color 17; Expr function(M,R*o+R*n*t); Color 17; Grain 0.1333333333333333; Expr [dot(function(M,N),K)]*K; Text "Spin echo: set q=-1 [lab frame], M3=0, f=1, L=0, and P=1. Let n run 0->1 and back. Y is the spread of the ""fan"" of echoing pulses. NOTES: So far only implemented the first step. Spreading is due to precession in different local B0's ... i.e. different Larmor freq's ... Need to show (i) fanning of three different magnetizations with 3 different frequencies; (ii) effect of pi-pulse swapping positions of fast and slow ones; (iii) continued evolution and subsequent rephasing. What's below is just (i), one faster than average M and one slower. Also include projection into x-y plane and don't necessarily force M_z=0?"; Color 5; MathPaneSlider 200; Expr Y=slider([0,pi/4]); Color 17; Expr O,function(M,[R+Y]*n); Color 17; Expr O,function(M,[R-Y]*n); Text "Not sure what this next was supposed to do/be?"; Color 17; Expr O,function(M,N+[T_L+Y]*n); Text "Torque due to field B on M. d is a scale factor for visibility. First is torque in lab frame [q=-1]. Second is effective torque in rotating frame [q=0] due to the effective magnetic field B_E."; Color 2; MathPaneSlider 88; Expr d=slider([0,2]); Color 17; Expr function(M,N),function(M,N)+g*d*[cross(function(M,N),function(B,N))]; Color 17; Expr function(M,N),function(M,N)+g*d*[cross(function(M,N),function(B_E,N))]; Text " Author: David A. Craig <";