필터 지우기
필터 지우기

Bernstein gives unstable plots

조회 수: 2 (최근 30일)
Sahithi Chaganti
Sahithi Chaganti 2016년 1월 12일
댓글: Torsten 2016년 1월 15일
Following is my code
syms t
b3 = bernstein(@(t) 1/(1 + 25 * t^2), 3, t);
b10 = bernstein(@(t) 1/(1 + 25 * t^2), 10, t);
b100 = bernstein(@(t) 1/(1 + 25 * t^2), 100, t);
ezplot(1/(1 + 25 * t^2),[0,1])
hold on
ezplot(b3,[0,1])
ezplot(b10,[0,1])
ezplot(b100,[0,1])
legend('sine function','3rd-degree polynomial',...
'10th-degree polynomial','100th-degree polynomial')
title('Bernstein polynomials')
hold off
figure
ezplot(1/(1 + 25 * t^2),[-1,1])
hold on
ezplot(b3,[-1,1])
ezplot(b10,[-1,1])
ezplot(b100,[-1,1])
legend('sine function','3rd-degree polynomial',...
'10th-degree polynomial','100th-degree polynomial')
title('Bernstein polynomials')
hold off
Why does Bernstein result in unstable values over the interval [-1,1]? From the documentation of Bernstein function, I understand that Bernstein polynomial approximates the function f over the interval [0,1]. What to do if I need the Bernstein polynomial to approximate a function over the interval [-1,1].
  댓글 수: 1
Torsten
Torsten 2016년 1월 15일
B_[a:b](x)=B_[0:1]((x-a)/(b-a))
Bernstein polynomials on [a:b], evaluated at x, are just the Bernstein polynomials on [0:1], evaluated at t=(x-a)/(b-a).
Best wishes
Torsten.

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

답변 (1개)

Walter Oevel
Walter Oevel 2016년 1월 15일
Hi Saithi,
why do you expect the Bernstein representation to be numerically stable on [-1, 1]? It is designed to be stable on [0, 1] only. However, it is not invariant under the transformation t -> -t, although the original function is and the expanded/simplified version of the Bernstein polynomial is, too (note, however, that the latter is not a numerically stable representation).
The work-around may be the following: subtitute t^2 by y in the original function, do a Bernstein expansion w.r.t. y, then substitute back y by t^2. Of course, this is not the same as the Bernstein expansion of a given degree w.r.t. t, but it might do for your purposes.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by