SAFiCF has no graphical user interface (yet!), so it must be invoked on the Matlab command line. You must pass the total angular quantum number of the ground multiplet (
), the temperature, incident energy, chopper frequency and the point group symmetry of the magnetic ion to the saficf function. However, if you do not pass vectors (or cell arrays of vectors) for the
-data,
-data and error-data, the function will ask you to click on a graph window, and obtain the data from this graph window. Thus you may use for example, MSlice to extract data into a 2D plot, and then get SAFiCF to get this data, and attempt to fit it:
>> J = 4; % e.g. Pr3+ >> T = 4; % in Kelvin >> Ei = 23; % in meV >> freq = 200; % in Hz >> ptgp = 'C6h' % e.g. Hexagonal >> V = saficf(J,T,Ei,freq,ptgp);
This assumes you have plotted the data on a graph using Matlab somewhere. Otherwise, you would invoke:
>> V = saficf(J,T,Ei,freq,ptgp,xdat,ydat,edat);
where xdat, ydat, and edat are vectors or cell arrays of vectors. If you are fitting multiple datasets, then you would put the vectors of the data into a cell array, and make the variables T, Ei, and freq into vectors, in the order in which they correspond to the datasets. If you do not give xdat, etc., but T, etc., are vectors the function assumes that multiple datasets are being fitted, and the data should be obtained from graph windows. Please note that each dataset must be plotted on a separate graph window. For example for three spectra taken at different temperatures, but with the same spectrometer configurations:
>> J = 4; >> T = [4 77 300]; >> Ei = [23 23 23]; >> freq = [200 200 200]; >> ptgp = 'C6h' >> V = saficf(J,T,Ei,freq,ptgp);
Or alternatively:
>> xdat = {x1 x2 x3}; >> ydat = {y1 y2 y3}; >> edat = {e1 e2 e3}; >> V = saficf(J,T,Ei,freq,ptgp);
There are also some functions which may be used independently of saficf. In particular, cf_hmltn and cflvls may be used to calculate the crystal field Hamiltonian and the energy levels and dipole transition matrix elements for a specified set of CF parameters. For example, for Pr
in a site of hexagonal symmetry, with
meV,
meV,
meV,
meV:
>> J = 4; >> B2 = [0 0 0.2 0 0 0]; >> B4 = [0 0 0 0 0.01 0 0 0 0]; >> B6 = [0 0 0 0 0 0 0.005 0 0 0 0 0 0.003]); >> Hcf = cf_hmltn(J,B2,B4,B6); >> T = 4; % Temperature in Kelvin >> peaks = cflvls(Hcf,T)
Note that the vectors for the CF parameters go from
to
. This invocation will also output a graph showing the levels and dipole allowed transitions with their associated matrix elements. Alternatively, you may output a two column vector of the inelastic cross-section in the dipole approximation, as in equation 12:
>> L = 5; S = 1; >> peaks = cflvls(Hcf,J,[0 1],[1],[L S J])
All the of functions are relatively well documented in the m-files, so you should not be afraid to read the source! In addition, you can use the inbuilt Matlab help commands to get information on how to use the functions:
>> help cf_hmltn
Finally, there is also a function to use the Corana algorithm to fit an arbitrary function with the same syntax as speclsqr:
>> x = -5:0.1:5; >> y = fgauss(x,[-1.2 1 10])'+(rand(size(x))*2-1)*0.5; >> plot(x,y,'.'); >> p_in = [1 1 1]; % Guess parameters >> dp_in = [0.1 0.1 0.1]; % Guess step in parameters >> [p_lm,std_lm] = speclsqr(x,y,ones(size(x)),p_in,dp_in,@fgauss) >> [p_sa,std_sa] = saficf_salsqr(x,y,ones(size(x)),p_in,dp_in,@fgauss)
Please note that the Simulated Annealing routine whilst much less sensitive to the initial guess, p_in, is also about 500-1000 times slower than the Levenberg-Marquardt algorithm in speclsqr.