Did I find an efficiency that impulse(), irf(), and expmv() miss?

I’m working on an iterative algorithm that needs to compute C·exp(A·t)·B many times in a loop for continuous-time LTI systems, so runtime matters a lot.
I found that impulse(), expmv(), and irf() were all slower than I needed for diagonalizable systems, so I wrote my own function. I benchmarked it against all three on R2026a, across system orders n=2 to 512 and time vector lengths L=100 to 10000, using randomly generated stable diagonalizable systems with real eigenvalues.

Speedups are substantial for n ≤ 128 (up to 20x) and the method still wins at higher orders when L is large enough. Accuracy is around 1e-11 relative error vs expm ground truth (compared to ~1e-15 for impulse/expmv), which is more than sufficient for my application.

I feel like I am missing something — maybe 1e-11 is too big of an error, maybe I didn’t test it on enough systems, maybe the cost of checking if its an eigendecomposable system (it’s O(n^3)) is prohibative, maybe it’s just better to use trusted methods? I’d really appreciate it if someone could guide me to the right place on this. Happy to provide more information.I’m working on an iterative algorithm that needs to compute C·exp(A·t)·B many times in a loop for continuous-time LTI systems, so runtime matters a lot.
I found that impulse(), expmv(), and irf() were all slower than I needed for diagonalizable systems, so I wrote my own function. I benchmarked it against all three on R2026a, across system orders n=2 to 512 and time vector lengths L=100 to 10000, using randomly generated stable diagonalizable systems with real eigenvalues.

Speedups are substantial for n ≤ 128 (up to 20x) and the method still wins at higher orders when L is large enough. Accuracy is around 1e-11 relative error vs expm ground truth (compared to ~1e-15 for impulse/expmv), which is more than sufficient for my application.

I feel like I am missing something — maybe 1e-11 is too big of an error, maybe I didn’t test it on enough systems, maybe the cost of checking if its an eigendecomposable system (it’s O(n^3)) is prohibative, maybe it’s just better to use trusted methods? I’d really appreciate it if someone could guide me to the right place on this. Happy to provide more information. I’m working on an iterative algorithm that needs to compute C·exp(A·t)·B many times in a loop for continuous-time LTI systems, so runtime matters a lot.
I found that impulse(), expmv(), and irf() were all slower than I needed for diagonalizable systems, so I wrote my own function. I benchmarked it against all three on R2026a, across system orders n=2 to 512 and time vector lengths L=100 to 10000, using randomly generated stable diagonalizable systems with real eigenvalues.

Speedups are substantial for n ≤ 128 (up to 20x) and the method still wins at higher orders when L is large enough. Accuracy is around 1e-11 relative error vs expm ground truth (compared to ~1e-15 for impulse/expmv), which is more than sufficient for my application.

I feel like I am missing something — maybe 1e-11 is too big of an error, maybe I didn’t test it on enough systems, maybe the cost of checking if its an eigendecomposable system (it’s O(n^3)) is prohibative, maybe it’s just better to use trusted methods? I’d really appreciate it if someone could guide me to the right place on this. Happy to provide more information. impulse, state-space, control-system-toolbox, matrix-exponential, perfomance MATLAB Answers — New Questions

​

Leave a Reply

Your email address will not be published. Required fields are marked *