Here I am writing an implimentation of the sulphide saturation relationship published in the Smythe et. al. (2017) paper. The model uses the thermodynamic activity model of Ghiorso and Sack (1995).
Smythe, D. J., Wood, B. J., & Kiseeva, E. S. (2017). The S content of silicate melts at sulfide saturation: New experiments and a model incorporating the effects of sulfide composition. American Mineralogist , 102 (4), 795–803. https://doi.org/10.2138/AM-2017-5800CCBY
Ghiorso, M. S., & Sack, R. O. (1995). Chemical mass transfer in magmatic processes IV. A revised and internally consistent thermodynamic model for the interpolation and extrapolation of liquid-solid equilibria in magmatic systems at elevated temperatures and pressures. Contributions to Mineralogy and Petrology , 119 (2–3), 197–212. https://doi.org/10.1007/BF00307281/METRICS