How to increase SPEED of solving linear system

6 ビュー (過去 30 日間)
Michael Johnson
Michael Johnson 2015 年 3 月 29 日
回答済み: Star Strider 2015 年 3 月 29 日
I am making a gui with a dynamic plot linked to sliders and edit text boxes. So, i want to the plot to update AS FAST AS POSSIBLE.
i have written a function that uses RK4 method to numerically solve any linear forced/unforced system, but it is too slow! takes about 2-5 (sometimes more) seconds to update!
theres two other options i have:
1) numerically evaluate 3 different convolution integrals for umdamped, overdamped, critically damped cases rather than solving a system of differential equations.
2) somehow take advantage of Fourier Transform, and doing computations in the frequency domain then inverse Fourier Transform back to time domain.
I believe option 2 will be fastest.. but what kind of built in functions does matlab have for Fourier Transform?
and what is FFT (fast fourier transform, ive seen that term thrown around here before)

回答 (1 件)

Star Strider
Star Strider 2015 年 3 月 29 日
For the fft, consider the Signal Processing Toolbox dftmtx function. I have no recent experience with it, but it may reduce the fft and inverse operations to a matrix multiplication and division.
If your system is linear, another option (and my preference in my own applications) is the expm function.

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by