# Tag Info

The applied division is fine, what went wrong here, is the application of Stoke's theorem. If you multiply with the test function you get following term: $$\int \frac{1}{c_p}\nabla\left(-k\nabla u\right) v d\Omega$$ But $$\int \frac{1}{c_p}\nabla\left(-k\nabla u\right) v d\Omega \neq \int \frac{1}{c_p} \left(k\nabla u\right) \cdot \left(\nabla v\right) d\... 0 If k depends on the spatial variables, the heat equation is of the form$$ c_p u_t = \nabla \cdot (k \nabla u) $$In your case, c_p also depends on space and is discontinuous. You should not try to divide by c_p in this case. At best you can divide by some constant c_{p,ref}, e.g.$$ c_{p,ref} = \max_{x,y} c_p(x,y) $$which is just one in your case. ... 1 Your step two is to solve the original ODE, which doesn't make sense. I'll write out the steps for applying Forward Euler to your second order ODE. Forward Euler solves the first order ODE$$ M \dot{y} = f(y) $$with the steps$$ \begin{align} M k_1 &= f(y_n) \\ y_{n+1} &= y_n + dt \, k_1 \end{align}  Let $v = \dot{u}$. You finite element ...
You simply make sure that the initial condition satisfies the boundary conditions and that you don't add anything to the elements of $u_{n+1}$ corresponding to the boundary. In other words, you drop the rows and columns of $M$ that correspond to the boundary nodes and solve only in the interior nodes. Let me add that inhomogeneous Dirichlet boundary ...