Question: write a procedure to solve a given tridiagonal system of equations

I am trying to gain some experience in maple coding, frankly I'm terrible so a tutor has kindly set me some tasks. He wants me to write a procedure for solving any tridiagonal system of equations. Here is his brief: Write a procedure to solve a given tridiagonal system of equations. Use lists to input the coefficients and do NOT use matrices and/or Maple arrays. The procedure can then be called at every time step. This will also be more involved. After a bit of research I know this is the starting matrix: b1x1 + c1x2 = d1 a2x1 + b2x2 + c2x3 = d2 a3x2 + b3x3 + c3x4 = d3 . . . . . . . . . aixi−1 + bixi + cixi+1 = di . . . . . . . . . aNxN−1 + bNxN = dN using Gaussian Elimination we eventially get to: x1 + g1x2 = h1 x2 + g2x3 = h2 x3 + g3x4 = h3 . . . . . . . . . xi + gixi+1 = hi . . . . . . . . . xn = hn Where g1 = c1/b1, gi = ci/(bi − aigi−1), i = 2, 3, . . . , (N − 1) h1 = d1/b1, hi = (di − aihi−1)/(bi − aigi−1), i = 2, 3, . . . ,N Does anyone have any tips on getting started? I have tried to define lists for a, b and c but have failed miserably.
Please Wait...