How to stabilize cyclic tridiagonal matrix algorithm?

78 Views Asked by At

I've received a task which is:

Solve equation by cyclic tridiagonal matrix algorithm: $$ \frac{\partial{f}}{\partial{t}} = \lambda*\frac{\partial{f}}{\partial{x}}, \\ x\in[0,1]\ t\in[0,1] \\ f(t=0,x) = \phi(t) \\ f(t,x = 0) = f(t,x=1)$$

So, I've chosen the inverted triangle scheme and approximated derivatives like this:

$$\frac{f((m+1)*\tau, n*h) - f(m*\tau, n*h)}{\tau} = \lambda\frac{f((m+1)*\tau, (n+1)*h) - f((m+1)*\tau, (n-1)*h)}{2h},\ where$$ $\tau=\frac{t_{max} - t_{min}}{M}$, $h=\frac{x_{max} - x_{min}}{N} $, and $m\in[0, M-1]$, $n\in[1, N-1]$

So far so good, that is what I found about cyclic tridiagonal matrix algorithm:

Cyclic tridiagonal matrix algorithm is applayble for such systems: $$a_1f_N-c_1f_1+b_1f_2 = -\phi_1 \\a_if_{i-1}-c_if_i+b_if_{i+1}=-\phi_2 \\... \\a_Nf_{N-1}-c_Nf_N+b_NF_1=-\phi_N \\a_{i+N}=a_{i},b_{i+N}=b_{i},c_{i+N}=c_{i},f_{i+N}=f_{i}$$

Okay, let's reformulate my task: $$\frac{-\tau\lambda}{2h}f((m-1)*\tau, n*h)-f(m*\tau, n*h) + \frac{\tau\lambda}{2h}f((m+1)*\tau, n*h) = -f(m*\tau, n*h) $$

Hooray, I have $a=\frac{-\tau\lambda}{2h},\ c=1,\ b=\frac{\tau\lambda}{2h}\ and\ \phi=f(m*\tau, n*h)$

And the next line in the book is:

Cyclic tridiagonal algorithm is only stable for $a_i>0,\ b_i>0, c_i>a_i+b_i$

Poof, my solution is wrong, because there is no way, $a_i$ and $b_i$ could be both positive or negative, because they are coefficients in $\frac{\partial f}{\partial x}$ and they always have different signs.

Nevertheless, I've implemented algorithm, and of course it did not converge. I've tried two different versions, one is cyclic tridiagonal matrix algorithm(pdf), but I've got same results.

So my question is: am I wrong? Or is my teacher wrong? Or is there a way to stabilize this algorithm for my task?

It is not one question, but I'm confused) Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

Okay, it was my bad. To be stable $$|c| > |a|+|b|$$ condition should be accomplished, which is entirely possible.