cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

While Statement

SOLVED
Highlighted
Regular Member

While Statement

Can someone help me with this program. I am not able to execute the while statement.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: While Statement


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.

Bild.PNG

View solution in original post

1 REPLY 1

Re: While Statement


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.

Bild.PNG

View solution in original post

Announcements