MATLAB Matlab ADI Method Code | Get Help with Troubleshooting

AI Thread Summary
The discussion revolves around difficulties with implementing the Alternating Direction Implicit (ADI) method for solving a 2-D heat equation in MATLAB. The original poster expressed confusion with indexing and loops while trying to apply Dirichlet and mixed boundary conditions. After spending significant time troubleshooting, they believe they have resolved their issues and shared their code for others facing similar challenges. However, some users encountered problems accessing the provided links and requested reposts of the code. Additionally, another user sought MATLAB code for the ADI method for their own project, indicating a broader need for resources related to this topic. The original poster noted that their solution converges to second-order accuracy and aligns well with the expected behavior of the ADI scheme.
womfalcs3
Messages
60
Reaction score
5
Hi,

I've been having some difficulty with Matlab. I keep getting confused with the indexing and the loops.

To set up the code, I am trying to implement the ADI method for a 2-D heat equation (u_t=u_xx+u_yy+f(x,y,t)). I have Dirichlet boundary conditions on the left, upper, and lower boundaries, and a mixed boundary condition on the right boundary.

The coefficient matrix and source vector look okay after the x-direction loop. I have spent well over a 10 hours trying to get it to work.

Can somebody check the code please?

Here's the code:

http://docs.google.com/Doc?docid=0AS848wqcdh80ZHE0Njk2a18xMjZnN3I2cG1kaw&hl=en

f, robinbc, and uexact are obtained from separate script files.

Thank you.
 
Physics news on Phys.org
I finally figured it out... I believe, at least. I'll go ahead and post the code for reference for future visitors who may run into the same issues.

http://www.filefront.com/14925931/ADI-Matlab-Mixed-BC.pdf/

It seems to converge to second-order accuracy with larger and larger mesh size. Other than the fact the solution is good compared to an exact solution, it seems to follow the behavior of the ADI scheme in that regard.
 
Hello,

I was wondering if you could repost your code as I having trouble viewing it. I am working on a similar problem, and am stuck on the indexing.

Thanks a lot.
 
I would also appreciate if you upload the file again.The link does not work, it says that the file is unavailable.
 
sir
me doing project in ADI method of solving 2d heat equation
am urgently in need of MATLAB codes for that.
Can yu help me
buvinaughty@gmail.com
 

Similar threads

Back
Top