Dear Bob first of all i hope everithing is going well and your 2024 started in the best way!
I came back after my honeymoon with my wife and for this reason i let in stand by my work with the equation on BurnMan.
I tried the script you furnished me and it works well for the first part:
import burnman
from burnman import minerals, equilibrate
from burnman.tools.chemistry import equilibrium_temperature
from burnman.tools.chemistry import reactions_from_formulae
from burnman.tools.polytope import simplify_composite_with_composition
fo = minerals.HP_2011_ds62.fo()
di = minerals.HP_2011_ds62.di()
en = minerals.HP_2011_ds62.en()
dol = minerals.HP_2011_ds62.dol()
CO2 = minerals.HP_2011_fluids.CO2()
assemblage = burnman.Composite([fo, di, en, dol, CO2])
reaction_stoichiometry = reactions_from_formulae(assemblage.endmember_formulae, assemblage.endmember_names, return_strings=False)
P = 2.6e9
T = equilibrium_temperature(assemblage.phases, reaction_stoichiometry[0], P, 1500.0)
print(f"Equilibrium temperature of endmember reaction at {P/1.e9:.2f} GPa: {T:.0f} K")
Then for the second part:
Calculate the equilibrium temperature CO2-in isopleth from assemblage
endmembers: en, fs, fm, odi, mgts, cren, mess
opx = minerals.JH_2015.orthopyroxene([0.95, 0.0, 0.0, 0.04, 0.01, 0.0, 0.0])
endmembers: di, cfs, cats, crdi, cess, jd, cen, cfm
cpx = minerals.JH_2015.clinopyroxene([0.95, 0.0, 0.01, 0.0, 0.0, 0.0, 0.04, 0.0])
endmembers: py, alm, gr, andr, knor
gt = minerals.JH_2015.garnet([0.95, 0.0, 0.05, 0.0, 0.0])
Create assemblage from the full solutions
assemblage = burnman.Composite([fo, cpx, opx, dol, gt, CO2], [0.01, 0.01, 0.48, 0.48, 0.01, 0.01])
Simplify the solutions because we are interested only in the CMAS system
assemblage = simplify_composite_with_composition(assemblage, assemblage.formula)
Implement the equality constraints
equality_constraints = [[“P”, P], [“phase_fraction”, [CO2, 0.0]]]
It is perfect until here.
Calculate the equilibrium from the equality constraints
sol = equilibrate(assemblage.formula, assemblage, equality_constraints)
After the script i found different errors here described:
AttributeError: ‘Solution’ object has no attribute ‘molar_fractions’
Is there any problem with the script?
Thank you in advance