필터 지우기
필터 지우기

Interpolation in the ODE solver

조회 수: 12 (최근 30일)
Iurii Storozhenko
Iurii Storozhenko 2020년 5월 9일
편집: Torsten 2023년 7월 8일
I am developing the numerical model of a gearbox. The gearmesh stiffness between the gears is a function of time or shaft position. So, on each iteration step i have to evaluate the value of gearmesh stiffness for ODE solver. I have found two possible ways of how to model this:
  1. To precalculate the gearmesh stiffness and save the values in a look-up table. Then on each iteration step in ODE solver simply interpolate values from the look up table. As I have found this approach is not the best, because interp1 function is not optimal, and slow down the calculation process significantly.
  2. Another approach is to make symbolic fourier series outside of ODE solver and reprsent this series as a function handle. Then this function handle is declared as a global variable. So on each iteration step, the gearmesh stiffness is evaluated in ODE solver. In my understanding this approach should be more fast, but it is not.
Could you please suggest, maybe there are some other ways of how this simulation can be done? Thank you!

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 9일
편집: Ameer Hamza 2020년 5월 9일
If I just have the functions in the form of data points, then I will prefer approach 1. This approach will usually be faster even if you have a mathematical model of the system because interp1() do local interpolation, i.e., for linear interpolation, it only uses two nearest points.
However, if the accuracy is critical, then approach 2 will be preferable. However, if you think that a very dense mesh can accurately model your system, then I still recommend approach 1. A dense mesh will trade-off memory for computation speed.
Any other approach apart from these two will usually lead to a more complicated solution without any significant gain.
  댓글 수: 3
Noah Cain
Noah Cain 2023년 7월 7일
How can this first solution be done in practice. I similarly would like to be able to interpolate from a table for each time step in and ODE solver however I do not know how this may be done.
Torsten
Torsten 2023년 7월 8일
편집: Torsten 2023년 7월 8일
Take a look at the example
ODE with Time-Dependent Terms
under

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by