- #1
jkthejetplane
- 29
- 4
- Homework Statement
- Ok so i am relatively new to matlab but my course had an emphasis much more on the applications of numerical methods rather than teaching coding (same with text). So most of my previous plotting was from modifying given programs to use a differnt math method of some sorts. Basically i am unsure how to make this T vs C plot correctly haha
In previous codes i have seen where they store the value during the loop (T and C in my case) for each iteration
- Relevant Equations
- No Equations needed
Matlab:
%Debeye theory Heat Capacity of Copper
%Garcia Problem 10.16
%Find molar heat capacity from 0-1083K (melting point of Cu)
k = 1.38064852e-23; %Boltzmann's constant
N = 6.02214e23; %Avagadro's number (atoms per mol)
T = 0:1083 ; %Initialize Temp at 0K-1083K
theta = 309; %Debeye temp of Cu (K)
coef = 9.*k.*N %Coef of constants
f = @(x) (x.^4).*(exp(x)./(exp(x) - 1)); %Function inside integralfor i = 1:length(T)
top = theta./T(i); %Top boundary of integral
Int = integral(f,0,top);
C = 9.*k.*N.*((T(i)/theta).^3).*Int; %Debye Heat Capacity Eq
end