Menu "Simulation" "Init Params /1" "Simulation /2" "Params Wave to Globals /3" end Proc InitParams_1(theSimulationWave,theParamsWave) | makes and initializes global variables assumed by macros below String theSimulationWave="sim1", theParamsWave="params" Prompt theSimulationWave, "Simulation Wave:" Prompt theParamsWave, "Parameters Wave:" String/G SimulationWave=theSimulationWave, ParamsWave=theParamsWave print SimulationWave, ParamsWave End Proc InitParams_2(thefreq, thegx,thegy,thegz,theax,theay,theaz,thelinewidth_x, thelinewidth_y, thelinewidth_z) | makes and initializes global variables assumed by macros below Variable thefreq=9.105, thegx=2.036,thegy=2.036,thegz=2.245,theax=40,theay=40,theaz=525,thelinewidth_x=130, thelinewidth_y=130, thelinewidth_z=160 Prompt thefreq, "Frequency:" Prompt thegx, "gx:" Prompt thegy, "gy:" Prompt thegz, "gz:" Prompt theax, "Ax (in MHz):" Prompt theay, "Ay (in MHz):" Prompt theaz, "Az (in MHz):" Prompt thelinewidth_x, "Linewidth X (in MHz): " Prompt thelinewidth_y, "Linewidth Y (in MHz): " Prompt thelinewidth_z, "Linewidth Z (in MHz): " Variable/G freq=thefreq, gx=thegx,gy=thegy,gz=thegz,ax=theax,ay=theay,az=theaz, linewidth_x=thelinewidth_x,linewidth_y=thelinewidth_y,linewidth_z=thelinewidth_z print freq, gx, gy, gz, ax, ay, az, linewidth_x, linewidth_y, linewidth_z End Proc InitParams() InitParams_1() InitParams_2() End Proc Simulation(thefreq, thegx,thegy,thegz,theax,theay,theaz,thelinewidth_x,thelinewidth_y,thelinewidth_z) Variable thefreq=freq, thegx=gx,thegy=gy,thegz=gz,theax=ax,theay=ay,theaz=az,thelinewidth_x=linewidth_x, thelinewidth_y=linewidth_y, thelinewidth_z=linewidth_z Prompt thefreq, "Frequency:" Prompt thegx, "gx:" Prompt thegy, "gy:" Prompt thegz, "gz:" Prompt theax, "Ax (in MHz):" Prompt theay, "Ay (in MHz):" Prompt theaz, "Az (in MHz):" Prompt thelinewidth_x, "Linewidth X (in MHz): " Prompt thelinewidth_y, "Linewidth Y (in MHz): " Prompt thelinewidth_z, "Linewidth Z (in MHz): " Silent 1 $ParamsWave[8]= thefreq $ParamsWave[9]= thegx $ParamsWave[10]= thegy $ParamsWave[11]= thegz $ParamsWave[18]= theax $ParamsWave[19]= theay $ParamsWave[20]= theaz $ParamsWave[47]= thelinewidth_x $ParamsWave[48]= thelinewidth_y $ParamsWave[49]= thelinewidth_z Simulate($ParamsWave,$SimulationWave) freq = thefreq gx = thegx gy = thegy gz = thegz ax = theax ay = theay az = theaz linewidth_x = thelinewidth_x linewidth_y = thelinewidth_y linewidth_z = thelinewidth_z |$theCollectionWave[counter] = input End Proc ParamsWaveToGlobals() Silent 1 freq = $ParamsWave[8] gx = $ParamsWave[9] gy = $ParamsWave[10] gz = $ParamsWave[11] ax = $ParamsWave[18] ay = $ParamsWave[19] az = $ParamsWave[20] linewidth_x = $ParamsWave[47] linewidth_y = $ParamsWave[48] linewidth_z = $ParamsWave[49] End Window Isotropic_Example() : Graph PauseUpdate; Silent 1 | building window... Display /W=(82,49,560,473) IsoWave as "Isotropic Simulation Example" ModifyGraph lHair=0.5 ModifyGraph rgb=(52428,1,1) ModifyGraph tick=3 ModifyGraph mirror=2 ModifyGraph noLabel=2 ModifyGraph axOffset(left)=-6.5,axOffset(bottom)=-2 Label left "\\F'Palatino'\\Z12Intensity (arbitrary units)" Label bottom "\\F'Palatino'\\Z12Field (Gauss)" SetAxis left -146.149,146.149 SetAxis bottom -17.9307692307692,635.261538461538 Textbox/N=text0/F=0/S=3/H=36/G=(0,0,65535)/B=1/A=MC/X=-2.56/Y=45.29 "Isotropic simulation of DMPO-S (thiyl) radical" AppendText "\\JCvia SimulateIso() function" EndMacro Window Powder_Example() : Graph PauseUpdate; Silent 1 | building window... Display /W=(32,85,536,469) phm382,sim1 as "phm382_simulation" ModifyGraph lHair=0.5 ModifyGraph rgb(phm382)=(1,4,52428),rgb(sim1)=(52428,1,1) ModifyGraph mirror=2 ModifyGraph fSize=14 ModifyGraph lblMargin(left)=6 ModifyGraph axOffset(left)=-1 Label left "\\F'Palatino'\\Z14\\f01Intensity (arbitrary units)" Label bottom "\\F'Palatino'\\Z14\\f01Field (Gauss)" Legend/J/N=text0/S=3/H=36/A=MC/X=-22.76/Y=39.50 "\\s(phm382) PHM (Type II Cu protein)\r\\s(sim1) Simulation via XOP" EndMacro