I\'m writing a script for studying the temperature distribution throught a 30cm
ID: 3543764 • Letter: I
Question
I'm writing a script for studying the temperature distribution throught a 30cm concrete wall. Here the temperature is 0C att t=0 in the wall but not at the inside where it is 22C. I created the vectors T1 and T2, which represent the tempereture distribution with 30 points. T1 should store the tepmperatur at the old time and T2 for the new time, calculated with a for-loop using the the formula:
(T_{i}(t+delta t) = T_{i}(t)+delta tk*(T_{i+1}(t)-2T_{i}(t)+T_{i-1}(t))/delta x^2) knowing that (delta t = 0.5*delta x^2/k) where
k = lambda/(c*rha) where lambda is the temperature conductivity, c is the temerature capacitivity and rha the density.t=0.5density of the concrete. My script so far:
my code so far:
T1=zeros(30);
T1(1)=22;
T2=linspace(0,0.3,30);
Greatful for help!
Explanation / Answer
I don't think you've given enough data in your quesstion. Is dt the differential time? If so, how can it depend on dx and k?