News:

alphaMELTS 2.3 standalone & for MATLAB/Python is now open source and available on GitHub (https://github.com/magmasource/alphaMELTS).
alphaMELTS 1.9 is available at the legacy download and information site.
For news of all MELTS software see the MELTS Facebook page.

Main Menu

Recent posts

#91
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Ri Cao - June 28, 2023, 01:36:21 AM
Dear Paula,
Thank you very much for your prompt response.

Yes, I have emailed you my modified RC12frac.m.

I incorporated the Find Liquidus function from tutorial.m into RC12frac.m at the beginning of the script, but the problem still exists. Please have a look through it. Thank you very much.

Best regards,
Ri
#92
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Paula - June 26, 2023, 11:14:22 AM
Hi Ri,

Can you email me the MATLAB script and input that produced these errors, please? From what you say about removing the "Suppress: leucite" line fixing things, I suspect you've hit a genuine bug and the files would be very helpful to track it down.

Are you calling the Find Liquidus function at the start? If so, make sure to check the status string for errors. I think the RCfrac script just prints the status, rather than examining it. I would expect Find Liquidus to return without crashing MATLAB, even if the liquid composition is outside the range spanned by the MELTS liquid model, so you could use that to bypass the equilibration steps that are more likely to crash MATLAB for an illegal composition.

Thanks,
Paula
#93
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Ri Cao - June 20, 2023, 02:53:57 PM
Dear Paula,
Thank you very much for your prompt response and clarification.

Yes, I run the Matlab-MELTS from the terminal.

I have documented the error message from terminal there:
%%%%%%%
Assertion failed: (mxCreateString called with non-UTF-8 input: bulk                oxygen              olivine            orthopyroxene      clinopyroxene      clinopyroxene      biotite            plagioclase        rutile              spinel              water              ?
), function mxArray *(anonymous namespace)::MxCreateStringNCharsT_safe<char>::operator()(const char *, const SourceType *, size_t) const [SourceType = char], file array2.cpp, line 500.
Caught SIGABRT: usually caused by an abort() or assert()
MATLAB_maci64(50312,0x11249be00) malloc: Incorrect checksum for freed object 0x7faf38edf838: probably modified after being freed.
Corrupt value: 0x4500010001000100
MATLAB_maci64(50312,0x11249be00) malloc: *** set a breakpoint in malloc_error_break to debug
Caught SIGABRT: usually caused by an abort() or assert()
Caught SIGILL: illegal instruction
%%%%
Perhaps this is caused by so many minerals precipitating in the system that closes Matlab automatically?


Another scenario where the systems stop automatically and leave an error message. there is:
%%%%%
MATLAB_maci64(51628,0x700003183000) malloc: Incorrect checksum for freed object 0x7f8ba7b2f400: probably modified after being freed.
Corrupt value: 0x0
MATLAB_maci64(51628,0x700003183000) malloc: *** set a breakpoint in malloc_error_break to debug
%%%%%
I have a thought about this, and it seems that this is related to the inhibition of leucite precipitation. For instance, if I remove "Suppress" "leucite" in the settings, then that works.

One exercise I am currently trying to do is generate 1000 random parental magma datasets of Venus composition within the errorbar (1 sigma). I was wondering if there is a way we could ask Matlab to jump or ignore automatically during the run. For instance, perhaps there is a range for each oxide (i.e., SiO2) that we can set before each run? Any thoughts on this will be really helpful! Thank you very much.

Best regards,
Ri Cao
#94
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Paula - June 20, 2023, 01:03:28 PM
So, there can be various reasons for that. Have a look at the output in the Terminal for clues. That's why I strongly recommend starting MATLAB from the Terminal command line. It's also possible you are hitting a bug in the code.

You can help it a bit by minimizing how much you jump around in P-T-composition space. So, for example, if you are looping over a random selection of pressures then sort the pressures before you start the loop. Also make sure you stay in the range of compositions that MELTS can deal with (that's an error that will show up in the Terminal output).

#95
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Ri Cao - June 20, 2023, 03:40:10 AM
Great, thanks and that works now. Just a quick question there:

Sometimes, when I tried to loop around different bulk compositions or pressures, MATLAB stopped working and closed automatically. Is there something we can do there to optimize/ resolve this issue? Thank you very much.

Best regards,
Ri
#96
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Paula - June 16, 2023, 10:04:17 AM
Yes, that's the idea!
#97
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Ri Cao - June 13, 2023, 07:26:39 AM
Dear Paula,
Thank you very much for your prompt response and clarification.

Yes, I use a Mac computer so the code below works!

For looping around different pressures or FMQ for the same bulk compositions using Matlab-MELTS, perhaps I can just add a ''for'' loop on top of the original RC12frac.m script so that can work? Thank you very much and I look forward to your response.

Best regards,
Ri Cao
#98
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Paula - June 12, 2023, 10:24:29 AM
Hi Ri,

From memory I think you are on a Mac(?) If so, you can start MATLAB from the Terminal, which is the recommended way anyway, and then you can do terminal shell commands from within your scripts by adding an exclamation point at the start. In fact, it looks like some of the commands you might want (e.g. pwd for 'print working directory', 'cd' for change directory, 'ls' for list) are built into MATLAB itself. E.g.

mkdir testoutput
!mv *.tbl testoutput
!mv *_tbl.txt testoutput
!mv melts.out testoutput

If you are on Windows, it may be a bit more complicated but there is more information in the 'system' command documentation: https://www.mathworks.com/help/matlab/ref/system.html

Paula
#99
alphaMELTS for MATLAB/Python / Re: MATLAB for looping T,P spa...
Last post by Ri Cao - June 07, 2023, 04:44:54 AM
Dear Paula,
Thank you very much for your response and clarification. Sorry for the slow response since I was involved in fieldwork and many teaching assignments this term.

The above questions have all been resolved. I can now successfully use MATLAB-MELTS to reproduce the results of LLD predicted from Rhyolite-MELTS

I have a follow-up question there regarding setting up the automatic running for looping different temperatures, pressures, or bulk compositions (keeping T, P the same for each run).

For instance, I was wondering shall I write a ''for loop'' based on the RC12frac.m file so that can loop around different pressures? What kind of strings or code can I add on top of the original Matlab script that can help me save the output of each run (i.e., at each pressure) separately? Any thoughts on this would be really helpful! Thank you very much.

Best regards,
Ri Cao  [/b]
#100
Hi Scott,

Sorry I missed this somehow. (Spam signups were getting out of hand again so I upgraded things, which worked for the spam control but still ironing out a few wrinkles.)

Anyway the standard version of MELTS became Rhyolite-MELTS. Despite the name it's good for the same range of compositions and PT conditions as MELTS, and better for granitic compositions.

For more details, see the second Q&A here: https://melts.ofm-research.org/index.html

Paula