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