Alternative boundary conditions - Thomas-algorithm

  • Thread starter Huibert
  • Start date
  • #1
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: 128

Answers and Replies

Related Threads on Alternative boundary conditions - Thomas-algorithm

  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
0
Views
3K
  • Last Post
Replies
0
Views
8K
Replies
1
Views
1K
Replies
0
Views
861
Replies
1
Views
639
Replies
17
Views
5K
Replies
3
Views
834
Replies
2
Views
559
Replies
21
Views
2K
Top