Assignment 4 convergence expected

Assignment 4 convergence expected

by Javeria Rizwan -
Number of replies: 1

Hi,

In assignment 4, is the code we submit expected to converge and produce correct answers for the three cases tested in solverexample.cpp?

The initial code I wrote is a success for the first case, but in the second and third cases it fails. 

In the second case, when starting with x=0.2, the solutions oscillate between x=1.489 and x=0.123 on either side of the correct answer of 0.91. In the third case, starting with x=0.2 will cause the error to grow and won't approach the correct answer of -1.

This seems to me to be a feature of the fixed-point algorithm, unless I have missed something obvious. Are we expected to alter the algorithm so that it passes the tests? Or, have I made a mistake with numerics somewhere? Or is having these two failed cases acceptable?


Thanks!

In reply to Javeria Rizwan

Re: Assignment 4 convergence expected

by Ramses van Zon -
Yes, this is expected. The method does not work for all function, and two of the case should not converge.