calculates thermodynamical averages
Syntax
parOut = sw_fstat(state, parIn, T, E, M, nExt)
Description
parOut = sw_fstat(state, parIn, T, E, M, nExt) calculates statistical
properties of different physical variables over several sampled state.
The function is called by spinw.anneal.
Input Arguments
state- Defines the task of the function.
1Initialize the parOut structure.2Store the parameters of the physical state.3Calculate physical properties from the variable statistics.
parIn- Same as
parOut. T- Temperature of the system, row vector with number of elements.
E- Energy of the system, row vector with number of elements.
M- Magnetic moment of every atom in a matrix with dimensions of .
nExt- Size of the magnetic supercell, column vector of 3 integers.
kB- Boltzmann constant, units of temperature.
Output Arguments
parOut- Output parameter structure with the following fields:
nStatThe number of evaluated states.Maveraged over all magnetic moment stored in a matrix with dimensions of .M2averaged over all magnetic moment stored in a matrix with dimensions of .Esummed over all magnetic moment.E2summed over all magnetic moment.
- For the final execution, the following parameters are calculated:
parOut- Array of struct with number of elements:
avgMAverage components of the magnetisation over runs, matrix with dimensions of .stdMStandard deviation of the mgnetisation components over runs, matrix with dimensions of .avgEAverage system energy per spin over runs, scalar.stdEStandard deviation of the system energy per spin over runs, scalar.TFinal temperature of the sample.CpHeat capacity of the sample: .ChiMagnetic susceptibility of the sample: .