Matlab ADI Method Code | Get Help with Troubleshooting

  • Context: MATLAB 
  • Thread starter Thread starter womfalcs3
  • Start date Start date
  • Tags Tags
    Code Matlab Method
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting Matlab code for implementing the Alternating Direction Implicit (ADI) method applied to a 2-D heat equation with specific boundary conditions. Participants seek assistance with indexing and loops in their code, as well as sharing their experiences and solutions related to the implementation.

Discussion Character

  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • One participant expresses confusion regarding indexing and loops while implementing the ADI method for a 2-D heat equation, mentioning specific boundary conditions.
  • Another participant claims to have resolved their issues and shares their code, noting that the solution converges to second-order accuracy with increasing mesh size.
  • Several participants request reposting of the code due to issues with accessing shared links.
  • A participant expresses urgency in obtaining Matlab codes for the ADI method, indicating they are working on a related project.

Areas of Agreement / Disagreement

There is no consensus on the effectiveness of the proposed solutions, as some participants are still facing issues with accessing the code and understanding the implementation details.

Contextual Notes

Participants have not resolved specific issues related to indexing and loops, and there are unresolved questions about the accessibility of shared code links.

Who May Find This Useful

Individuals working on numerical methods for partial differential equations, particularly those using Matlab for the ADI method, may find this discussion relevant.

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

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 41 ·
2
Replies
41
Views
10K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K