How can I find all three roots by Fixed Point Iteration

2 views (last 30 days)
I have to find all of the three roots of the given equation:
g = @(x)(5-((5/2)*exp(x/2))-((7/2)*x^2)-3*x)^1/3
and I'm not sure if my code is right for finding all of the three roots by Fixed Point Iteration. Could smb please take a look at the code and tell me if I should change smth? And one more question: if i = g(i) then i is a root, isn't it? Thanks!
%Computes approximate solution of g(x)=x
%Input: inline function g, starting guess x0,
% number of steps k
%Output: Approximate solution xc
function xc=fpi(g,x0,k)
x(1)=x0;
for i=1:k
x(i+1)=g(x(i));
end
xc=x(k+1);
disp['x0 g(x0)'];
disp([i', g(i)']);
  7 Comments
John Logan
John Logan on 16 Sep 2015
@WalterRoberson, did you find that running my code? Because my professor said it has only 3 roots.
Walter Roberson
Walter Roberson on 16 Sep 2015
Your professor is incorrect if your professor said that about the function you posted. The 5 roots are approximately
-1.5622276995472072141250120471289899414103765220518
0.42511928810478633643455133879439182040526630534348
13.857652165630850665387084082100511119428026149353 + 22.906093584614758165113395486714631993425329919552*i
11.453142346661211378733732793875751819838156169238 + 8.8602737198488354731834939674871915134849319425108*i
11.453142346661211378733732793875751819838156169238 - 8.8602737198488354731834939674871915134849319425108*i
You can plot the function to see that there are no additional real roots.
You can also take the base function Gbase = (5-((5/2)*exp(x/2))-((7/2)*x^2)-3*x) and analyze it, as taking the result to the power of 1/3 is not going to introduce any new roots. You can plot this function and see visually that it is like a parabola which goes to negative infinity visually. But how about the possibility that if you go further and further away from x = 0 that there might be new real roots? Well to analyze that, break Gbase into two parts, (5)-((7/2)*x^2)-3*x) and -((5/2)*exp(x/2) . The first part of that is a regular parabola which can be solved explicitly and determined to be downward pointing, two real roots, so that section is not going to suddenly twist at larger +/- x. The second part -((5/2)*exp(x/2) is a regular exponential function, moving near 0 (no meaningful contribution) for x tending more negative, and increasing negative faster than any polynomial for x tending more positive, which is the direction that the parabola is heading anyhow. Therefore the second part will not introduce any turns at large x. So we are now reduced to the question of whether the interaction of the two terms might lead to three or more roots at small x, and we can see with a simple plot that it does not do so for real values.
The conclusion is that Gbase has exactly two real roots, and therefore G does as well.
Hence either your professor is mistaken or you have misunderstood your professor (for example your professor might have been speaking of the complex roots) or you have posted a formula different than what you intended.

Sign in to comment.

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!