# When mapping FindMinimum to a list, how to find out which instance does not converge

I defined a function f[x,y] and wanted to study its minimum over x when viewing y as a parameter. So I did the minimization for a list of values of y

yList = Table[i/100.0, {i, 1, 99}];
res = FindMinimum[f[x, #], x] & /@ yList;


The problem is that the minimization does not converge for some values of y. I hope to remove the non-convergent results from res (or replacing them by non-numerical values) so that these ill-behaving data points do not appear on the plot I generate using res. How can I do that?

• Good question! You can wrap each FindMinimum with Check in order to handle error messages (see the documentation for details.). E.g., Check[FindMinimum[f[x, #], x], \$Failed] & /@ yList should do what you want. – Henrik Schumacher Jul 31 '19 at 19:55
• @HenrikSchumacher It works! Thanks for your answer. – Epsilon_F Jul 31 '19 at 20:35
• You're welcome! – Henrik Schumacher Jul 31 '19 at 20:40