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 个评论

Tell us what ideas you have come up with so far.
@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 个)

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 个评论

I really appreciate your answer, I just wish I understood what any of it meant enough for me to answer the question hah
@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