MATLAB 3D Finite different method using matlab

AI Thread Summary
The discussion focuses on solving the 3D diffusion equation using the finite difference method (FDM) in MATLAB, specifically on a cubic periodic domain with N lattice points in each direction. Participants emphasize the importance of defining the system and matrices correctly, particularly using nearest and next nearest neighbors in the stencil. Key definitions include I am = (1:N)-1, where adjustments are made for periodic boundaries, and Ip = 2:N+1 with similar boundary conditions. The conversation highlights the need for clarity on the time update algorithm being utilized, suggesting that understanding this aspect is crucial for effectively implementing the solution. There is also a suggestion for the user to attempt the problem independently before seeking further assistance.
nnadiya
Messages
2
Reaction score
0
Can anyone show me how to solve the 3D diffusion equation which has been modeled into FDM by using matlab?
 
Physics news on Phys.org
Suppose your stencil only uses nearest and next nearest neighbors on a cubic periodic domain with N lattice points in each direction. Define I am = (1:N)-1;Im(Im==0)=N; and Ip = 2:N+1;Ip(Ip==N+1)=1; Define your system and matrices and use A(lp,lp,lm) ## \sim A_{i+1,i+1,i-1} ## in your stencil.
 
Strum said:
Suppose your stencil only uses nearest and next nearest neighbors on a cubic periodic domain with N lattice points in each direction. Define I am = (1:N)-1;Im(Im==0)=N; and Ip = 2:N+1;Ip(Ip==N+1)=1; Define your system and matrices and use A(lp,lp,lm) ## \sim A_{i+1,i+1,i-1} ## in your stencil.
Can I learn further from you?
 
You are sure you don't want to try yourself first? Also you haven't mentioned which time update algorithm you are using.
 

Similar threads

Replies
9
Views
3K
Replies
2
Views
4K
Replies
23
Views
5K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
10
Views
3K
Replies
3
Views
5K
Back
Top