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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Issue with While loop

DJF
16-Pearl
16-Pearl

Issue with While loop

I'm probably doing something silly, but I can't seem to find it.  I set up a while loop but it always finishes on the 2nd iteration, when I know fully well it hasn't converged.  Prime 4.0 attached.

2019-02-10_11-43-11.jpg

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:DJF)

As you can see in the attached Screenshot, the values after the first and second iteration are identical, so the iteration stops as demanded.

But after further iterations the two matrices differ again.

You may want to check the initial values of matrix P

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald III
(To:DJF)

I suppose Mdiv and Ndiv are properly defined...

 

Why do you keep summing the error in the inner loop? I should assume it would suffice to assign just abs to Error, not to add it.

 

Check your labels! You have two 'Error's, one is a 'variable', the other is an 'automatic'.

 

Success!
Luc

Werner_E
24-Ruby V
(To:DJF)

As you can see in the attached Screenshot, the values after the first and second iteration are identical, so the iteration stops as demanded.

But after further iterations the two matrices differ again.

You may want to check the initial values of matrix P

DJF
16-Pearl
16-Pearl
(To:Werner_E)

Yep, that's it.  Eta doesn't change the first time through since it's using old temperatures.  So the next pressure calculation doesn't change.  

 

Just need to move the eta calculation down in the list and she works.  

 

Thanks.

Top Tags