6. Data fitting

6.1. Requirements
6.2. Initial steps
6.3. Simulation and fitting

The scattering function S(Q,E) is defined by the module EXCI (actually a dynamically loaded library). This module is used in the convolution algorithm with resolution function to produce simulated data. Moreover, RESTRAX provides a non-linear fitting procedure (Levenberg-Marquardt) to fit the free parameters of anS(Q,E) model to experimental data. This section describes the basic steps of a data fitting session in RESTRAX.

6.1. Requirements

You need an EXCI module describing appropriate scattering function and possibly the file with model parameters loaded at the module initialization. Default installation of RESTRAX offers several models, which are accessible in the subdirectory ./lib of the installation root directory:

Modules distributed with version 4.8.0:

res_exci_osc.f… Damped harmonic oscillators
res_exci_osc1.f… Damped harmonic oscillators with a dispersion gradient"
res_exci_bcm.f… Bond charge model (phonons in Si, Ge, ...)"
res_exci_incom.f… Incommensurate fluctuations (diffuse satellites)

The source files and the corresponding parameter files can be found in the subdirectory ./exci.

If you need another model, you can create the corresponding module yourself, using an existing source file as a template. The package with EXCI source files and compilation scripts is available at home page.

6.2. Initial steps

  1. Use the FILE or DATA command to load the data.
  2. Use the EXCI command to initialize the current module or to load another one.

6.3. Simulation and fitting

Use the FIT or MFIT command to start the fitting procedure. Refer to the list of commands available. RESTRAX plots the data and fitted curves after each iteration step so that you can follow the progress.

Any free parameter can be fixed either explicitly by the command FIX, or by setting its value to zero. To fit a parameter value close to zero, start with a small non-zero initial value.

S(Q,E) models in RESTRAX can contain up to 6 different components (e.g. dispersion branches). There is a width parameter defined for each of them. RESTRAX tests whether this width is zero to select an appropriate convolution algorithm. For zero-width branches, the algorithm requires typically higher number of events accumulated in the resolution function than for the finite-width branches (see How to create own S(Q,E) modules for more details).

The results are saved in a single ASCII file. It contains all information about the model, parameter values, fitted curves and experimental data). You can save it also at a later (WRITE) stage.