how solve a tridiagonal equation system when we are in three dimensional space?

hi to all.
I have one question.
I want to solve tridiagonal equation system,when a,b,c arrays in coefficient matrix of A are 3D.i,e as following:
Ax = f
or
a(i,j,k)*X(i,j-1,k)+b(i,j,k)*X(i,j,k)+c(i,j,k)*X(i,j+1,k) = f(i,j,k)
that i=1:50 , j = 1:70 , k=1:110;
also,I must mentioned that :
1- a = c
2- 3D a,b,c arrays are created and saved(as 3d full matrices with 50*70*110 size) before the equation solving,and the right hand side(f(i,j,k)) change each time that I want to solve the equation.
what method is best choice for solving?
I know that mldevide(\) method is better(faster) than Thomas algorithms.
but I want to use from sparse matrix concept for 3D case.in 2D I solved Ax=b very simple by spars matrix. but I don't know that what should I do in 3D case.
I saw "ndSparse" method for ND sparse marices,but I don't know how work with it.
I can solve this tridiagonal system with Thomas algorithm,but can not with mldevide method.
in fact,I don't know that how construct A sparse matrix from 3D a,b,c arrays (that are sub-diagonal,main-diagonal and super-diagonal respectively),and also I don't know how implement x = A\f in 3D case.
is there anyone that help me and direct me a little?
best regards... ghasem...

Answers (0)

Categories

Asked:

on 13 Apr 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!