suppose iam to solve cos x = 2x to 5 decimal places using newton raphson method how many iterations do i need to perform?

Printable View

- Jul 10th 2010, 12:23 AMilikecdecimal places
suppose iam to solve cos x = 2x to 5 decimal places using newton raphson method how many iterations do i need to perform?

- Jul 10th 2010, 12:31 AMelbarto
I imagine that would depend on where your initial guess is - I am sure CB will give a better answer then that. Out of curiosity why do you need to know how many iterations to perform? Are you attempting to implement the function with a for loop rather then a while/do loop?

Regards Elbarto - Jul 10th 2010, 12:50 AMilikec
yeah iam gonna implement using a for loop and ask the user to input the no of correct decimal places needed. so how am i gonna determine the no of correct decimal places at the current iteration?

- Jul 10th 2010, 02:07 AMmr fantastic
What you do is include a condition that is tested after each iteration. Once the condition is true the program ends. You should think about what condition will end the program once you have achieved 5 decimal places of accuracy (Hint: Once you are correct to 5 decimal place, the fifth decimal place will no longer change).

- Jul 10th 2010, 03:29 AMilikec
i got it mr fantasitic. But isn't there a equation that i can use or does theory say that after say n iterations you get x no of decimal places correct?

- Jul 10th 2010, 03:54 AMmr fantastic
- Jul 10th 2010, 04:10 AMAlso sprach Zarathustra
http://www.macalester.edu/aratra/edi...r3/chapt3a.pdf

This is help. I think...