I've been working with solving partial differential equations in 1D numerically using the finite difference scheme.
My case is for example this: I've got a rod that's insulated around the sides such that the 1D case makes sense to use, the right side of the rod is connected to something such that the temperature is a constant $T_1$ and the left side a constant $T_2$. (similar to step 3 in the link) If the thermal diffusivity is constant through the rod, then this problem is something I can find solved on the internet everywhere (using a finite difference scheme). But what if the thermal diffusivity is nonuniform, for instance, if the rod is split up into 2 equally big parts but with a different diffusivity for each part, i.e., they are made of two different materials.
Can I then simply make the thermal diffusivity a function of $x_i$, $a= a(x)$, in the equation? That is, write:
$$\frac{\partial u}{\partial t}= a(x)\frac{\partial^2 u}{\partial x^2}$$
instead of
$$\frac{\partial u}{\partial t}= a\frac{\partial^2 u}{\partial x^2}$$
If yes, why? If no, why not?
Note: my question is not of a programming nature, I know I can program that sure - my question is if it would make sense physically.