Data Handling and Fitting

Parent Previous Next

The EosFit-7c program includes fitting routines to allow you to determine the parameters for any of the supported EoS formalisms by fitting data. Once the data have been fitted and the parameters have been determined, you can then calculate volumes, bulk modulus and its derivatives, alphas and Ff values at any pressure and/or temperature with the commands listed in the previous section.


Fitting is performed at the main level of the EosFit7c program. 


From version 7.6 most of the commands for manipulating data have been moved to a new EDIT utility.



List of the commands for manipulating data and for fitting EoS in the main level. 


Read

Read in data to the program from a data file.

List

List the selected data

List cell

List all of the cell parameters in the dataset

Select

Select  which of the input data to use.

Ffcon

Calculate f and F (strain and normalised pressure) values from a dataset, with an option to output to a file.

Fit

Determine the parameters of an EoS by fitting to the selected data. 



Omit

Set individual data points not to be used for fitting. They will still be listed with the list command and in the output of least-squares fitting. An example is here. You can also type omit group to exclude a whole group of data

Use

Select individual data points for fitting. By default all data that is read in is set initially to be used. Therefore, use the use command to include data that was previously excluded with omit. You can also type use group to include a whole group of data.

Group

. Group data points into groups for easy manipulation by use and omit



Sort

Sort the selected data on P, T, or both 

Edit

Start the edit utility to change the data.

Write

Writes out the data  to a .dat file. If you have loaded cell parameters, you can select which ones to write to the file.

Clear

Deletes all data from the program. This does not delete the .dat file



These commands are described in more detail:


Read command:


At the command-line prompt, type read to open a datafile and read the data in to the program.


The format of the datafile is described here and illustrated by the example datafiles.


Remember: if you are running a version of the program without a file browser,  either put your datafile in the same folder as the program executable file, or create a short-cut to the program from your data folder. See Getting Started for details.



The default extension for datafiles is .dat. If you want to open a file with a different extension, you have to type in the full name with extension. 


If the datafile contains only one type of data, it will be listed, as shown here.


At the end of the listing, the program tells you which esd's are included with the data. These can be used for weighting fits to the data.


If you have already read in a dataset, you will be asked whether to add the new data to the old data, or to overwrite (delete) the previous dataset from the program. This allows you to load multiple datasets, for example one file with PV data and another with bulk modulus measurements.


If your input file contains cell parameters, then it is possible to select those for fitting. The read command will ask you if there is enough data!


The example shown is data for a triclinic crystal with all of the cell parameters listed in the file.


The program can calculate the volume of the cell from the data given, so it offers you the possibilities of working with a, c, or V, and also any direction specified by [UVW] or (hkl).


In this example the a-cell parameter was chosen, and the values are listed.


Note that when a linear quantity is selected, it is always labelled in tables as 'L', and the linear moduli are called 'M'. See the theory section for definitions. 




List command:




You can type List at any time to list the current selected data.


If a set of EoS parameters is available (either loaded or fitted), then the calculated pressures and volumes are calculated from the parameters:


P in this list is the pressure calculated from the input V (and T).

deltaP is the difference Pobs-Pcal


Vcal in this list is the volume calculated from the input P (and T).

deltaV is the difference Vobs-Vcal



The column labeled 'Use' indicates which data points have been selected. A '1' means the data point will be used in fitting and other calculations, a '0' means that it will not be used. Use the use and  omit commands to set these flags.


If you have defined groups, you will also see a column GP with the group number of each data point.



If you have read in a datafile with cell parameters, you can list all of the cell parameters by typing list cell



Select command:



If the dataset contains cell parameters, then it is possible to change the data to be used with the select command.



The program will offer you all of the possibilities allowed by the input dataset.



In this example the a unit-cell parameter was chosen, and the values are listed 


Note that when a linear quantity is selected, it is always labeled in tables as 'L', and the linear moduli are called 'M'. See the theory section for definitions. 





Ffcon command:


Converts the dataset in to f-F (strain-stress) values and lists them in an output file with default extension *.ff unless a different extension is specified. 


The program prompts you for the type of EoS, because this affects the definition of f and F in terms of P and V. This choice of EoS type does not have to match the type you have loaded! This choice is only used for this conversion of the data.

Ffcon output file:


Here is an example of the output file created by the program from the quartz example data.


After the header information, the type of EoS and the V0 are reported.


The table lists the values of f and F calculated from the P and V of the data, according to the type of EoS selected. When esd's are available for P and/or V, the esd's of the values of f and F are also calculated.


All values are given in fixed format, delimited by commas



If you have a linear EoS, then the column labels are adjusted as appropriate, and the values of f and F are as defined in the theory section.


Fit command:



The Fit command supervises the least-squares fitting of the EoS parameters to the selected data. 


If you have not opened a log file, the program will ask you to open one now! This way your results are saved.


If you do not have the necessary EoS parameters loaded, you can input them by using pressure or thermal commands within the INPUT EOS> subroutine.


In this example, we  first load the EoS parameters. Remember that until you exit the subroutine INPUT EOS> the program gives you the opportunity to review and to change the EoS parameters if you want to.


The least-squares is fairly robust, but not infallible! Therefore the starting values of the parameters should be 'reasonable'. What is 'reasonable'? 'Reasonable' means parameters that will refine to the correct best-fit values!


Then you can select which parameters to refine. In this example the user has decided to refine all three possible parameters. The program will only ask you about refineable parameters. Implied values and fixed parameters are set by the program.


Then you set the weighting scheme. We recommend to use all available experimental uncertainties in weighting your EoS fits. 



After selection of the weighting scheme, the program performs least-squares refinement of the parameter values to all of the data with their use flags set.


It lists the results from every least-squares cycle. If you have problems with the refinement, examine this output to see which variable has the largest shifts, or is oscillating in value. That usually indicates the problem.


W-CHI^2 is the weighted chi-squared statistic. It is a measure of the fit of the EoS to your data: 

  • A value of 1.0 indicates a statistically-meaningful fit to the data, given the uncertainties in the data.  
  • A value of less than 1, means the data are over-fitted, or that (as in this case) the data uncertainties were over-estimated.
  • A value of greater than 1, means the data are not well fit. Either you need to add parameters to the EoS (higher order) or your data uncertainties were under-estimated.


Note: EosFit rescales the parameter esd's if the data are under-fit (wchi2 > 1) but not if that are over-fit (wchi2 < 1).


After the parameter values are listed, the data points are listed. The columns are:


  • P: the observed pressure
  • esdP: The reported uncertainty in pressure
  • V: the observed volume (or length, if linear)
  • esd(V): The uncertainty in the volume data
  • Pcal: The P calculated for this volume from the fitted EoS parameters
  • deltaP:  Pobs-Pcalc
  • delta/esd: The deltaP divided by the esd(P)
  • Vcal: The V calculated from the EoS at the observed P 
  • deltaV: Vobs-Vcalc
  • WT:   The relative weight assigned to this data point in thelast cycle of the least-squares

If you have temperature data, this will also be included in the listing. If you have modulus data, the value of the modulus will be listed instead of the V.


After the listing are some statistical indicators. The correlation coefficients between variables are listed, along with the variance-covariance matrix from the least-squares. 


If you answer to the 'update' question, the parameters and the variance-covariance matrix are stored for further calculations.


Group command:

Group allows you to place data into different groups. Groups of data can then be omitted or used by group number (see below).


When data are read in, they are automatically put into group 1.


At the prompt, input the group number (1-10) you want to put the data into.


At the next prompt, input the list numbers of the points to be moved to this group.


In the example, data points 21-35 of the kalsilite example dataset have been put into group 2.


Data points can always be moved to new groups with the same command.


Once groups have been defined, you will see the group number listed in the third column, labeled GP,  of any data list (as shown here).



Use/Omit commands:


Omit allows you to exclude individual data points, or groups of consecutive data points, from all other fitting and calculations.


At the prompt, input the list numbers of the points to be omitted.


To set a group of consecutive datapoints, enter the two end points, with the second one as negative. In the example.... 18,-54 .....will exclude every data point from #18 to #54 inclusive.


You can enter many data point numbers on one line, or enter them on multiple lines.


A blank line terminates input, and the data are listed. The column labeled 'Use' indicates which data points have been selected. A '1' means the data point will be used in fitting and other calculations, a '0' means that it will not be used.


At the command prompt you can also type:


Omit Group  to exclude groups of data points, by just giving the group number.


Omit All will exclude all data points.




Use allows you to select individual data points, or groups of consecutive data points, to be used in all other fitting and calculations. The default is that all data points are used. 


At the prompt, input the list numbers of the points to be used.


To set a group of consecutive data points, enter the two end points, with the second one as negative. 


You can enter many data point numbers on one line, or enter them on multiple lines.


A blank line terminates input, and the data are listed. The column labeled 'Use' indicates which data points have been selected. A '1' means the data point will be used in fitting and other calculations, a '0' means that it will not be used.


At the command prompt you can also type:


Use Group  to include groups of data points, by just giving the group number.


Use All will include all data points.


Sort command



The Sort command allows you to sort the data by one of:


P

T

PT (i.e. P then T)

TP (i.e. T then P)


This can be useful especially for selecting data prior to setting the use flags in groups.











Write command


Write command allows you to save your dataset in another file. This in turn allows you not only to potentially rename files but also to save new dataset that includes only the data points that are set as in use as in the example below.



You can also modify your dataset with the delete command. 


    • This permanently removes the data point(s) from the EosFit7c program. The numbering of the remaining data points in the program is changed.
    • If you have cell parameter data, then the delete command removes all of the data associated with that P and T, not just the variable (e.g. V) on which you are working.
    • To save the changes to the dataset to a file, you must use the write command.