- 69

- 0

$$

h(x,t) = \Delta H .erfc( \frac{x}{2 \sqrt[]{vt} } )

$$

where x is distance, v is diffusivity (material property) and t is time. I have written following code in MATLAB for to find heat distribution at 40 m from the input with time. The input is a sine wave at x=0.

Code:

```
clear; close all; clc;
x = 40; % distance from input to observation point
v = 100; % diffusivity
p = 300; % number of steps
Ti = 0; % Initial head
t = 1:p; % time steps at which calculation is done, lenth(t) should be
equal to length(To)
delH = sin(linspace(0.1,60,p));
h = zeros(1,p);
for m = 1:p
func = x/(2*sqrt(v*t(m)));
h(m) = delH(m) * erfc(func);
end
plot(delH)
hold on;
plot(h)
legend('input','output')
xlabel('time(sec)')
ylabel('temperature')
```