Fixed Point Iteration - initial guesses

I have the fixed point iteration x(i+1) = g(xi) where g(x) = 1 - 5x + 15/2x^2 - 5/2x^3. From this I have to find initial guesses for which FPI cycles endlessly through interval (0, 1), interval (1, 2) and when it diverges to infinity.
Is anyone able to give me some tips as to how I would do this please? Thanks!

댓글 수: 2

Roger Stafford
Roger Stafford 2016년 5월 10일
Tell us what ideas you have come up with so far.
Britt
Britt 2016년 5월 10일
편집: Britt 2016년 5월 10일
@Roger Stafford Well this is the code I've tried to implement for the FPI, but I'm not sure how to relate it to the questions more.
function xc = fpi(g, 0, k)
x = zeros(1, k + 1);
x(1) = x0;
for i = 1:k
x(i + 1) = g(x(i));
end
xc = x(end);
But every time I try and run this in matlab I get the answer xc = 1 no matter what. I tried to run it with:
g = @(x) 1 - 5*x + (15/2)*x.^2 - (5/2)*x.^3;
xc = fpi(g, 0, 1)

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

답변 (1개)

Roger Stafford
Roger Stafford 2016년 5월 10일

0 개 추천

I think what you need, instead of the simple for-loop you have described which just executes a fixed number of times, is a while-loop or for-loop with ‘break’ which exit either after some fixed number of times or when the value of x goes beyond a reasonable limit. You also need to place all of this in some outer code which systematically tries a whole range of closely-spaced initial values so that you don’t have to keep restarting it manually numerous times. You also need a way in such code of automatically recording those initial values which remained indefinitely within limits and those that eventually escaped to infinity.
Incidentally, the name ‘fixed-point’ should get your attention. There are three magic initial points for x that should in theory be just that - fixed points: initial values that remain unchanged as the iteration proceeds. It would be useful for you to determine what they are. Hint: Look at matlab’s ‘roots’ function.

댓글 수: 2

Britt
Britt 2016년 5월 11일
I really appreciate your answer, I just wish I understood what any of it meant enough for me to answer the question hah
Britt
Britt 2016년 5월 11일
편집: Britt 2016년 5월 11일
@Roger Stafford I've found the roots on matlab, the answer I get is
2.1597 + 0.0000i
0.4201 + 0.0932i
0.4201 - 0.0932i
I know this means that 2.1597 is the real root when the function equals zero. But I'm not sure what the other two are, and how I can use this to answer my question.

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2016년 5월 10일

편집:

2016년 5월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by