# Redefining BC within heterogeneous BVP

I am trying to solve the following boundary value problem using an Artificial Neural Network, over the dimensions $$x$$ and $$t$$ for $$x \in [0,1]$$ and $$t \in [0,1]$$. It can be thought of a representing the flow of water through a pipe filled with sand.

$$\frac{\partial }{\partial x} \left ( K \frac{\partial h}{\partial x} \right )= \frac{\partial h}{\partial t}$$

With water added at the $$x=0$$ end of the pipe:

$$\frac{\partial h}{\partial t}(0,t) = 1$$

and an initial water level in the pipe of 1 unit:

$$h(x,0)=1$$

and a closed $$x = 1$$ end of the pipe:

$$\frac{\partial h}{\partial x}(1,t) = 0$$

I have managed to do it when $$K$$ is constant and can be factored out of the derivative. But I can't get it to work when it changes over the domain. For example in the case: $$K(x) = \begin{cases} 1, & x \le 0.5 \\ 0.5, & x > 0.5 \end{cases}$$

I was suggested I should redefine my boundary condition at $$x = 0.5$$, and then solve the problem in each subdomain since $$K$$ would be constant in each of them.

I don't know how to do that, and any help would be welcome.

(I know these problems (and more complex ones) can be solved using FEM and other numerical methods, but I am attempting this exercise out of curiosity)

• what is ANN?--- – Dylan Feb 13 at 17:04
• It is Artificial Neural Network – Sorade Feb 13 at 18:33