Quartz cement accumulation graph not plotting correctly

Hello, I am trying to model quartz cement accumulation in a fracture. I am currently trying to plot a graph of rate versus temperature but I am not getting a smooth curve as I vary T. Something very strange is plotting. Here is my script:
% q= %Volume of quartz (cm^3)
% T= 250; %constant temp (K)
dt= 1*365*24*3600; %time (s)
S= 50 %surfaces (cm^2), eq. assumes uniform growth rates on all surfaces
time= 0;
Ao= 9E-12; %Pre-exponential Arrhenius constant (mol/(cm^2s))
Ea= 50,000; %Activation energy for quartz precipitation (J/mol)
R= 8.314; %Real gas constant (J/molK)
M= 60.09; %Molar mass of quartz (g/mol)
rho= 2.65; %Density of quartz (g/cm^3)
for T = 0:10:250
q= S*(Ao)*exp((-Ea)/(R*T))*(M/rho)*dt;
rate=q/dt;
plot(0:10:250,rate,'r+')
xlabel('Temperature (C)')
ylabel('Rate (micrometer/m.y.)')
drawnow
hold on
end
% while time < 1*1e6*365*24*3600;
% q= S*(Ao)*exp((-Ea)/(R*T))*(M/rho)*dt;
% time=time+dt
% plot(q,'r+')
% drawnow
% hold on
% end
Any help is greatly appreciated. Thank you!

 採用された回答

Star Strider
Star Strider 2015 年 4 月 5 日

1 投票

Put the plot after the loop, and subscript ‘rate’ within the loop (with the rest of your code before the loop unchanged) and it works:
T = 0:10:250;
for k1 = 1:length(T)
q= S*(Ao)*exp((-Ea)/(R*T(k1)))*(M/rho)*dt;
rate(k1)=q/dt;
end
figure(1)
plot(T,rate,'r+')
xlabel('Temperature (C)')
ylabel('Rate (micrometer/m.y.)')

2 件のコメント

Ashlyn Zare
Ashlyn Zare 2015 年 4 月 5 日

THANK YOU!! WORKS GREAT NOW.

Star Strider
Star Strider 2015 年 4 月 5 日
My pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeNetworks についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by