MATLAB: Finite difference method problem with solving an equation

finite difference method

Trying to use Finite difference method, to write the equation in AT = b matrices. But I don't know how to write FDM on that type of equation, please see image.

Best Answer

(k(x_(i+1/2))*(T(x_(i+1))-T(x_(i)))/(x_(i+1)-x_(i))-k(x_(i-1/2))*(T(x_(i))-T(x_(i-1)))/(x_(i)-x_(i-1)))/(x_(i+1/2)-x_(i-1/2)) = Q(x_i)
with
x_(i+1/2)=(x_(i+1)+x_(i))/2
x_(i-1/2)=(x_(i)+x_(i-1))/2
Best wishes
Torsten.