Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Can someone help me with this program. I am not able to execute the while statement.
Thanks
Solved! Go to Solution.
wrote:
Can someone help me with this program.
Not sure which kind of help you need
I am not able to execute the while statement.
What do you mean by this? When I open your sheet the calculation of Sol at the end shows no error and returns the values 5 and 48. These are your initial values because your loop is never entered. You compare epsilon 1 to epsilon and you do not define epsilon 1 (and epsilon2) before the while statement. So epsilon1 is considered to be 0 and the condition is not fulfilled and so the program ends.
After we initialize those epsilon values the program fails because the values of the epsilons increase rapidly.
I added a counter to be able to stop the iteration after a few steps and as you can see from the screenshot, after the fifth iteration both epsilons are sure not in the neighbourhood of 0.
Guess you will have to check your formulas.
wrote:
Can someone help me with this program.
Not sure which kind of help you need
I am not able to execute the while statement.
What do you mean by this? When I open your sheet the calculation of Sol at the end shows no error and returns the values 5 and 48. These are your initial values because your loop is never entered. You compare epsilon 1 to epsilon and you do not define epsilon 1 (and epsilon2) before the while statement. So epsilon1 is considered to be 0 and the condition is not fulfilled and so the program ends.
After we initialize those epsilon values the program fails because the values of the epsilons increase rapidly.
I added a counter to be able to stop the iteration after a few steps and as you can see from the screenshot, after the fifth iteration both epsilons are sure not in the neighbourhood of 0.
Guess you will have to check your formulas.