Use the following equations and information to plot heat capacities of Cu(s) and Ni(s) as a function of temperature. Cu(s): C_p (T)=30.29-​0.01017∙T-​322000∙T^(​-2)+(9.47×​〖10〗^(-6) )∙T^2 S_298^0=33.2 Ni(s): C_p (T)=11.17+​0.03778∙T+​31800∙T^(-​2) S_

3 views (last 30 days)
I have the code as follows:
Cu=[];
Ni=[];
T=[];
for T=1:1500;
Cu(T)=30.29-(.01017*T)-(322000/(T^2))+((9.47*10^(-6))*T^2);
Ni(T)=11.17+(0.03778*T)+(31800/(T^2));
T(T)=T+1
end
plot(Cu,T)
hold on
plot(Ni,T)
I can't figure out how to get the numbers of Cu and Ni and T to save into such a way that I can plot them.

Answers (1)

Walter Roberson
Walter Roberson on 4 Feb 2016
The more general form:
Tvals = 1:1500;
nT = length(Tvals);
Cu = zeros(1, nT);
Ni = zeros(1, nT);
for Tidx = 1 : length(Tvals)
T = Tvals(Tidx);
Cu(Tidx) = 30.29-(.01017*T)-(322000/(T^2))+((9.47*10^(-6))*T^2);
Ni(Tidx) = 11.17+(0.03778*T)+(31800/(T^2));
end
plot(Tvals, Cu)
hold on
plot(Tvals, Ni)

Tags

Community Treasure Hunt

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

Start Hunting!