[Date Index] [Thread Index] [Author Index]
Detecting where errors occurred in a Table[ ] calculation?
I often test modules or numerical procedures by making a Table[ ] of test results for a range of input parameters; and this sometimes (well, maybe, nearly always) leads to error messages, like division by zero, or "FindRoot did not converge", for some but not all of the rows in the Table. Finding out *where* these errors occurred -- that is, for what ranges of the input parameter values -- then becomes an exercise in trial and error, removing values from one or the other end of various parameter ranges until the error messages go away. It would be nice to have a simple way to test for whether any error occurred during the evaluation of each individual row in a Table, so that one could then insert say an "*" in a final column of that row to mark each row where an error occurred. Any simple way to accomplish this? (Don't really need to know what specific error occurred, just that there was some error. And obviously, this could be accomplished by calculating and printing individual lines using a Do[ ] loop and seeing where the error messages fall -- although even that will fail after the third error of the same kind.)