I am trying to approximate the exponential of a matrix. I want to use a tolerance but I am confused as to how to compute the error. Any ideas or hints?
Approximating the exponent of a matrix $\exp(A)$ using Taylor series
matrices;matrix
First: there is a must read on this topicMoler, Cleve, and Charles Van Loan. Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later. SIAM review 45.1 (2003): 3-49.(in case you wonder, the original paper is Moler, Cleve, and Charles Van Loan. Nineteen dubious ways to compute the exponential of a matrix. SIAM review 20.4 (1978): 801-836.)More to the question: The following error bound from this slides will be helpful:For a complex  $n\times n$ matrix $A$ let$$T_{r,s} = \Big(\sum_{i=0}^r \frac{1}{i!}\big(\tfrac{A}{s}\big)^i\Big)^s$$then$$\|e^A - T_{r,s}\| \leq \frac{\|A\|^{r+1}}{s^r(r+1)!}e^{\|A\|}.$$