Bernoulli Collocation Method for Solving Linear Multidimensional Diffusion and Wave Equations with Dirichlet Boundary Conditions