I am trying to solve a 3-d second order partial differential equation with non-constant boundary conditions. Please I would appreciate any help on how to do this on matlab using finite difference?.
Running the discretization of a 3D problem in MATLAB might be really slow, as long as you do not use a very coarse mesh. If you really need to study a 3D problem, a different programming environment (C,C++, Fortran, ecc.) is probably better.
Running the discretization of a 3D problem in MATLAB might be really slow, as long as you do not use a very coarse mesh. If you really need to study a 3D problem, a different programming environment (C,C++, Fortran, ecc.) is probably better.
The best results could be obtained if all operations are reduced to multiplication of the state vector of a discrete system by the sparse matrix representing differential operator in your problem. This multiplication executes in Matlab relatively fast. The main advantage of such an approach besides the efficiency is clarity of the code.
I agree with Luca that the Matlab code for large problems in 3-D configuration could be slow. In my experience it is possible to use Matlab for solving problems with 5x10^4 degrees of freedom on Mac laptop from 2007. With the modern machines you can probably increase this number by one order of magnitude.