Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab - ADI Method Code

  1. Nov 14, 2009 #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.
     
  2. jcsd
  3. Nov 14, 2009 #2
    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.
     
  4. Nov 16, 2009 #3
    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.
     
  5. Nov 29, 2009 #4

    SFB

    User Avatar

    I would also appreciate if you upload the file again.The link does not work, it says that the file is unavailable.
     
  6. Jan 7, 2010 #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
    buvinaughty@gmail.com
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Matlab - ADI Method Code
  1. Matlab codes (Replies: 2)

  2. Matlab code (Replies: 0)

  3. Error code in Matlab (Replies: 3)

Loading...