I've been trying to solve a system of equations numerically using FindRoot. The following is my code, and it worked well.
SysEqn = Table[40a[i]-Sum[If[j == i, 0, 1/(a[i] - a[j])] , {j, 1, 20}], {i, 1, 20}]; data = Table[a[i] /. FindRoot[ SysEqn, {{a[1], 0.05}, {a[2], 0.1}, {a[3], 0.15}, {a[4], 0.2}, {a[5], 0.25}, {a[6], 0.3}, {a[7], 0.35}, {a[8], 0.4}, {a[9], 0.45}, {a[10], 0.5}, {a[11], 0.55}, {a[12], 0.6}, {a[13], 0.65}, {a[14], 0.7}, {a[15], 0.75}, {a[16], 0.8}, {a[17], 0.85}, {a[18], 0.9}, {a[19], 0.95}, {a[20], 1}}], {i, 1, 20}] Here I want to increase the number of variables from 20 to bigger numbers but I can't find an effective way to assign starting values for a[i] in that case. Is there any way to simplify the following...?
{{a[1], 0.05}, {a[2], 0.1}, {a[3], 0.15}, {a[4], 0.2}, {a[5], 0.25}, {a[6], 0.3}, {a[7], 0.35}, {a[8], 0.4}, {a[9], 0.45}, {a[10], 0.5}, {a[11], 0.55}, {a[12], 0.6}, {a[13], 0.65}, {a[14], 0.7}, {a[15], 0.75}, {a[16], 0.8}, {a[17], 0.85}, {a[18], 0.9}, {a[19], 0.95}, {a[20], 1}} I tried with For but the FindRoot doesn't work with For inside, at least when I tried...