Returns the molar mass (kg/mol) of a chemical formula with mole fraction weighting.
For example, calling the function with
chemical formula = {"LiF","NaK","KF"}
x_i = {0.465,0.115,0.42}
yields
molarMass = 0.102031066 kg/mol.
function CalculateMolarMass_MoleFractionBased input String[:] chemicalFormula = {""} "Array of each species"; input Real[size(chemicalFormula, 1)] x_i = {1.0} "Mole fraction of each species"; output SI.MolarMass molarMass "Molar mass"; end CalculateMolarMass_MoleFractionBased;