Matlab - ADI Method Code

  • MATLAB
  • Thread starter womfalcs3
  • Start date
  • #1
60
1
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.
 

Answers and Replies

  • #2
60
1
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.
 
  • #3
1
0
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.
 
  • #4
SFB
39
0
I would also appreciate if you upload the file again.The link does not work, it says that the file is unavailable.
 
  • #5
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
[email protected]
 

Related Threads on Matlab - ADI Method Code

  • Last Post
Replies
7
Views
8K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
0
Views
1K
  • Last Post
Replies
4
Views
5K
  • Last Post
Replies
13
Views
11K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
14
Views
5K
Top