%
% Solution of a tri-diagonal system of equations.
% (see Smith Ex. 2.2,
%  but note that signs of a and c coefficients were changed)
%
% n is the number of equations
% a is the left diagonal vector (first element is ignored)
% b is the main diagonal vector
% c is the right diagonal vector (last element is ignored)
% d is the forcing vector
% u is the solution vector
%

function u = TriDiagonal( n, a, b, c, d )

    % Forward elimination
%COMPLETE AQUI

    % Back substitution
%COMPLETE AQUI

end