Detecting where errors occurred in a Table[ ] calculation?
- To: mathgroup at smc.vnet.net
- Subject: [mg33807] Detecting where errors occurred in a Table[ ] calculation?
- From: aes <siegman at stanford.edu>
- Date: Tue, 16 Apr 2002 03:52:24 -0400 (EDT)
- Organization: Stanford University
- Sender: owner-wri-mathgroup at wolfram.com
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.)