# How to apply Dirichlet boundary conditions to time-dependent PDEs?

Assume the time-dependent linear elasticity equation. Using a finite element discretization we obtain

$$M\ddot{u}=Ku+F_\text{ext}$$

where $$M$$ is the mass matrix,$$K$$ is the stiffness matrix, and $$F_\text{ext}$$ is the external load vector. Further using a time discretization scheme(e.g. Forward Euler), we obtain

$$M\dot{u}_{n+1}=dt(Ku_n+F_\text{ext})+M\dot{u}_n \tag{1} \label{1}$$

for $$N$$ time steps. How can I apply the Dirichlet BC in $$\eqref{1}$$? Consider the case of a 2D rectangle with the bottom edge fixed and a distributed load on the left edge.

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.