# PTQ_Avg

**PTQ_Avg** calculates *"simple averages"* which are the points with shortest root-mean-squared distances (or *RMSD*) to all the lines plotted on 2D diagrams:

**PTQ_Avg** is primarily intended for use with another program for geothermobarometric investigations **PTQuick**. However, it can also be used for any 2D diagrams with polylines and simplest single-segment Bezier curves presented in TVL format (which is the format of the **TriQuick** program). **PTQ_Avg** processes the whole set of TVL-files stored in some folder at once.

"Simple average" resembles averages calculated by the **INTERSX** (or **winTERSX**) program from the **TWQ package** of R.G. Berman, T.H. Brown, E.H. Perkins and J. Ellwood, however these values have some important differences:

"Simple average" is based on pure geometric considerations without any thermodynamics while

**INTERSX**(from the**TWQ**package) calculates averaged values with weighting of intersections relative to modified equilibrium constants, entropy and volume effects of reactions (and angles between reaction lines). NB! Ignoring the thermodynamic parameters makes "simple averages" less correct, especially if the lines of reactions are poorly converged. Therefore it is worth to apply "simple averages" only if thermodynamic parameters of reactions unavailable, if you want to compare numerically the quality of results obtained by different methods, or just as express-method for checking the scatter of reaction lines.Evaluation of "simple average" includes calculation of distances on XY plane, therefore it uses scaling of axes and produces a single RMSD value (which should be regarded dimensionless).

**INTERSX**calculates two separate values of mean square weighted deviations for the both axes. Though,**TWQ**also performs scaling of axes, e.g. to estimate angles between lines (for filtering of intersections and for their weighting). Probably, scaling in**INTERSX**depends on particular ranges of the axes (you can find this by differences of results), while**PTQ_Avg**applies fixed (user-specified) scaling allowing comparison of RMSD values for diagrams plotted with different ranges of axes. For example, you can select multiplier "50" for the "P,kbar" axis to make values uniform on typical PT diagrams used for crustal metamorphic conditions (e.g. 400-900°C and 1-11 kbars). This multiplier can also be justified more rigorously:dividing of T and P values by typical uncertainties of their determination (say, 20° and 0.4 kbar for crustal rocks) will produce the same dimensionless axes;

ratios of V

^{0}_{f}(J/bar) and S^{0}_{f}(J/K) parameters (used in the expression ΔG=ΔH-T×ΔS+(P-1)×ΔV) for the most of minerals have the same order of values 0.04-0.06 (or ≈50 after conversion to kilobars).

Minimization of distances to reaction curves used for "simple averages" makes solutions more stable than averaging based on visible intersections. The program performs linear extrapolation of reaction curves outside XY window if necessary. RMSD values are easy to calculate, this function is strongly convex (in the most cases) and can be effectively minimized by commonly used algorithms:

**PTQ_Avg** works under operating system of the ©MS Windows family and distributed in the form of ZIP archive. It doesn't have any specially designed installer and is ready for use just after extraction of the archive contents (files *PTQ_Avg.exe*, *PTQ_Avg*.chm* and *PTQ_Avg.ini*) to any desired non-protected directory (e.g. to the folder with **PTQuick**). **PTQ_Avg** never writes any data to the system folders and registry, therefore you can simply delete its folder for deinstallation, move it to another place or run the program from removable media.

**PTQ_Avg** requires another program **TriQuick** to be running simultaneously. **TriQuick** acts as a server and editor of diagram graphics.

Identical calculation of "simple averages" is implemented also in **TWQ_View** and **TC_Comb**.