Matlab ADI Method Code | Get Help with Troubleshooting

In summary, the conversation discusses difficulties with implementing the ADI method for a 2-D heat equation in Matlab. The code is intended to have Dirichlet boundary conditions on three sides and a mixed boundary condition on the fourth. The coefficient matrix and source vector are checked after the x-direction loop, but the solution is not working. The code is requested for review and reference. The solution appears to converge to second-order accuracy with larger mesh sizes. The original code and link for reference are requested. The conversation also includes a request for help with Matlab codes for the ADI method of solving the 2-D heat equation.
  • #1
womfalcs3
62
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
  • #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.
 
  • #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.
 
  • #4
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
buvinaughty@gmail.com
 

1. What is Matlab ADI Method Code and how does it work?

Matlab ADI (Alternating Direction Implicit) Method Code is a numerical method used for solving partial differential equations. It works by splitting the problem into smaller, simpler equations and then alternating between solving them in the x and y directions to approximate the solution.

2. How can I obtain the Matlab ADI Method Code?

Matlab ADI Method Code is a built-in function in the Matlab software. It can be accessed by typing "adi" in the command window or by using the "adi" function in a script or function file.

3. What are some common errors that occur when using Matlab ADI Method Code?

Some common errors when using Matlab ADI Method Code include input data errors, convergence errors, and memory overflow errors. These errors can be resolved by carefully checking the input data, adjusting the solver parameters, and increasing the available memory.

4. Can I use Matlab ADI Method Code for any type of partial differential equation?

No, Matlab ADI Method Code is specifically designed for solving parabolic partial differential equations with constant coefficients. It may not be suitable for other types of partial differential equations or problems.

5. How can I troubleshoot issues with Matlab ADI Method Code?

If you are experiencing issues with Matlab ADI Method Code, the first step is to carefully check your input data and make sure it is in the correct format. You can also try adjusting the solver parameters or using a different solver method. If the issue persists, you can seek help from online forums or consult with a Matlab expert.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
2
Replies
41
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
29
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
Back
Top