AquaticEcoDynamics / libaed2

Code for the AED2 water quality / ecology library
http://aquatic.science.uwa.edu.au/research/models/AED/
GNU General Public License v3.0
15 stars 17 forks source link

added stop to carbon ph calculation if not converging #13

Open rqthomas opened 5 years ago

rqthomas commented 5 years ago

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.