Research Article

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

Algorithm 3

Implementation of BCM for solving (22)–(24).
Step : Collocating the initial condition (23):
for
for
;
;
end
end
Step : Collocating the boundary conditions (24):
variable discretization:
for
for
;
;
;
;
end
variable discretization:
for
for
;
;
;
;
end
Step : Collocating the main equation (22):
for
for
for
;
;
end
end
end
Step : Assembling the coefficient matrices and right hand side column vectors:
;
;
maxit = ;
tol = ;
= gmres(, , tol, maxit)