Alternative boundary conditions - Thomas-algorithm

In summary, the conversation discusses using the Thomas Algorithm to solve a diffusion equation with Dirichlet boundary conditions. However, the system is not strictly tridiagonal and the Thomas Algorithm may not be the best method to use. Alternative boundary conditions, such as a ghost node approach or a different numerical method, are suggested to potentially solve the problem more accurately and effectively. It is also important to carefully consider the physical implications of the chosen boundary conditions and method.
  • #1
Huibert
6
0
Alternative boundary conditions -- Thomas-algorithm

Hello,

I have to solve a diffusion equation:
MatrixL * Csim(:,i+1) = MatrixR * Csim(:,i) + BoundaryConditions
where Csim = concentration, j = location, i = time.

Boundary conditions are of type Dirichlet (Csim = 5 at j = 1, Csim = 0 at j = end). So I used:

Code:
MatrixL(1,:) = (1 0 0 . . 0) 
MatrixR(1,:) = (0 0 0 . . 0) 
BoundaryConditions(1) = (5)

so
Matrices, first line: (1 0 . 0) * Csim(:,i+1) = (0 0 . 0) * Csim(:,i) + 5
Matrices, last line: (. . 0 1) * Csim(:,i+1) = (. . 0 1) * Csim(:,i) + 0

--------------------------------------------------------------------------------

To solve this problem with the Thomas Algorithm, I have to write the equation as

Code:
MatrixL2*Csim(:,i+1)  = Csim(:,i)

So MatrixL2 = inv(MatrixR)*MatrixL

However, it is not possible to calculate inv(MatrixR) when MatrixR(1,:)= MatrixR(end,:)= 0

--------------------------------------------------------------------------------

So I tried to describe the boundary conditions in the folloing way :

Matrices, first line: (1 0 0 . .) * Csim(:,i+1) = (1 0 0 . .) * Csim(:,i)
Matrices, last line: (. . 0 0 1) * Csim(:,i+1) = (. . 0 0 1) * Csim(:,i)

But that cat won't jump. So could you please help me to find what's wrong with this?

--------------------------------------------------------------------------------

Because the problem is a littlebit complicated to explain, a longer description is in the attachment.
 

Attachments

  • Question.pdf
    119.9 KB · Views: 193
Physics news on Phys.org
  • #2




Thank you for sharing your problem and asking for assistance. I am a scientist who specializes in numerical methods for solving differential equations, and I have some suggestions for alternative boundary conditions to use with the Thomas Algorithm in your diffusion equation problem.

Firstly, I would like to point out that the Thomas Algorithm is specifically designed for tridiagonal systems, where only the main diagonal and the two adjacent diagonals have non-zero elements. In your case, your system is not strictly tridiagonal due to the Dirichlet boundary conditions at j=1 and j=end. Therefore, the Thomas Algorithm may not be the most efficient or accurate method to use in this case.

One alternative boundary condition that you could try is to use a ghost node approach. This involves extending your domain by one node on each end, and treating the boundary nodes as ghost nodes that have the same concentration as the adjacent interior node. This way, your system becomes tridiagonal and the Thomas Algorithm can be used effectively. However, this may not be the most physically accurate representation of your problem, so it is important to carefully consider the implications of using this approach.

Another option is to use a different numerical method altogether, such as the Crank-Nicolson method, which is better suited for non-tridiagonal systems and can handle a wider range of boundary conditions. It may also be worth exploring if there are any specific methods or techniques that have been developed for solving diffusion equations with Dirichlet boundary conditions.

In any case, it is important to carefully assess the accuracy and stability of your chosen method, and to consider the physical implications of your boundary conditions. I hope this helps and good luck with your problem!
 

1. What are alternative boundary conditions?

Alternative boundary conditions refer to different ways of specifying the values of a mathematical function at the boundaries of a finite domain. These conditions are used in numerical methods, such as the Thomas algorithm, to solve differential equations.

2. How is the Thomas algorithm used to solve differential equations with alternative boundary conditions?

The Thomas algorithm, also known as the tridiagonal matrix algorithm, is a numerical method used to solve tridiagonal systems of equations. This method can be applied to solve differential equations with alternative boundary conditions by discretizing the equations and using the alternative boundary conditions to modify the resulting matrix.

3. What are the advantages of using alternative boundary conditions in numerical methods?

Alternative boundary conditions allow for more flexibility in solving differential equations. They can be used to accurately model physical systems with non-standard boundary conditions and can sometimes improve the convergence and stability of numerical methods.

4. Are there any limitations to using alternative boundary conditions in the Thomas algorithm?

While alternative boundary conditions can be useful, they may also add complexity to the problem and make it more difficult to find an analytical solution. Additionally, the choice of alternative boundary conditions may affect the accuracy and stability of the numerical method.

5. How can one determine the appropriate alternative boundary conditions to use in the Thomas algorithm?

The choice of alternative boundary conditions depends on the specific problem being solved. It is important to carefully consider the physical system and the desired outcome when selecting these conditions. In some cases, it may be helpful to consult with experts in the field or conduct further research on similar problems to determine the most appropriate conditions to use.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
19K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
737
Replies
4
Views
851
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
702
Replies
17
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Differential Equations
Replies
22
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
935
Back
Top