I would like to solve an equation for different parameter values, thus, I used Table[] to create an array of solutions. For some parameter combinations {k,A} NSolve does not give an answer, but when I call NSolve outside of Table with the same parameters, it actually works. Below is a minimal example of this behaviour - any ideas where this comes from are much appreciated :-). FYI I am using Mathematica 13.0 MacOS.
function[k_, A_, u1_, u2_] := (1 + Tanh[k (u1 - 2 A u2)])/2 - u1
results[k_, A_] := NSolve[function[k, A, u1, u2] == 0 && function[k, A, u2, u1] == 0 && 0 <= u1 <= 1 &&0 <= u2 <= 1, {u1, u2}]
{results[0.2, 2.2], results[0.2, 2.3], results[0.2, 2.4]}
Table[results[0.2, b], {b , 2.2, 2.4, 0.1}]
Follow up: Here are some more variations. It seems there is a difference between numbers explicitly typed in and those created automatically. When I type all numbers in Table, it works, but when I create a list of numbers with Range and use that in Table, it does not work anymore...
Table[results[0.2, b], {b, {2.2, 2.3, 2.4}}] // Quiet
values = Range[2.2, 2.4, 0.1];
Table[results[0.2, b], {b, values}] // Quiet
And similar issue with Map
Map[results[0.2, #] &, {2.2, 2.3, 2.4}] // Quiet
Map[results[0.2, #] &, values] // Quiet
Table[results[0.2, b], {b, {2.2, 2.3, 2.4}}]
$\endgroup$