MATLAB Answers

fitting of a sinusoid

1 ビュー (過去 30 日間)
Anik Faisal
Anik Faisal 2019 年 6 月 13 日
回答済み: Jesús Zambrano 2019 年 8 月 4 日
Hi Everyone!
I have generated energy change (gammas.mat) of a simulation cell as a function of rigid displacement (ubp.mat) of upper half of the simulation cell with respect to to the lower half from atomistic calculations. I was trying to fit the energy vs displacement data to continous function of the displacement. I have tried using the curve fitting tool and the sum of sine model with 6 terms shows good agreement except at zero displacement where the fitting produces a negative value for the energy which is not physical since no change in energy before the displacement is initiated. I have attached a screenshot of the curve fitting tool's attempt.
I am looking for suggestions if I the data fitting can be done with a zero energy at zero displacement. Thanks!
Screen Shot 2019-06-12 at 10.31.09 PM.png

  0 件のコメント

サインインしてコメントする。

回答 (1 件)

Jesús Zambrano
Jesús Zambrano 2019 年 8 月 4 日
Hi Anik,
Try to use the Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) function. The function pchip does not include oscillations between sample points. You can see the comparison between pchip and spline in the link below, with some examples:
Hope this asnwer can help you to solve your question.

  0 件のコメント

サインインしてコメントする。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by