Looking to model the precipitation of a mineral, which occurs at a rate, r (mM Kg-1 hour-1), which is dependent on the ion activity product (IAP). As the mineral precipitates, the concentration of species in solution decreases, and so the IAP also reduces and the rate slows down. I'm new to Matlab so just looking to get some basic pointers on iterative calculations ([Fe] depends on the rate of mineral precipitation and the rate depends on [Fe]) as well as modelling through time using discrete time steps (e.g. [Fe] vs time).
Code I have so far is basic chemistry:
cla;clf;%Basic rate calculation
Fe=0.01*0.26/1000; %mM, activity coefficient, convert to M
Si=1.8/1000; %Input mM, convert to M
pH=8;H=10^(-pH);k=1.11*10^(-9);b=1.81;Ksp=4.68*10^(22);IAP=(Fe^(3)*Si^(2))/H^(6);logIAP=log10(IAP); logKsp=log10(Ksp); rate=k*exp(b*(logIAP-logKsp)); %mm Fe Kg-1 hour-1
%Fe calculation
time=0.01;Fet=Fe-(rate*time);
Thanks!
Best Answer