Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I am trying to create a nested while loop in Mathcad prime that takes previously identified matrices (global, outside the loop) and augments them until the variable b_uc_cp in the third row of the matrix converges (<5% change).
The while statement itself has a try/on error statement because for initial cases, the criteria would have a divide by zero error.
I have been having issues with this loop, and am wondering if anyone here might have any solutions?
Thank-you so much!
I can't execute your file (I'm limited to express), but I'd expect the while loop processing part to be executed whenever b_cr_cp.3,j-1 equals 0.
If only an error in the try part occurs when this b_cr_cp.3,j-1 is 0, then you can replace the
(b_cr_cp.3,j-1 = 0)
in the 'on error' part with a simple
1
.
Success!
Luc
And on closer look I notice that your b_cr_cp has all zero values on the first, second and fourth rows.
With b_cr_cp.3,j-1 you're accessing data on the fourth row only (ORIGIN=0, means rows and columns start counting from 0 !), which means that the try part in the while loop will always find the error.
Hope this helps.
Success!
Luc