FFT resolution and RelaTol and AbsTol

2 views (last 30 days)
so my question is simple, I modeled an induction motor with an inter-turn short circuit i used a code not in Simulink, so i used ODE 45 with a linear vector tspan ('t_init:step:t_final'), so i noticed that when i increase RelTol (to 1e-3) and AbsTol (to 1e-8) i see new frequencies in my FFT that i dont see when i use tight tolerences like ('1e-6' ans 1e-10'), my question is why i see new frequencies (numerical noise ?), and what is the best solution to have more accurate results?

Accepted Answer

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 20 Jan 2024
There are several critical points to consider here:
Numerical Noise. Higher tolerances of the ODE solvers may take larger steps, and in regions with rapidly changing dynamics; however, tighter tolerances may not capture the whole system behavior accurately. This can result in numerical noise and the appearance of spurious frequencies in the FFT.
To address the accuracy issues of numerical simulations:
(1) Refine a time step: Instead of drastically increasing tolerances, you might consider refining the time stepping in regions of interest. Consider a variable step solver that will take variable step algorithms which can automatically adjust the step size based on the local behavior of the system.
(2) Test Higher-Order Solvers, e.g. ODE113 and also, stiff solvers (e.g., ODE15s) which may be more suitable for stiff systems.
(3) Double-check Initial Conditions: In some unstable or very dynamic systems, small changes in initial conditions can lead to significant behavior changes.
All the best.
  2 Comments
Sofiane
Sofiane on 20 Jan 2024
Thank you for your response Sulaymon,
So if i understand you with 'Refine' is to use Refine in odeset? but what i saw in matlab is that Refine does not apply when length(tspan) > 2, or when the ODE solver returns the solution as a structure.
For stiff solver like ODE15s it's a time consuming for my simulation (t>2h)
and about initial conditions i think they are good.
maybe i will try with ode 113 and i'll see the results!
Thank you again
Sulaymon Eshkabilov
Sulaymon Eshkabilov on 20 Jan 2024
Most welcome! Glad to be of some help :) Thumbs UP :)

Sign in to comment.

More Answers (0)

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!