Fitting Model Compositions to Data

Overview

In experimental petrology and geochemistry, it is often useful to:

  • fit proportions of mineral phases to bulk rock compositions.

    This can be used, for example, to perform mass balance calculations to check if an experimental run product is consistent with the starting composition.

  • fit molar fractions of solution endmembers to analysed elemental or oxide compositions.

    This can form a starting point for Thermobarometry, or for fitting parameters of thermodynamic datasets.

BurnMan provides functions to perform these types of composition fitting.

Available Fitting Functions

burnman.composition_fitting.fit_phase_proportions_to_bulk_composition(phase_compositions, bulk_composition)[source]

Determine the proportions of phases that best fit a given bulk composition (in a weighted constrained least squares sense).

The fitting applies appropriate non-negativity constraints (i.e. no phase can have a negative abundance in the bulk).

Parameters:
  • phase_compositions (2D numpy.array) – The composition of each phase. Can be in weight or mole amounts.

  • bulk_composition (numpy.array) – The bulk composition of the composite. Must be in the same units as the phase compositions.

Returns:

(phase_proportions, covariance_matrix, weighted_residual)

  • phase_proportions: Optimized proportions of each phase.

  • covariance_matrix: Covariance matrix of the optimized phase proportions,

    computed from the pseudo-inverse of the weighted design matrix.

  • weighted_residual: The weighted residual of the fit, representing the square root

    of the weighted sum of squared differences between observed and modeled bulk compositions.

Return type:

tuple of 1D numpy.array, 2D numpy.array and float

See also

burnman.optimize.linear_fitting.weighted_constrained_least_squares() - Performs the weighted constrained least squares optimization used internally.

burnman.composition_fitting.fit_composition_to_solution(solution, fitted_variables, variable_values, variable_covariances, variable_conversions=None, normalize=True)[source]

Fit a set of molar fractions to a solution model that best matches observed compositional variables (in a least-squares sense).

The fitting applies appropriate non-negativity constraints (i.e. no species can have a negative occupancy on a site).

Parameters:
  • solution (burnman.Solution) – The solution to use in the fitting procedure.

  • fitted_variables (list of str) – A list of the variables used to find the best-fit molar fractions of the solution. These should either be elements such as “Fe”, site_species such as “Fef_B” which would correspond to a species labelled Fef on the second site, or user-defined variables which are arithmetic sums of elements and/or site_species defined in “variable_conversions”.

  • variable_values (numpy.array) – Numerical values of the fitted variables. These should be given as amounts; they do not need to be normalized.

  • variable_covariances (2D numpy.array) – Covariance matrix of the variables.

  • variable_conversions (dict of dict, or None) – A dictionary converting any user-defined variables into an arithmetic sum of element and site-species amounts. For example, {‘Mg_equal’: {‘Mg_A’: 1., ‘Mg_B’: -1.}}, coupled with Mg_equal = 0 would impose a constraint that the amount of Mg would be equal on the first and second site in the solution.

  • normalize (bool, default=True) – Whether to normalize the molar fractions to sum to one.

Returns:

(molar_fractions, covariance_matrix, weighted_residual):

  • molar_fractions: Optimized molar fractions of each endmember.

  • covariance_matrix: Covariance matrix of the optimized molar

    fractions, computed from the pseudo-inverse of the weighted design matrix.

  • weighted_residual: The weighted residual of the fit, representing

    the square root of the weighted sum of squared differences between observed and modeled variables.

Return type:

tuple of 1D numpy.array, 2D numpy.array and float

See also

burnman.optimize.linear_fitting.weighted_constrained_least_squares() - Performs the weighted constrained least squares optimization used internally.