Determining the right relative and absolute tolerances
3 ビュー (過去 30 日間)
古いコメントを表示
My program generates an essentially sinusoidal output. Using the various relative and absolute tolerances I obtained the following fits to a sine function (with about 2e4 data points):
ReTol = 1e-5, AbTol = 1e-7, Sinefit amplitude = 22.1383, phase = -0.10532, fminsearch err = 71211.296;
ReTol = 1e-5, AbTol = 1e-8, Sinefit amplitude = 22.1383, phase = -0.10532, fminsearch err = 71211.296;
ReTol = 1e-6, AbTol = 1e-7, Sinefit amplitude = 24.5425, phase = +0.22298, fminsearch err = 61670.879;
ReTol = 1e-6, AbTol = 1e-8, Sinefit amplitude = 24.5335, phase = +0.22210, fminsearch err = 106022.2668;
I tend to choose ReTol = 1e-5, AbTol = 1e-7, as reducing absolute tolerance doesn't change the result. However if I reduce relative tolerance I obtain different results (especially the phase). Thus what should I choose? ReTol = 1e-5, AbTol = 1e-7, or ReTol = 1e-6, AbTol = 1e-7?
11 件のコメント
Torsten
2025 年 1 月 5 日
編集済み: Torsten
2025 年 1 月 5 日
As I answered in another question of yours
, it's impossible to get more maxima because the number of maxima if given by the solution of the PDE system. E.g. if your solution were y(x)=sin(x), you would get maxima and minima at odd multiples of pi/2, and no modification of the code could give you more of them. Or do I get wrong what you are asking for ?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Eigenvalue Problems についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!