MELTS Software Users

MELTS for Excel, rhyolite-MELTS (GUI) and alphaMELTS => alphaMELTS 2 Home => alphaMELTS for MATLAB/Python => Topic started by: lelkins on February 17, 2025, 03:12:47 PM

Title: Suppressing liquid and calculating S for Tp with pMELTS in python
Post by: lelkins on February 17, 2025, 03:12:47 PM
Hi Paula! I'm doing some initial testing with alphaMELTS 2 for python, and I would like to do a similar adiabatic/isentropic decompression melting calculation to the old alphaMELTS approach, with a suppressed liquid phase to determine entropy for a given Tp and bulk composition, and then calculating a melting path with the liquid turned back on. So far, I haven't been able to figure out all the necessary commands for python functions and calculations from the available tutorials, though. I know the python versions have been in beta and might not have all of this set up, but I'm finding it hard to tell what functions are possible. Is there an example, or just a list of the python tools and where they are in the package? or maybe some tips on suppressing phases and defining entropy, to get started?

Thanks!
Title: Re: Suppressing liquid and calculating S for Tp with pMELTS in python
Post by: lelkins on February 19, 2025, 06:55:39 AM
Follow up -- I know the python version may not have all of this functionality, which is of course okay. Is there possibly a way to specify the garnet calibration (new vs old) yet, though?
Title: Re: Suppressing liquid and calculating S for Tp with pMELTS in python
Post by: Paula on February 20, 2025, 08:16:46 AM
I haven't tried that particular example but you should be able to pass a "Suppress: liquid" string to setSystemProperties to turn off liquid and then a "Limit number: liquid 1" to turn it on again.

Garnet is the version with the corrected expressions, which I guess it what you mean by 'new', as that is what is in Mark Ghiorso's codebase. (Biotite on the other hand is the 'old' model, again to match Mark's codebase where possible.) Assumption was that if users need other models, including original MELTS, that they'll have to use alphaMELTS 1.X for backwards compatibility.

The methods should all have docstrings so you can do something like "help(meltsengine)". The possible inputs and outputs are described in the .py files - I don't think there's a more efficient way to examine those than opening the file.
Title: Re: Suppressing liquid and calculating S for Tp with pMELTS in python
Post by: lelkins on February 20, 2025, 07:28:52 PM
Aha, thanks! I'll play with the suppressing phase string to see what I can do, and I'll explore some of the other docstrings and options to see what else you have working so far. It will be useful to be able to do single melting trajectories for isentropic melting, and I think we can replicate the perl operations with this. I can share a notebook after I have set it up, if you like!

Otherwise, we're trying to replicate iterative methods to find the minerals and mineral modes that coexist with a specific liquid F at a given pressure, which is a bit tricky but I think should be possible to automate for easier calculations. We're basically looking for the T where F is within a specific threshold at a particular pressure for a lithology. I have a preliminary notebook that I think I can debug to avoid exceptions/cases that don't converge and basically work.

For what it's worth, we have found that the older garnet model works better for predicting garnet behavior more accurately for some lithologies at high pressure (so using pMELTS), like pyroxenites, and it might be useful to find a way to access that model as an option eventually. I don't have an easy way to automate this kind of iterative operation in perl, though that's really because I lack the coding knowledge.