Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Evaluate the inverse of a tridiagonal matrix
ResourceFunction["TridiagonalInverse"][a,b,c] gives the inverse of the tridiagonal matrix with subdiagonal a, diagonal b and superdiagonal c. |
The inverse of a 3×3 tridiagonal matrix:
In[1]:= |
Out[1]= |
Multiply with the original tridiagonal matrix:
In[2]:= |
Out[2]= |
TridiagonalInverse can be used with numerical entries:
In[3]:= |
Out[3]= |
In[4]:= |
Out[4]= |
Construct a natural cubic spline interpolant to data:
In[5]:= |
Out[5]= |
Plot the interpolant along with the data:
In[6]:= |
Out[6]= |
Approximately solve the boundary value problem u{XMLElement[span, {class -> stylebox}, {x, XMLElement[i, {class -> ti}, {x}]}]}+u=f;u(0)=u(1)=0:
In[7]:= |
Out[7]= |
Show the error compared with the exact solution:
In[8]:= |
Out[8]= |
TridiagonalInverse can be faster than using Inverse on a tridiagonal matrix constructed with SparseArray and Band:
In[9]:= |
In[10]:= |
Out[10]= |
This work is licensed under a Creative Commons Attribution 4.0 International License