Skip to content

Commit ee97a77

Browse files
authored
Add files via upload
1 parent e953218 commit ee97a77

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

mica.m

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
MC(:,13)=data(:,I(1,13))./W(:,13); %for Cl
137137
end
138138

139-
140139
%% Moles of O2 units
141140
O2(:,1)=MC(:,1).*2; %SiO2
142141
O2(:,2)=MC(:,2).*2; %TiO2
@@ -154,11 +153,46 @@
154153

155154
O2_Sum=sum(O2(:,1:13),2)-0.5.*(O2(:,12)+O2(:,13)); %sum of O2, including F and Cl
156155

157-
O2_N=(11)./O2_Sum; %normalization factor
156+
O2_N=(12)./O2_Sum; %normalization factor
158157

159158
%normalized moles of anions
160159
N_Ox=O2.*O2_N;
161160

161+
%% Iterate OH
162+
163+
%initial oxygens of OH
164+
Hin=2-(N_Ox(:,12)+N_Ox(:,13)); %H = 2 - (F+Cl)
165+
O_OH=(0.5.*Hin)./O2_N; %oxygen moles of H2O
166+
H2Oi=O_OH.*18.015; %initial H2O wt %
167+
168+
for z=1:50
169+
O2(:,1)=MC(:,1).*2; %SiO2
170+
O2(:,2)=MC(:,2).*2; %TiO2
171+
O2(:,3)=MC(:,3).*3; %Al2O3
172+
O2(:,4)=MC(:,4).*3; %Cr2O3
173+
O2(:,5)=MC(:,5); %FeO
174+
O2(:,6)=MC(:,6); %MnO
175+
O2(:,7)=MC(:,7); %MgO
176+
O2(:,8)=MC(:,8); %CaO
177+
O2(:,9)=MC(:,9); %Na2O
178+
O2(:,10)=MC(:,10); %K2O
179+
O2(:,11)=MC(:,11); %BaO
180+
O2(:,12)=MC(:,12); %F
181+
O2(:,13)=MC(:,13); %Cl
182+
O2(:,14)=O_OH; %H2O
183+
184+
O2_Sum=sum(O2(:,1:14),2)-0.5.*(O2(:,12)+O2(:,13)); %sum of O2, including F and Cl
185+
186+
O2_N=(12)./O2_Sum; %normalization factor
187+
188+
%normalized moles of anions
189+
N_Ox=O2.*O2_N;
190+
191+
Hin=2-(N_Ox(:,12)+N_Ox(:,13)); %H = 4 - (F+Cl)
192+
O_OH=(0.5.*Hin)./O2_N; %oxygen moles of H2O
193+
H2Oi=O_OH.*18.015; %initial H2O wt %
194+
end
195+
162196
%% atoms pfu
163197

164198
APFU(:,1)=N_Ox(:,1)./2; %Si
@@ -174,7 +208,8 @@
174208
APFU(:,11)=N_Ox(:,11); %Ba
175209
APFU(:,12)=N_Ox(:,12); %F
176210
APFU(:,13)=N_Ox(:,13); %Cl
177-
APFU(:,14)=sum(APFU,2); %calculations the total
211+
APFU(:,14)=N_Ox(:,14).*2; %OH
212+
APFU(:,15)=sum(APFU,2); %calculations the total
178213

179214
%% Structural Formula
180215

@@ -209,7 +244,7 @@
209244

210245
StrctFrm(:,16)=APFU(:,12); % F (A)
211246
StrctFrm(:,17)=APFU(:,13); % Cl (A)
212-
StrctFrm(:,18)=2-(APFU(:,12)+APFU(:,13)); % OH (A)
247+
StrctFrm(:,18)=APFU(:,14); % OH (A)
213248

214249
%% Endmembers
215250

@@ -747,10 +782,11 @@
747782

748783
end
749784
end
785+
end
750786

751787
all=[StrctFrm DiOct_Endmembers TriOct_Endmembers];
752788
StrctFrm=array2table(all,'VariableNames',{'Si_T','Al_T','Sum_T','Al_M','Ti_M','Cr_M','Fe_M','Mn_M','Mg_M','M_Sum','Ca_I','Na_I','K_I','Ba_I','Total_Cations','F_A','Cl_A','OH_A','XAlcel','XFeAlcel','Xprl','Xmrg','Xpg','Xms','XTriOct','Xphl','Xann','Xeas','Xsid','XDiOct'});
753-
APFU=array2table(APFU,'VariableNames',{'Si','Ti','Al','Cr','Fe','Mn','Mg','Ca','Na','K','Ba','F','Cl','Sum'});
789+
APFU=array2table(APFU,'VariableNames',{'Si','Ti','Al','Cr','Fe','Mn','Mg','Ca','Na','K','Ba','F','Cl','OH','Sum'});
754790

755791
end
756792

0 commit comments

Comments
 (0)