OK, with the disclaimer that what you have there isn't a particularly optimal way to write this code, you can fix your problem by replacing all of the && in the while line with || - your code is exiting when one component of the solution has converged, you should be watching for the worst component to have converged. (Oh, but don't modify the && for the iter expression). i.e.:
while iter < 100 && (abs(dv1)>=0.00001 || abs(dv3)>=0.00001 || abs(dv5)>=0.00001 || abs(dv6)>=0.00001 || abs(dv7)>=0.00001 || abs(dv8)>=0.00001)
Best Answer