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.
Assertion in struct mxArray_tag *__cdecl `anonymous-namespace'::MxCreateStringNCharsT_safe<char>::operator ()(const char *,const char *,unsigned __int64) const at B:\matlab\foundation\matrix\src\matrix\array2.cpp line 500:
mxCreateString called with non-UTF-8 input: bulk oxygen liquid sphene clinopyroxene clinopyroxene clinopyroxene clinoamphibole clinoamphibole clinoamphibole biotite alkali-feldspar plagioclase quartz tridymite cristobalite leucite rutile spinel rhm-oxide ortho-oxide water ��Q��␂
clear all
close all
P = 2000:250:7750;
T=1000:-20:780;
bulk = zeros(19, 1);
% SiO2, TiO2, Al2O3, Fe2O3, Cr2O3, FeO, MgO
% 1 2 3 4 5 6 8
bulk([1:6 8 11:16]) = [64.6 0.53 16.5 0.15*4.37 0.00 0.85*4.37 2.39 ...
5.23 4.49 1.54 0.00 6.24 0.4];
%, CaO, Na2O, K2O, P2O5, H2O CO2
% 11 12 13 14 15
bcom=100*bulk/sum(bulk);
%% carry out equilibrium crystallisation modelling
ptpath=MELTSdynamic(1);
for i=1:numel(P)
for j=1:numel(T)
disp([P(i),T(j)]);
% Change P-T conditions
ptpath=ptpath.addNodeAfter;
ptpath.engine.set('BulkComposition',bcom);
ptpath.engine.setSystemProperties("Log fO2 Path","+2FMQ")
ptpath.engine.setSystemProperties("Mode", "Fractionate Fluids");
ptpath.engine.pressure = P(i);
ptpath.engine.temperature = T(j);
% calculate the equilibrium
ptpath.engine.calcEquilibriumState(1,1);
disp(ptpath.engine.status.message);
liq=ptpath.engine.getProperty('dispComposition','liquid1');
if liq(19)~=0, break; end
end
end
len=length(ptpath.getListProperty('pressure'));
N={'P','T'};
Conditions=table(zeros(len,1),zeros(len,1));
Conditions.Properties.VariableNames=N;
Conditions.P=ptpath.getListProperty('pressure')';
Conditions.T=ptpath.getListProperty('temperature')';
Names=ptpath.systemNames; nminerals=numel(Names);
Mass=array2table(zeros(0,nminerals));
Mass.Properties.VariableNames=Names;
Mass{1:len,1}=ptpath.getListProperty('mass',Names(1))';
Mass{1:len,2}=ptpath.getListProperty('mass',Names(2))';
for j=3:width(Mass)
Mass{1:len,j}=ptpath.getListProperty('mass',strcat(Names(j), '1'))';
if Names(j)=="rhmoxide1"
Mass{1:len,j}=ptpath.getListProperty('mass','rhm-oxide1')';
end
if Names(j)=="kfeldspar1"
Mass{1:len,j}=ptpath.getListProperty('mass','k-feldspar1')';
end
if Names(j)=="kfeldspar2"
Mass{1:len,j}=ptpath.getListProperty('mass','k-feldspar2')';
end
end
arr=table2array(Mass);
arr(isnan(arr))=0;
plag=arr(2:end,18);
bulk=arr(2:end,1);
Plag=reshape(plag./bulk,numel(T),numel(P));
surf(P,T,Plag); shading interp; hold on
contour3(P,T,Plag,0:0.05:0.5,'Color','w');
xlabel('Pressure,bar')
ylabel('Temperature, ^oC')
zlabel('plag. content')
tabb=[Conditions,Mass];
Best regards Quote% Calculation mode is set in parent MELTSdyanmic list: 1. rhyolite-MELTS 1.0.2; 2. pMELTS; 3. rhyolite-MELTS 1.1.0; 4. rhyolite-MELTS 1.2.0.
% Output is post-equilibration / pre-fractionation (1) by default, but calculation can also be batch, no fractionation (0), or output can be after fractionation (2).