fitsp = fitspec(obj,Name,Value)
fitsp = fitspec(obj,Name,Value) uses a heuristic method to fit spin
wave spectrum using a few simple rules to define the goodness (or
R-value) of the fit:
- All calculated spin wave modes that are outside of the measured energy range will be omitted.
- Spin wave modes that are closer to each other than the given energy bin will be binned together and considered as one mode in the fit.
- If the number of calculated spin wave modes after applying rule 1&2 is larger than the observed number, the weakes simulated modes will be removed from the fit.
- If the number of observed spin wave modes is larger than the observed number, fake spin wave modes are added with energy equal to the limits of the scan; at the upper or lower limit depending on which is closer to the observed spin wave mode.
After these rules the number of observed and simulated spin wave modes will be equal. The R-value is defined as:
where indexing the spin wave mode and momentum respectively. and are the simulated and measured spin wave energies, sigma is the standard deviation of the measured spin wave energy determined previously by fitting the inelastic peak. is the number of energies to fit.
The R value is optimized using particle swarm algorithm to find the global minimum.
Name-Value Pair Arguments
- Function to change the Hamiltonian in
obj, it needs to have the following header:
obj = @func(obj, x)
- Path to the file that stores the experimental data. For the input data format see sw_readspec.
- Column vector with elements that defines the energy binning of the calculated dispersion. Larger binning steps solve the issue of fitting unresolved modes.
- Lower limit of the optimisation parameters, optional.
- Upper limit of the optimisation parameters, optional.
- Starting value of the optimisation parameters. If empty or undefined, random values are used within the given limits.
- String that determines the type of optimizer to use, possible values:
- Number of consecutive fitting runs, each result is saved in the
fitsp.Rarrays. If the Hamiltonian given by the random
xparameters is incompatible with the ground state, those
xvalues will be omitted and new random
xvalues will be generated instead. Default value is 1.
- Maximum number of runs, including the ones that produce error (due to incompatible ground state). Default value is 1000.
- Method for matrix diagonalization, for details see spinw.spinwave.
- Small number that controls wether the magnetic structure is incommensurate or commensurate, default value is .
- Checks that the imaginary part of the spin wave dispersion is
smaller than the energy bin size. Default is
Parameters for visualizing the fit results:
true, the measured dispersion is plotted together with the fit. Default is
- Factor of the plotted simulated spin wave intensity (red ellipsoids).
- Vertical shift of the
Qpoint labels on the plot.
- Minimum change of
xwhen convergence reached, default value is .
- Minimum change of the R value when convergence reached, default value is .
- Maximum number of function evaluations, default value is .
- Maximum number of iterations for the [ndbse.pso] optimizer. Default value is 20.
fitsp is struct type with the following fields:
objCopy of the input
obj, with the best fitted Hamiltonian parameters.
xFinal values of the fitted parameters, dimensions are . The rows of
xare sorted according to increasing R values.
redX2Reduced value, goodness of the fit stored in a column vector with number of elements, sorted in increasing order. is defined as:
where η is the degree of freedom, number of observations and is the number of fitted parameters.
exitflagExit flag of the
outputOutput of the
Any other option used by spinw.spinwave function are also accepted.