Research Article
Bernoulli Collocation Method for Solving Linear Multidimensional Diffusion and Wave Equations with Dirichlet Boundary Conditions
Algorithm 2
Implementation of BCM for solving (
4)–(
6).
Step : Collocating the main equation (4): | for | for | ; | ; | end | end | Step : Collocating the boundary conditions (6): | for | ; | ; | ; | ; | End | Step : Collocating the initial conditions (5): | for | ; | ; | ; | ; | end | Step : Assembling the coefficient matrices and right hand side column vectors: | ; | ; | maxit = ; | tol = ; | = gmres(, , tol, maxit) |
|