===== extracted/packedfile_9.bin (21681 bytes → 14933 chars text) WMT0IGR0 EPRSim Demo Help Notebook0 Notebook0:EPRSim Demo Help Normal EPRSim XOP Notes. Version 1.1 April 19, 1996 John Boswell Email: boswell@amethyst.cbs.ogi.edu Internet: http://www.cbs.ogi.edu/~boswell/ This XOP supplies two external functions: Simulate(), and SimulateIso(), which simulate EPR powder and isotropic spectra, respectively. Please send me a note if you like this XOP, (or not!) and let me know how I can improve it. Install the xfuncs by placing the EPRSim XOP (68K or PPC) in your "Igor Extensions" folder, and restarting Igor Pro. You may want to increase the memory available to Igor; I'd suggest 4MB minimum, but your mileage may vary. For Simulate() (the QPOW powder simulation routine), simply create a (double precision) params wave and fill it with the necessary parameters. Create a (double precision) destination wave, and execute: Simulate(params, destination_wave). The parameters that need to be put into params are explained in detail below, and also in Igor's function help. If you have destination_wave showing in a graph, it will be updated with the new simulation as soon as it is done. To modify the simulation, change the necessary params and re-execute the command. Typically most of the 70 params are set once and not changed; only about 9 are changed often. I've included a few macros in this demo experiment to make it easy to change these few params without having to scroll through the params wave. The macros create a new menu ("Simulation") with three choices: "Init Params": -prompts for the name of the simulation wave (destination wave) and the params wave. It doesn't create these waves, so make sure they exist before you try to simulate. -prompts for frequency, g-values, a-values, and linewidths. Default values are displayed; these can be changed in the macro code to suit your needs. The values are held in global variables and used to set values in the params wave later on. "Simulation": -prompts for frequency, g-values, a-values, and linewidths. Values set in "Init Params" are shown the first time this is run. Subsequent calls will show whatever values were used for the last simulation. When you hit "Continue", the values you were prompted for are put into the params wave, and the simulation is run. "Params Wave To Globals": -This is similar to "Init Params", but it just grabs the freq, g-values, a-values, and linewidths from the params wave and sets the corresponding globals equal to them. This is useful if you've saved a parameter wave for a previous simulation, and want to now use that as a starting point. Note that the "params wave" it grabs from is the one you designate via "Init Params" The SimulateIso() function works in a similar way. However, I have not created a macro-interface for SimulateIso(), as there are much few parameters. Two example graphs are included that show the results of both Simulate() and SimulateIso(). Please send me a note if you like this XOP, (or not!) and let me know how I can improve it. All of the following information is also available under Igor Pro's "Function Help..." (Select "Function Help..." under the Misc menu, and look for "Simulate" or "SimulateIso" under "External"). I'm including it here for your convenience. I'd suggest printing this notebook. Simulate Simulate(params, destination_wave) Supplied by EPRSim XOP 68K by John Boswell knight@grafton.dartmouth.edu or boswell@amethyst.cbs.ogi.edu ( http://amethyst.cbs.ogi.edu/JSB/JSB_Home.html ) This external function simulates Powder EPR spectra using the QPOW simulation code by Belford, Maurice, and Nilges. This function uses the parameters supplied to it by params, and returns the simulated spectrum in destination_wave. Both the params and destination_wave waves must be the same precision; preferably double-precision. (Don't mix up precisions.) I'll check for this in a later version, for now you must verify that the precision of both waves is the same prior to running the XOP. From the original QPOW source code comments: "QPOW generates a powder spectrum for a spin = 1/2 system with one hyperfine nucleus (one or two isotopes) and up to three superhyperfine nuclei. Hyperfine, quadrupole, and nuclear Zeeman interactions are calculated using matrix diagonalization. The superhyperfine splitting is treated as a perturbation on this. All hyperfine matrices and quadrupole tensors can be rotated independently from the coordinate system where the G matrix is diagonal. The three Euler angles are read in the order alpha, beta, gamma according to the convention of Rose. Spectra are integrated using two-dimensional 4-point gauss-point integration coupled with a 4-point interpolation of field positions and intensities. This program allows a choice between first and second derivative spectra. Both Gaussian and Lorenzian lineshapes are supported. The linewidth is allowed to vary with the MI value of the initial and final state of a transition." To verify that this function works, perform the following steps: 1. Generate a destination_wave and a params wave: Make/d/n=500 simulated_data (number of points can be up to 2000) Make/d/n=70 params (MUST be 70 points or greater) 2. Edit params, using the values you need to simulate. The params wave needs data in the following order (starting at point 0) : Note: a sample params wave is supplied in the demo experiment. The params data supplied with the demo takes about 1.5 minutes to simulate on a Quadra650. This can be shortened considerably by decreasing params[13] (NTH). Be sure you supply all the values... Values to be supplied by the params wave: 0) SPINA= Spin of metal nucleus being studied 1) SPINB= Spin of superhyperfine nucleus, B 2) SPINC= Spin of superhyperfine nucleus, C; C is magnetically different than B 3) SPIND= Spin of superhyperfine nucleus, D 4) NEB= # of B type atoms 5) NEC= # of C type atoms 6) NED= # of D type atoms 7) CUTOFF= # of linewidths the spectrum is to be calculated over 8) NU=Frequency at which spectrum was recorded, IN GHZ PRINCIPLE VALUES OF THE G MATRIX: 9) GX= g in X direction 10) GY= g in Y direction 11) GZ= g in Z direction 12) NTR= # of transitions possible considering only nucleus A; if your NTR is too large program will substitute NTR=((SPINA*2)+1)**2 13) NTH= # of intervals along the Theta direction for which spectra will be calculated. If Theta ranges from 0 to 90 degrees, and NTH is set at 9, there will be 9 intervals, each of 10 deg. Actually, half of this number will be calculated due to interpolation. Four points will be calculated inside each interval as determined by Gaussian quadrature. The maximum value for NTH is 49. 14) NPH= # of intervals along the PHI direction when NTH is set at 90 degrees. The number of intervals along the PHI direction is dependent upon THETA as well as NPH: [Sin(THETA)][NPH]; therefore, as THETA approaches zero, the # of intervals decreases. The maximum value of NPH is 15. 15) ITH= Initial THETA angle (to calculate only the perpendicular part of the spectrum, ITH should be about 40). 16) LTH= Range of THETA integration divided by PI/2; if the Gz coordinate axis is coincident with the Az coordinate axis, the Range = 90 degrees, and LTH =1; if they are noncoincident, the Range = 180 degrees and LTH = 2. 17) LPH= Range of PHI integration divided by PI/2; If the Gx and Gy axes are coincident with the Ax and Ay axes, respectively, the Range = 90 degrees and LPH=1, otherwise, the Range = 180 and LPH-2. PRINCIPAL VALUES OF HYPERFINE MATRIX FOR THE METAL NUCLEUS (IN MHZ): 18) AX= A along X axis 19) AY= A along Y axis 20) AZ= A along Z axis ANGSA= Euler angles which rotate the A matrix from the coordinate system where the G-matrix is diagonal to the coordinate system where the A-matrix is diagonal (if G and A are coincident, these are set equal to zero): 21) ALPHA 22) BETA 23) GAMMA PRINCIPAL HYPERFINE MATRIX VALUES FOR B ATOMS: 24) In X direction 25) In Y direction 26) In Z direction ANGSB=EULER ANGLES FOR B ATOMS: 27) ALPHA 28) BETA 29) GAMMA PRINCIPAL HYPERFINE MATRIX VALUES FOR C ATOMS: 30) In X direction 31) In Y direction 32) In Z direction ANGSC=EULER ANGLES FOR C ATOMS: 33) ALPHA 34) BETA 35) GAMMA PRINCIPAL HYPERFINE MATRIX VALUES FOR D ATOMS: 36) In X direction 37) In Y direction 38) In Z direction ANGSD=EULER ANGLES FOR D ATOMS 39) ALPHA 40) BETA 41) GAMMA (IN THE COORDINATE SYSTEM WHERE THE QUADRAPOLE TENSOR IS DIAGONAL:) 42) qdd= 3/2*QZ in MHZ (QZ=quadrapole along the Z axis) 43) QE=1/2*(QX-QY) in MHZ ANGSQ=Euler angles which rotate the Q tensor from the coordinate system in which the G tensor is diagonal to the coordinate system where the Q tensor is diagonal: 44) ALPHA 45) BETA 46) GAMMA LINEWIDTHS ALONG PRINCIPLE DIRECTIONS OF THE G MATRIX (in MHZ): 47 IN THE X DIR 48) IN THE Y DIR 49) IN THE Z DIR 50) IDERIV=The derivative of the spectrum (1st or 2nd) 51) GN= Nuclear G-factor for the 1st isotope of the metal. 52) GR= Ratio of g factors of 2nd isotope to 1st. 53) QR= Ratio of quadrapole moments of the 2nd to 1st. 54) GWT(1)= Fraction of abundance of 1st isotope (if only one isotope, GWT(1) = 1.00). 55) NIS= Number of isotopes. If NIS=1, only the 1st isotope is calculated, if NIS=2, two isotopes are calculated. 56) LCR= Center of spectrum (in Gauss) 57) LTOT= Field sweep (width of spectrum) (in Gauss) 58) HINT= Size of interval for PTS to be plotted (in gauss); program will calculate a point every HINT # of gauss. ****IMPORTANT NOTE**** Do NOT use an HINT of less than 1, or the XOP will crash Igor. This will be fixed in a later version. ALSO: Use LTOT and HINT values such that the total number of points is the same as the destination_wave, i.e. for params[61] use 1000 and params[62] use 2 for a 500 pt wave. If the destination_wave is smaller than LTOT/HINT, you may crash. I'll check for this in a later version. For now, just double check before running the simulation. EPSILN= CONSTANT RELATING THE CORRELATION OF A- AND G-STRAIN: 59) In X direction 60) In Y direction 61) In Z direction CONSTANT CONTAINING INFORMATION ON THE EXTENT OF A-STRAIN IN MHZ: 62) In X direction 63) In Y direction 64) In Z direction CTWO=CONSTANT CONTAINING INFORMATION ON THE EXTENT OF G-STRAIN 65) In X direction 66) In Y direction 67) In Z direction 68) Gaussian or Lorentzian lineshape. Gaussian = 0, Lorentzian = 1. 69) Sound On/Off. If = 1, then Igor will play a bit of the theme from "The Good, the Bad, and the Ugly" when it is done simulating. A value of 0 turns this option off. (end of params to be supplied) 3. Perform the simulation: Simulate(params,destination_wave) -The cursor will change to a rotating Beach Ball during the simulation. The XOP will beep once at the start of the simulation, (signaling it has received the params) and then twice when finished (or it will play some music). The mac is COMPLETELY TIED UP during the simulation. I don't allow for backgrounding. The sample params provided with the demo experiment take about 1 minute to simulate on a Quadra650. Any publication making use of this program should acknowledge: "EPRSim XOP for Igor Pro" by John Boswell, Oregon Graduate Institute- an adaptation of "Program QPOW" by Nilges and Belford", and should cite the following references: (1) M. J. Nilges, PH.D Thesis, University of Illinois, Urbana Illinois, (1979). (2) R. L. Belford and M. J. Nilges, "Computer simulation of powder spectra", EPR Symposium, 21st Rocky Mountain Conference, Denver, Colorado (August, 1979). (3) A. M. Maurice, PH.D Thesis, University of Illinois, Urbana Illinois, (1980). SimulateIso SimulateIso(paramsIso, destination_wave) Supplied by EPRSim XOP 68K by John Boswell knight@grafton.dartmouth.edu or boswell@amethyst.cbs.ogi.edu ( http://amethyst.cbs.ogi.edu/JSB/JSB_Home.html ) This external function simulates Isotropic EPR spectra. It is based on the code by U.M. Oehler, and E.G. Janzen, Can. J. Chem., 60, 1542-1548 (1982). This function uses the parameters supplied to it by paramsIso, and returns the simulated spectrum in destination_wave. Both the params and destination_wave waves must be the same precision; preferably double-precision. (Don't mix up precisions.) I'll check for this in a later version, for now you must verify that the precision of both waves is the same prior to running the XOP. To verify that this function works, perform the following steps: 1. Generate a destination_wave and a paramsIso wave: Make/d/n=1000 simulated_data (number of points can be up to 2000) Make/d/n=9 params (MUST be 9 points or greater) 2. Edit paramsIso, using the values you need to simulate. The params wave needs data in the following order (starting at point 0) : Note: a sample paramsIso wave is supplied in the demo experiment. The paramsIso data supplied with the demo takes < 1 second to simulate on a Quadra650. Be sure you supply all the values... Values to be supplied by the paramsIso wave: 0) X_increment= X increment 1) Phase= Phase of spectrum (1 or -1) 2) Number_of_Different_Nuclei= Number of different nuclei (for example, DMPO-spin trapped radicals have 2; one for H and one for N) 3) Linewidth= linewidth 4) Y_max= Max value for Y. Use as a scaling value to match an experimental spectrum 5) Delta_g= amount to shift subsequent spectra (nuclei) 6) Frac_Lor= Percentage of lineshape due to Lorenztian. (0.3 is 30% Lorenztian, 70% Gaussian) Repeat the next three values for the Number_of_Spectra: i.e. if Number_of_Spectra is 1: 7) Number_of_Nuclei= Number of nuclei for nucleus 1 8) CC= Coupling Constant for this nucleus 9) Spin= Spin of this nucleus (end of paramsIso, if Number_of_Spectra = 1), if Number_of_Spectra is 2, continue ParamsIso: 10) Number_of_Nuclei= Number of nuclei for nucleus 2 11) CC= Coupling Constant for this nucleus 12) Spin= Spin of this nucleus ...etc end of paramsIso 3. Perform the simulation: SimulateIso(paramsIso,destination_wave) -The xop will beep when done. The sample paramsIso provided with the demo experiment take < 1 second to simulate on a Quadra650. Any publication making use of this program should acknowledge: "EPRSim XOP for Igor Pro" by John Boswell, Oregon Graduate Institute Topic Subtopic FunctionBody1 step code Topic+ Subtopic+ Normal+ Normal+ step+ Subtopic+ subtopic1 Geneva Courier Helvetica Monaco New York Palatino Times Chicago Symbol ͨø cleus 1 8) CC= Coupling Co EPRSim Demo HelpT0H WMT0IGR0 WMT0IGR0 msIso, if Number_of_Spectra = 1), if Number_of_Spectra is 2, continue ParamsIso: 10) Number_of_Nuclei= Numb ===== extracted/packedfile_10.bin (5493 bytes → 3578 chars text) WMT0IGR0 More Help Notebook1 Notebook1:More Help Normal More notes on using the Demo Experiment: (I've received a few messages regarding the Demo experiment, so this file is to help clarify things): The way I use the macros supplied with the demo is: 1. Create (or make sure they are present) a params wave and a simulation wave. I usually do this by simply duplicating existing ones: duplicate params,params_new; duplicate sim1,simulation_new 2. If you want to change things like Center Field, SW, etc., edit the appropriate params wave (params_new). 3. Display the simulation wave (simulation_new) 4. Choose "Init Params" (Cloverleaf 1) 5. In the dialog, for Simulation wave, enter "simulation_new", and for the Params wave, enter "params_new" (enclosed in quotes) 6. Hit continue. A new dialog pops up. Here's the confusing part: The default values in this box are hard-coded into the macro; they are *not* from the params wave you entered in the previous box. The values can now be changed, if desired. Hit continue. What you have just done via these two dialogs is set a bunch of global variables. The actual params_new wave has not been touched (or read) -yet. 7a. At this point, if you choose "Simulation" (Cloverleaf 2), a new dialog box appears. The default values are whatever you input for step 6 (or the default values if you made no changes). If you wish, you can change them now. Hit continue, and the values from this dialog are *now* put into params_new (or whatever you specified in step 6), and the simulate() function is called: simulate(params_new,simulation_new). 7b. As an alternative to 7a, you may want to have the default parameters in the "Simulation" (Cloverleaf2) reflect the actual values from the params_new wave, rather than my hard-coded values from the macro. So, choose "Params wave to Globals" (Cloverleaf 3). This will put the params from params_new (or whatever you typed in for the params wave in step 6) into global variables that will show up as defaults when you do "Simulation" (Cloverleaf 2). Now, all subsequent calls to "Simulation" (Cloverleaf 2) will remember the last values used, and present them as defaults. So, you can tweak the g-values, do (Cloverleaf-2), see the results, repeat. Anyway, the macros were clear to me, (since I wrote them), but I see now they are less-than-intuitive :) You can always bypass the macros completely; just edit the params wave directly, and execute: simulate(params_new,simulation_new). I just tried the above steps myself; after I duplicated params, I edited params_new so that params_new[56] = 3400 params_new[57] = 1500 params_new[58] = 3 Then I did steps 3-6, and step 7b. Then I executed "Simulation" (Cloverleaf 2) (and left the values as shown as they were now the same as the params_new). Six or so seconds later I got the result. Seems to work :) One note: The "sim1" wave has it's scaling set to 2440-3440, and contains 500 pts. If you simply duplicate this wave, you need to change the duplicate's scaling to match your needs, i.e: SetScale/I x 2650,4150,"", simulation_new (this sets CF to 3400, with a sw of 1500) Also, be sure the number of points in your destination wave is = params_new[57] / params_new[58]. You really don't want to try to stuff a 2000 point simulation in a 500 point wave. I don't know what would happen- I have never tried it as I have an aversion to crashes :) I don't check for such errors; I will in a future version. Really. -John Boswell Geneva ͨø More HelpT0 WMT0IGR0 WMT0IGR0