BHfit
Overview:
BHfit is started from BHplot. It offers a generic fitting environment for various models including polydisperse form and structure factors.
Clicking on the fit data button in BHplot opens a selection window showing the available models. Fitting of multiple data sets is possible by plotting several curves in BHplot before choosing the model.
Description:
This GUI allows the selection of the fit model. Several form factors (or fitting of structure factor only) can be selected. A term simulating aggregates can be added. The last listbox allows the selection of a structure factor or the fitting of the selected form factor only.
Some particular fitting routines, not using the standard GUI, or legacy fitting routines are grouped in the category "specific functions".
- variables / start / low / high / result / fixed
The meaning of the used variables as well as the detailed description of the models are given in the appropriate sections of this help.
For each variable, a start value and lower / higher limits for the fitting have to be defined. The fit results are displayed in red in the column "result".
Each fit parameter can be declared as fixed parameter which speeds up fitting. Use this check box rather than selecting small range between low and high limits to allow fast fitting.
Consider also reducing the number of fitted data points by using dynamic rebin from the DataTools program, especially when using models which contain numerical integrations.
The models usually fit the logarithm of the intensity.
Therefore, the first fitting parameter F_scal (intensity scaling of the model) should be around 1 with lower / upper limits between 0.1 and 10. The adjustment of the correct intensity level which could vary by several orders of magnitude has to be done using the scaling input field at the bottom. This restriction is mainly due to the implementation of the logarithmic fitting.
A constant background of the measurement can be added as an additive offset in the add offset input field. This value is not fitted.
Some models require the specification of a scattering contrast.
This contrast can be calculated using the program ContrastCalculater available from the program menu.
It comes already with some predefined materials or allows user defined substances by giving their chemical formula. The density of the material should be known.
Contrast are always given relative to the external medium (solvent).
Use the scattering length density (rel. solvent) in nm-2 as input for the fit models where needed.
- show start
This button performs a calculation of the model based on the start parameters.
The displayed measurement can be chosen in the choose data listbox.
- start fitting
This button starts the fitting sequence for the measurement chosen in the choose data listbox. Make sure that the low / high limits are correctly set and the fixed parameters are well chosen.
It is possible to fit a series of measurements. These have to be first all plotted in BHplot before selecting the fitting model.
In the choose data listbox, a series of files can be chosen. These measurements are then fitted in increasing or decreasing order (inverse order option). Each time, the fit parameters of the previous measurement serve as start parameter for the following data set. This is particular useful to fit for example temperature series etc.
The fit results are all recorded in a fit logfile. This file fit_logfile.m is created in the same directory as the data. It is in Matlab format and can be displayed using the ShowLog program.
It contains information about the fit model, the data file of the measurements and the time when the fit was performed. The best fit parameters are saved, as well.
Two lines are of particular interest:
1. BHfit_3_par=..... contains a record of the start parameters (including upper and lower q limits of the fit). These parameters can be copied (copy selection button) and pasted into the GUI (paste button) to quickly recover these parameters.
2. f3_..... contains a direct call to the fitting routine using the best fit parameters. You can call the fitting routine using the execute selection button. This will usually create ASCII and PNG files with the modelled data.
- save results
Both the start parameters and the best fit parameters can be written to a file. The file name consists always of a time stamp followed by the chosen file name.
The format of the header is very similar to the information saved in the fit logfile. It is followed by the data (q, best fit, components like form and structure factor, measured data).
- copy / paste
This copies the start parameters to the clipboard in the format BHfit_3_par=... This can be pasted back to recover quickly the start parameters.
- use results as new start
This button copies the best fit parameters to the start column.
- low / high q for fitting
Choose the lower and higher q limits used for fitting. Minimize the range to increase the speed of fitting.
Consider also reducing the number of fitted data points by using dynamic rebin from the DataTools program, especially when using models which contain numerical integrations.
- zoom ON / OFF
This button toggles between the zoom mode and a mode to move the legend.
- show legend
Enables and disables the plotting of a legend.
- print
Prints the current graph to a printer.
- fix zoom
Does exactly what it says
- help
Shows this help.
- close
Closes BHplot.
Available menu options:
data menu:
Self explaining...
programs:
Start other programs of the SAXSutilities package.
option:
You can select special options which are available for some fitting models: e.g. choice of the used size distribution function.
help:
Get (this) help and updates.