1
alphaMELTS for MATLAB/Python / Re: Total failure of Matlab when using MELTS
« Last post by Paula on March 04, 2021, 12:09:01 pm »Hi Simon,
So if you run your script as is then on the last step (i=14; index=15 in the _tbl.txt files) it adds a third cpx and a third spinel. The compositions are virtually identical to the second cpx and spinel respectively, so it really shouldn't have added them. If you try to add a break point within MATLAB, e.g. with "dbstop if error", it gives a memory error just like it did when you tried restarting the script. I suspect that is all linked but I'm not sure how.
The simplest way to get the script to run to i=1000 is to add the following:
It you limit spinel but not cpx, which is limited to 3 by default anyway, then it gets to i=599 and crashes when hornblende comes in. Likewise if you limit cpx to 2 but not spinel. In both cases there is additional weirdness. I'm not sure why it is adding the extra phases in the way it is but I have some ideas, which may also suggest a more general workaround.
There are several other things to try in addition, and one or more might make your runs go more smoothly:
Anyway, I will try to debug this behavior properly at some point. In the meantime, hopefully that gives you and other something to work with to make the code more reliable.
Paula
So if you run your script as is then on the last step (i=14; index=15 in the _tbl.txt files) it adds a third cpx and a third spinel. The compositions are virtually identical to the second cpx and spinel respectively, so it really shouldn't have added them. If you try to add a break point within MATLAB, e.g. with "dbstop if error", it gives a memory error just like it did when you tried restarting the script. I suspect that is all linked but I'm not sure how.
The simplest way to get the script to run to i=1000 is to add the following:
Quote
path.engine.setSystemProperties("Limit number", "spinel 2");
path.engine.setSystemProperties("Limit number", "clinopyroxene 2");
It you limit spinel but not cpx, which is limited to 3 by default anyway, then it gets to i=599 and crashes when hornblende comes in. Likewise if you limit cpx to 2 but not spinel. In both cases there is additional weirdness. I'm not sure why it is adding the extra phases in the way it is but I have some ideas, which may also suggest a more general workaround.
There are several other things to try in addition, and one or more might make your runs go more smoothly:
- Increase the temperature increment if you can. Unless you are trying to model the granite ternary minimum, something like 1 or 2oC should work pretty well. With 0.1oC I'm not that surprised you are hitting problems with the very small energy differences between the various pyroxenes etc.
- Possibly remove the tiny amount of Cr2O3 from the bulk, as it overstabilizes spinel.
- Start the run at a higher temperature. The terminal output shows that the algorithm is struggling on the first calculation, and I definitely saw one instance where it put metastable hornblende in and then dropped it on the next go.
Anyway, I will try to debug this behavior properly at some point. In the meantime, hopefully that gives you and other something to work with to make the code more reliable.
Paula