I found that in rare cases the calculation of pH using the Newton method does not converge, thus hanging the program. I added a catch for this - though it might be useful to also add a message that provided if the pH calculation takes too many iterations. I am not sure why it isn't converging because I don't understand the pH calculations well enough. I am happy to share the files necessary to recreate the issue if helpful.
I found that in rare cases the calculation of pH using the Newton method does not converge, thus hanging the program. I added a catch for this - though it might be useful to also add a message that provided if the pH calculation takes too many iterations. I am not sure why it isn't converging because I don't understand the pH calculations well enough. I am happy to share the files necessary to recreate the issue if helpful.