0
$\begingroup$

I have a system of 45 polynomial nonlinear equations for 45 unknowns. I'd like to numerically solve this system. When I used NSolve it 'hung' for awhile without producing a result so I decided to attempt the more conservative 'FindRoot'. However, get the "Encountered a singular Jacobian at the point..." error. To combat this I set random initial search points using RandomReal. Unfortunately running this by hitting 'shift+enter' many times hasn't been able to bypass this problem.

what I'd like help with is writing a simple piece of code to loop over the FindRoot request that perturbs the initial values until a solution is found (hence not receiving the singlular Jacobian error).

Here is the code - newComboEqs is a list of 45 long polynomial equations which is then used with FindRoot below

newComboEqs = 
{35.0443 b1^2 + 35.0443 c1^2 + 1.58692 b1 d1 + 
   18.4826 d1^2 + 15.5847 b1 e1 + 1.58692 c1 e1 + 18.4826 e1^2 + 
   a1 (15.1696 b1 - 43.4924 c1 - 5.84798 d1 + 8.94205 e1) + 
   a1^2 (-55.5994 + k21 + k31 + k41 + k51) == 
  15.5847 c1 d1 + a2^2 k21 + a3^2 k31 + a4^2 k41 + a5^2 k51, 
 3.46397 a1^2 + 10.9995 b1^2 + 1.20812 b1 d1 + 
   c1 (10.9995 c1 + 23.5226 d1 + 1.20812 e1) + 
   a1 (-17.6958 c1 + 10.1573 d1 + 4.84489 e1 + 
      b1 (-83.4328 + k21 + k31 + k41 + k51)) == 
  2.53476 d1^2 + 23.5226 b1 e1 + 2.53476 e1^2 + a2 b2 k21 + 
   a3 b3 k31 + a4 b4 k41 + a5 b5 k51, 
 4.43487 a1^2 + 7.88179 b1 d1 + 3.39302 c1 d1 + 3.46106 d1^2 + 
   7.88179 c1 e1 + 3.46106 e1^2 + 
   a1 (1.54145 b1 + 1.1684 c1 - 50.2956 d1 + 24.6034 e1 + d1 k21 + 
      d1 k31 + d1 k41 + d1 k51) == 
  8.29647 b1^2 + 8.29647 c1^2 + 3.39302 b1 e1 + a2 d2 k21 + 
   a3 d3 k31 + a4 d4 k41 + a5 d5 k51, 
 26.2297 a1^2 + 16.8713 c1 d1 + 15.9731 d1^2 + 
   b1 (-2.82997 d1 - 16.8713 e1) + 
   a1 (-16.5007 b1 + 13.6825 c1 + 4.04856 d1 - 12.989 e1) + 
   15.9731 e1^2 + c1^2 k21 + c1^2 k31 + c1^2 k41 + c1^2 k51 + 
   b1^2 (-56.7918 + k21 + k31 + k41 + k51) == 
  56.7918 c1^2 + 2.82997 c1 e1 + b2^2 k21 + c2^2 k21 + b3^2 k31 + 
   c3^2 k31 + b4^2 k41 + c4^2 k41 + b5^2 k51 + c5^2 k51, 
 23.9118 a1^2 + 5.34363 b1^2 + 5.34363 c1^2 + 11.2133 c1 d1 + 
   3.60356 d1^2 + 3.60356 e1^2 + 
   a1 (-11.5688 b1 + 21.6228 c1 + 8.013 d1 + 2.4492 e1) + c1 e1 k21 + 
   c1 e1 k31 + c1 e1 k41 + c1 e1 k51 + 
   b1 (-11.2133 e1 + d1 (-67.5147 + k21 + k31 + k41 + k51)) == 
  67.5147 c1 e1 + b2 d2 k21 + c2 e2 k21 + b3 d3 k31 + c3 e3 k31 + 
   b4 d4 k41 + c4 e4 k41 + b5 d5 k51 + c5 e5 k51, 
 35.0443 b2^2 + 35.0443 c2^2 + 1.58692 b2 d2 + 18.4826 d2^2 + 
   15.5847 b2 e2 + 1.58692 c2 e2 + 18.4826 e2^2 + 
   a2 (15.1696 b2 - 43.4924 c2 - 5.84798 d2 + 8.94205 e2) + 
   a2^2 (-55.5994 + k12 + k32 + k42 + k52) == 
  15.5847 c2 d2 + a1^2 k12 + a3^2 k32 + a4^2 k42 + a5^2 k52, 
 3.46397 a2^2 + 10.9995 b2^2 + 1.20812 b2 d2 + 
   c2 (10.9995 c2 + 23.5226 d2 + 1.20812 e2) + 
   a2 (-17.6958 c2 + 10.1573 d2 + 4.84489 e2 + 
      b2 (-83.4328 + k12 + k32 + k42 + k52)) == 
  2.53476 d2^2 + 23.5226 b2 e2 + 2.53476 e2^2 + a1 b1 k12 + 
   a3 b3 k32 + a4 b4 k42 + a5 b5 k52, 
 4.43487 a2^2 + 7.88179 b2 d2 + 3.39302 c2 d2 + 3.46106 d2^2 + 
   7.88179 c2 e2 + 3.46106 e2^2 + 
   a2 (1.54145 b2 + 1.1684 c2 - 50.2956 d2 + 24.6034 e2 + d2 k12 + 
      d2 k32 + d2 k42 + d2 k52) == 
  8.29647 b2^2 + 8.29647 c2^2 + 3.39302 b2 e2 + a1 d1 k12 + 
   a3 d3 k32 + a4 d4 k42 + a5 d5 k52, 
 26.2297 a2^2 + 16.8713 c2 d2 + 15.9731 d2^2 + 
   b2 (-2.82997 d2 - 16.8713 e2) + 
   a2 (-16.5007 b2 + 13.6825 c2 + 4.04856 d2 - 12.989 e2) + 
   15.9731 e2^2 + c2^2 k12 + c2^2 k32 + c2^2 k42 + c2^2 k52 + 
   b2^2 (-56.7918 + k12 + k32 + k42 + k52) == 
  56.7918 c2^2 + 2.82997 c2 e2 + b1^2 k12 + c1^2 k12 + b3^2 k32 + 
   c3^2 k32 + b4^2 k42 + c4^2 k42 + b5^2 k52 + c5^2 k52, 
 23.9118 a2^2 + 5.34363 b2^2 + 5.34363 c2^2 + 11.2133 c2 d2 + 
   3.60356 d2^2 + 3.60356 e2^2 + 
   a2 (-11.5688 b2 + 21.6228 c2 + 8.013 d2 + 2.4492 e2) + c2 e2 k12 + 
   c2 e2 k32 + c2 e2 k42 + c2 e2 k52 + 
   b2 (-11.2133 e2 + d2 (-67.5147 + k12 + k32 + k42 + k52)) == 
  67.5147 c2 e2 + b1 d1 k12 + c1 e1 k12 + b3 d3 k32 + c3 e3 k32 + 
   b4 d4 k42 + c4 e4 k42 + b5 d5 k52 + c5 e5 k52, 
 35.0443 b3^2 + 35.0443 c3^2 + 1.58692 b3 d3 + 18.4826 d3^2 + 
   15.5847 b3 e3 + 1.58692 c3 e3 + 18.4826 e3^2 + 
   a3 (15.1696 b3 - 43.4924 c3 - 5.84798 d3 + 8.94205 e3) + 
   a3^2 (-55.5994 + k13 + k23 + k43 + k53) == 
  15.5847 c3 d3 + a1^2 k13 + a5^2 k23 + a4^2 k43 + a5^2 k53, 
 3.46397 a3^2 + 10.9995 b3^2 + 1.20812 b3 d3 + 
   c3 (10.9995 c3 + 23.5226 d3 + 1.20812 e3) + 
   a3 (-17.6958 c3 + 10.1573 d3 + 4.84489 e3 + 
      b3 (-83.4328 + k13 + k23 + k43 + k53)) == 
  2.53476 d3^2 + 23.5226 b3 e3 + 2.53476 e3^2 + a1 b1 k13 + 
   a5 b5 k23 + a4 b4 k43 + a5 b5 k53, 
 4.43487 a3^2 + 7.88179 b3 d3 + 3.39302 c3 d3 + 3.46106 d3^2 + 
   7.88179 c3 e3 + 3.46106 e3^2 + 
   a3 (1.54145 b3 + 1.1684 c3 - 50.2956 d3 + 24.6034 e3 + d3 k13 + 
      d3 k23 + d3 k43 + d3 k53) == 
  8.29647 b3^2 + 8.29647 c3^2 + 3.39302 b3 e3 + a1 d1 k13 + 
   a5 d5 k23 + a4 d4 k43 + a5 d5 k53, 
 26.2297 a3^2 + 16.8713 c3 d3 + 15.9731 d3^2 + 
   b3 (-2.82997 d3 - 16.8713 e3) + 
   a3 (-16.5007 b3 + 13.6825 c3 + 4.04856 d3 - 12.989 e3) + 
   15.9731 e3^2 + c3^2 k13 + c3^2 k23 + c3^2 k43 + c3^2 k53 + 
   b3^2 (-56.7918 + k13 + k23 + k43 + k53) == 
  56.7918 c3^2 + 2.82997 c3 e3 + b1^2 k13 + c1^2 k13 + b5^2 k23 + 
   c5^2 k23 + b4^2 k43 + c4^2 k43 + b5^2 k53 + c5^2 k53, 
 23.9118 a3^2 + 5.34363 b3^2 + 5.34363 c3^2 + 11.2133 c3 d3 + 
   3.60356 d3^2 + 3.60356 e3^2 + 
   a3 (-11.5688 b3 + 21.6228 c3 + 8.013 d3 + 2.4492 e3) + c3 e3 k13 + 
   c3 e3 k23 + c3 e3 k43 + c3 e3 k53 + 
   b3 (-11.2133 e3 + d3 (-67.5147 + k13 + k23 + k43 + k53)) == 
  67.5147 c3 e3 + b1 d1 k13 + c1 e1 k13 + b5 d5 k23 + c5 e5 k23 + 
   b4 d4 k43 + c4 e4 k43 + b5 d5 k53 + c5 e5 k53, 
 35.0443 b4^2 + 35.0443 c4^2 + 1.58692 b4 d4 + 18.4826 d4^2 + 
   15.5847 b4 e4 + 1.58692 c4 e4 + 18.4826 e4^2 + 
   a4 (15.1696 b4 - 43.4924 c4 - 5.84798 d4 + 8.94205 e4) + 
   a4^2 (-55.5994 + k14 + k24 + k34 + k54) == 
  15.5847 c4 d4 + a1^2 k14 + a2^2 k24 + a3^2 k34 + a5^2 k54, 
 3.46397 a4^2 + 10.9995 b4^2 + 1.20812 b4 d4 + 
   c4 (10.9995 c4 + 23.5226 d4 + 1.20812 e4) + 
   a4 (-17.6958 c4 + 10.1573 d4 + 4.84489 e4 + 
      b4 (-83.4328 + k14 + k24 + k34 + k54)) == 
  2.53476 d4^2 + 23.5226 b4 e4 + 2.53476 e4^2 + a1 b1 k14 + 
   a2 b2 k24 + a3 b3 k34 + a5 b5 k54, 
 4.43487 a4^2 + 7.88179 b4 d4 + 3.39302 c4 d4 + 3.46106 d4^2 + 
   7.88179 c4 e4 + 3.46106 e4^2 + 
   a4 (1.54145 b4 + 1.1684 c4 - 50.2956 d4 + 24.6034 e4 + d4 k14 + 
      d4 k24 + d4 k34 + d4 k54) == 
  8.29647 b4^2 + 8.29647 c4^2 + 3.39302 b4 e4 + a1 d1 k14 + 
   a2 d2 k24 + a3 d3 k34 + a5 d5 k54, 
 26.2297 a4^2 + 16.8713 c4 d4 + 15.9731 d4^2 + 
   b4 (-2.82997 d4 - 16.8713 e4) + 
   a4 (-16.5007 b4 + 13.6825 c4 + 4.04856 d4 - 12.989 e4) + 
   15.9731 e4^2 + c4^2 k14 + c4^2 k24 + c4^2 k34 + c4^2 k54 + 
   b4^2 (-56.7918 + k14 + k24 + k34 + k54) == 
  56.7918 c4^2 + 2.82997 c4 e4 + b1^2 k14 + c1^2 k14 + b2^2 k24 + 
   c2^2 k24 + b3^2 k34 + c3^2 k34 + b5^2 k54 + c5^2 k54, 
 23.9118 a4^2 + 5.34363 b4^2 + 5.34363 c4^2 + 11.2133 c4 d4 + 
   3.60356 d4^2 + 3.60356 e4^2 + 
   a4 (-11.5688 b4 + 21.6228 c4 + 8.013 d4 + 2.4492 e4) + c4 e4 k14 + 
   c4 e4 k24 + c4 e4 k34 + c4 e4 k54 + 
   b4 (-11.2133 e4 + d4 (-67.5147 + k14 + k24 + k34 + k54)) == 
  67.5147 c4 e4 + b1 d1 k14 + c1 e1 k14 + b2 d2 k24 + c2 e2 k24 + 
   b3 d3 k34 + c3 e3 k34 + b5 d5 k54 + c5 e5 k54, 
 35.0443 b5^2 + 35.0443 c5^2 + 1.58692 b5 d5 + 18.4826 d5^2 + 
   15.5847 b5 e5 + 1.58692 c5 e5 + 18.4826 e5^2 + 
   a5 (15.1696 b5 - 43.4924 c5 - 5.84798 d5 + 8.94205 e5) + 
   a5^2 (-55.5994 + k15 + k25 + k35 + k45) == 
  15.5847 c5 d5 + a1^2 k15 + a2^2 k25 + a3^2 k35 + a4^2 k45, 
 3.46397 a5^2 + 10.9995 b5^2 + 1.20812 b5 d5 + 
   c5 (10.9995 c5 + 23.5226 d5 + 1.20812 e5) + 
   a5 (-17.6958 c5 + 10.1573 d5 + 4.84489 e5 + 
      b5 (-83.4328 + k15 + k25 + k35 + k45)) == 
  2.53476 d5^2 + 23.5226 b5 e5 + 2.53476 e5^2 + a1 b1 k15 + 
   a2 b2 k25 + a3 b3 k35 + a4 b4 k45, 
 4.43487 a5^2 + 7.88179 b5 d5 + 3.39302 c5 d5 + 3.46106 d5^2 + 
   7.88179 c5 e5 + 3.46106 e5^2 + 
   a5 (1.54145 b5 + 1.1684 c5 - 50.2956 d5 + 24.6034 e5 + d5 k15 + 
      d5 k25 + d5 k35 + d5 k45) == 
  8.29647 b5^2 + 8.29647 c5^2 + 3.39302 b5 e5 + a1 d1 k15 + 
   a2 d2 k25 + a3 d3 k35 + a4 d4 k45, 
 26.2297 a5^2 + 16.8713 c5 d5 + 15.9731 d5^2 + 
   b5 (-2.82997 d5 - 16.8713 e5) + 
   a5 (-16.5007 b5 + 13.6825 c5 + 4.04856 d5 - 12.989 e5) + 
   15.9731 e5^2 + c5^2 k15 + c5^2 k25 + c5^2 k35 + c5^2 k45 + 
   b5^2 (-56.7918 + k15 + k25 + k35 + k45) == 
  56.7918 c5^2 + 2.82997 c5 e5 + b1^2 k15 + c1^2 k15 + b2^2 k25 + 
   c2^2 k25 + b3^2 k35 + c3^2 k35 + b4^2 k45 + c4^2 k45, 
 23.9118 a5^2 + 5.34363 b5^2 + 5.34363 c5^2 + 11.2133 c5 d5 + 
   3.60356 d5^2 + 3.60356 e5^2 + 
   a5 (-11.5688 b5 + 21.6228 c5 + 8.013 d5 + 2.4492 e5) + c5 e5 k15 + 
   c5 e5 k25 + c5 e5 k35 + c5 e5 k45 + 
   b5 (-11.2133 e5 + d5 (-67.5147 + k15 + k25 + k35 + k45)) == 
  67.5147 c5 e5 + b1 d1 k15 + c1 e1 k15 + b2 d2 k25 + c2 e2 k25 + 
   b3 d3 k35 + c3 e3 k35 + b4 d4 k45 + c4 e4 k45, 
 a1^2 + b1^2 + c1^2 + d1^2 + e1^2 == 1, 
 a2^2 + b2^2 + c2^2 + d2^2 + e2^2 == 1, 
 a3^2 + b3^2 + c3^2 + d3^2 + e3^2 == 1, 
 a4^2 + b4^2 + c4^2 + d4^2 + e4^2 == 1, 
 a5^2 + b5^2 + c5^2 + d5^2 + e5^2 == 1, 
 14.3029 a1^2 + 10.5958 b1^2 + 10.5958 c1^2 + 11.3357 b1 d1 - 
   2.08629 c1 d1 - 1.86119 d1^2 + 2.08629 b1 e1 + 11.3357 c1 e1 - 
   1.86119 e1^2 + a2 c2 k21 + a3 c3 k31 + a4 c4 k41 + a5 c5 k51 + 
   a1 (6.93717 b1 - 17.2629 d1 + 23.2024 e1 - 
      1. c1 (-82.2484 + k21 + k31 + k41 + k51)) == 0, 
 20.991 a1^2 + 10.7259 b1^2 + 10.7259 c1^2 + 17.8904 b1 d1 + 
   5.13758 d1^2 + 13.4348 b1 e1 + 17.8904 c1 e1 + 5.13758 e1^2 + 
   a2 e2 k21 + a3 e3 k31 + a4 e4 k41 + a5 e5 k51 + 
   a1 (11.9603 b1 - 1.87817 c1 - 8.77273 d1 + 78.3773 e1 - e1 k21 - 
      e1 k31 - e1 k41 - e1 k51) == 13.4348 c1 d1, 
 4.13509 b1^2 + 4.13509 c1^2 + 12.4463 d1^2 + 
   a1 (11.7879 b1 - 23.2184 c1 + 1.32263 d1 - 3.25698 e1) + 
   12.4463 e1^2 + c1 d1 k21 + b2 e2 k21 + c1 d1 k31 + b3 e3 k31 + 
   c1 d1 k41 + b4 e4 k41 + c1 d1 k51 + b5 e5 k51 + 
   b1 (-9.59157 d1 - 1. e1 (-58.9 + k21 + k31 + k41 + k51)) == 
  6.69564 a1^2 + 58.9 c1 d1 + 9.59157 c1 e1 + c2 d2 k21 + c3 d3 k31 + 
   c4 d4 k41 + c5 d5 k51, 
 14.3029 a2^2 + 10.5958 b2^2 + 10.5958 c2^2 + 11.3357 b2 d2 - 
   2.08629 c2 d2 - 1.86119 d2^2 + 2.08629 b2 e2 + 11.3357 c2 e2 - 
   1.86119 e2^2 + a1 c1 k12 + a3 c3 k32 + a4 c4 k42 + a5 c5 k52 + 
   a2 (6.93717 b2 - 17.2629 d2 + 23.2024 e2 - 
      1. c2 (-82.2484 + k12 + k32 + k42 + k52)) == 0, 
 20.991 a2^2 + 10.7259 b2^2 + 10.7259 c2^2 + 17.8904 b2 d2 + 
   5.13758 d2^2 + 13.4348 b2 e2 + 17.8904 c2 e2 + 5.13758 e2^2 + 
   a1 e1 k12 + a3 e3 k32 + a4 e4 k42 + a5 e5 k52 + 
   a2 (11.9603 b2 - 1.87817 c2 - 8.77273 d2 + 78.3773 e2 - e2 k12 - 
      e2 k32 - e2 k42 - e2 k52) == 13.4348 c2 d2, 
 4.13509 b2^2 + 4.13509 c2^2 + 12.4463 d2^2 + 
   a2 (11.7879 b2 - 23.2184 c2 + 1.32263 d2 - 3.25698 e2) + 
   12.4463 e2^2 + c2 d2 k12 + b1 e1 k12 + c2 d2 k32 + b3 e3 k32 + 
   c2 d2 k42 + b4 e4 k42 + c2 d2 k52 + b5 e5 k52 + 
   b2 (-9.59157 d2 - 1. e2 (-58.9 + k12 + k32 + k42 + k52)) == 
  6.69564 a2^2 + 58.9 c2 d2 + 9.59157 c2 e2 + c1 d1 k12 + c3 d3 k32 + 
   c4 d4 k42 + c5 d5 k52, 
 14.3029 a3^2 + 10.5958 b3^2 + 10.5958 c3^2 + 11.3357 b3 d3 - 
   2.08629 c3 d3 - 1.86119 d3^2 + 2.08629 b3 e3 + 11.3357 c3 e3 - 
   1.86119 e3^2 + a1 c1 k13 + a5 c5 k23 + a4 c4 k43 + a5 c5 k53 + 
   a3 (6.93717 b3 - 17.2629 d3 + 23.2024 e3 - 
      1. c3 (-82.2484 + k13 + k23 + k43 + k53)) == 0, 
 20.991 a3^2 + 10.7259 b3^2 + 10.7259 c3^2 + 17.8904 b3 d3 + 
   5.13758 d3^2 + 13.4348 b3 e3 + 17.8904 c3 e3 + 5.13758 e3^2 + 
   a1 e1 k13 + a5 e5 k23 + a4 e4 k43 + a5 e5 k53 + 
   a3 (11.9603 b3 - 1.87817 c3 - 8.77273 d3 + 78.3773 e3 - e3 k13 - 
      e3 k23 - e3 k43 - e3 k53) == 13.4348 c3 d3, 
 4.13509 b3^2 + 4.13509 c3^2 + 12.4463 d3^2 + 
   a3 (11.7879 b3 - 23.2184 c3 + 1.32263 d3 - 3.25698 e3) + 
   12.4463 e3^2 + c3 d3 k13 + b1 e1 k13 + c3 d3 k23 + b5 e5 k23 + 
   c3 d3 k43 + b4 e4 k43 + c3 d3 k53 + b5 e5 k53 + 
   b3 (-9.59157 d3 - 1. e3 (-58.9 + k13 + k23 + k43 + k53)) == 
  6.69564 a3^2 + 58.9 c3 d3 + 9.59157 c3 e3 + c1 d1 k13 + c5 d5 k23 + 
   c4 d4 k43 + c5 d5 k53, 
 14.3029 a4^2 + 10.5958 b4^2 + 10.5958 c4^2 + 11.3357 b4 d4 - 
   2.08629 c4 d4 - 1.86119 d4^2 + 2.08629 b4 e4 + 11.3357 c4 e4 - 
   1.86119 e4^2 + a1 c1 k14 + a2 c2 k24 + a3 c3 k34 + a5 c5 k54 + 
   a4 (6.93717 b4 - 17.2629 d4 + 23.2024 e4 - 
      1. c4 (-82.2484 + k14 + k24 + k34 + k54)) == 0, 
 20.991 a4^2 + 10.7259 b4^2 + 10.7259 c4^2 + 17.8904 b4 d4 + 
   5.13758 d4^2 + 13.4348 b4 e4 + 17.8904 c4 e4 + 5.13758 e4^2 + 
   a1 e1 k14 + a2 e2 k24 + a3 e3 k34 + a5 e5 k54 + 
   a4 (11.9603 b4 - 1.87817 c4 - 8.77273 d4 + 78.3773 e4 - e4 k14 - 
      e4 k24 - e4 k34 - e4 k54) == 13.4348 c4 d4, 
 4.13509 b4^2 + 4.13509 c4^2 + 12.4463 d4^2 + 
   a4 (11.7879 b4 - 23.2184 c4 + 1.32263 d4 - 3.25698 e4) + 
   12.4463 e4^2 + c4 d4 k14 + b1 e1 k14 + c4 d4 k24 + b2 e2 k24 + 
   c4 d4 k34 + b3 e3 k34 + c4 d4 k54 + b5 e5 k54 + 
   b4 (-9.59157 d4 - 1. e4 (-58.9 + k14 + k24 + k34 + k54)) == 
  6.69564 a4^2 + 58.9 c4 d4 + 9.59157 c4 e4 + c1 d1 k14 + c2 d2 k24 + 
   c3 d3 k34 + c5 d5 k54, 
 14.3029 a5^2 + 10.5958 b5^2 + 10.5958 c5^2 + 11.3357 b5 d5 - 
   2.08629 c5 d5 - 1.86119 d5^2 + 2.08629 b5 e5 + 11.3357 c5 e5 - 
   1.86119 e5^2 + a1 c1 k15 + a2 c2 k25 + a3 c3 k35 + a4 c4 k45 + 
   a5 (6.93717 b5 - 17.2629 d5 + 23.2024 e5 - 
      1. c5 (-82.2484 + k15 + k25 + k35 + k45)) == 0, 
 20.991 a5^2 + 10.7259 b5^2 + 10.7259 c5^2 + 17.8904 b5 d5 + 
   5.13758 d5^2 + 13.4348 b5 e5 + 17.8904 c5 e5 + 5.13758 e5^2 + 
   a1 e1 k15 + a2 e2 k25 + a3 e3 k35 + a4 e4 k45 + 
   a5 (11.9603 b5 - 1.87817 c5 - 8.77273 d5 + 78.3773 e5 - e5 k15 - 
      e5 k25 - e5 k35 - e5 k45) == 13.4348 c5 d5, 
 4.13509 b5^2 + 4.13509 c5^2 + 12.4463 d5^2 + 
   a5 (11.7879 b5 - 23.2184 c5 + 1.32263 d5 - 3.25698 e5) + 
   12.4463 e5^2 + c5 d5 k15 + b1 e1 k15 + c5 d5 k25 + b2 e2 k25 + 
   c5 d5 k35 + b3 e3 k35 + c5 d5 k45 + b4 e4 k45 + 
   b5 (-9.59157 d5 - 1. e5 (-58.9 + k15 + k25 + k35 + k45)) == 
  6.69564 a5^2 + 58.9 c5 d5 + 9.59157 c5 e5 + c1 d1 k15 + c2 d2 k25 + 
   c3 d3 k35 + c4 d4 k45};

FindRoot[newComboEqs, {{a1, RandomReal[{-1, 1}] }, {b1, 
   RandomReal[{-1, 1}] }, {c1, RandomReal[{-1, 1}] }, {d1, 
   RandomReal[{-1, 1}] }, { e1, RandomReal[{-1, 1}] }, {a2, 
   RandomReal[{-1, 1}] }, {b2, RandomReal[{-1, 1}] }, {c2, 
   RandomReal[{-1, 1}] }, {d2, RandomReal[{-1, 1}] }, { e2, 
   RandomReal[{-1, 1}] }, {a3, RandomReal[{-1, 1}] }, {b3, 
   RandomReal[{-1, 1}] }, {c3, RandomReal[{-1, 1}] }, {d3, 
   RandomReal[{-1, 1}] }, { e3, RandomReal[{-1, 1}] }, {a4, 
   RandomReal[{-1, 1}] }, {b4, RandomReal[{-1, 1}] }, {c4, 
   RandomReal[{-1, 1}] }, {d4, RandomReal[{-1, 1}] }, { e4, 
   RandomReal[{-1, 1}] }, {a5, RandomReal[{-1, 1}] }, {b5, 
   RandomReal[{-1, 1}] }, {c5, RandomReal[{-1, 1}] }, {d5, 
   RandomReal[{-1, 1}] }, { e5, RandomReal[{0, 1}] }, {k21 , 
   RandomReal[{0, 1}] }, {k31 , RandomReal[{0, 1}] }, {k41 , 
   RandomReal[{0, 1}] }, {k51 , RandomReal[{0, 1}] }, {k32 , 
   RandomReal[{0, 1}] }, {k42 , RandomReal[{0, 1}] }, {k52 , 
   RandomReal[{0, 1}] }, {k12 , RandomReal[{0, 1}] }, {k43, 
   RandomReal[{0, 1}] }, {k53, RandomReal[{0, 1}] }, {k13 , 
   RandomReal[{0, 1}] }, {k23 , RandomReal[{0, 1}] }, {k54 , 
   RandomReal[{0, 1}] }, {k14 , RandomReal[{0, 1}] }, {k24 , 
   RandomReal[{0, 1}] }, {k34 , RandomReal[{0, 1}] }, {k15 , 
   RandomReal[{0, 1}] }, {k25 , RandomReal[{0, 1}] }, {k35 , 
   RandomReal[{0, 1}] }, {k45, RandomReal[{0, 1}] }}]

FindRoot::jsing: Encountered a singular Jacobian at the point {a1,b1,c1,d1,e1,a2,b2,c2,d2,e2,a3,b3,c3,d3,e3,a4,b4,c4,d4,e4,a5,b5,c5,d5,e5,k21,k31,k41,k51,k32,k42,k52,k12,k43,k53,k13,k23,k54,k14,k24,k34,k15,k25,k35,k45} = {-0.786169,0.370128,0.529406,-0.501129,-0.0713502,<<35>>,0.493413,0.0561723,0.146422,0.130567,0.717302}. Try perturbing the initial point(s). >>

(* {a1 -> -0.786169, b1 -> 0.370128, c1 -> 0.529406, 
 d1 -> -0.501129, e1 -> -0.0713502, a2 -> 0.280924, b2 -> 0.699755, 
 c2 -> -0.485743, d2 -> -0.0971618, e2 -> 0.357222, a3 -> -0.751617, 
 b3 -> -0.708093, c3 -> -0.676941, d3 -> -0.865452, e3 -> -0.00483158,
  a4 -> -0.0750106, b4 -> -0.988797, c4 -> -0.449139, d4 -> 0.613492, 
 e4 -> 0.536904, a5 -> -0.861665, b5 -> -0.88891, c5 -> -0.201746, 
 d5 -> 0.774051, e5 -> 0.34028, k21 -> 0.620438, k31 -> 0.789192, 
 k41 -> 0.320401, k51 -> 0.576264, k32 -> 0.689143, k42 -> 0.395573, 
 k52 -> 0.938374, k12 -> 0.627171, k43 -> 0.205795, k53 -> 0.224983, 
 k13 -> 0.831217, k23 -> 0.46829, k54 -> 0.701955, k14 -> 0.462989, 
 k24 -> 0.800069, k34 -> 0.493413, k15 -> 0.0561723, k25 -> 0.146422, 
 k35 -> 0.130567, k45 -> 0.717302} *)

EDIT: I'm adding another system of equations that is simpler but also displays the same behaviour but which I know a solution of. It is 27 eqns in 18 variables so I pad the variables with dummy variables. I also use the method suggested in the provided answer by Jim Baldwin. The sum of squares method does get very close to an answer so the following singular jacobian behaviour with FindRoot might perhaps be due some precision issue? If one tries the FindRoot method without the sum of squares before then the singular Jacobian message is obtained unless one starts very close to a solution. This seems surprising as there are simple solutions, for example {a1 -> 1., b1 -> 0, c1 -> 0, d1 -> 0, e1 -> 0, a2 -> 0, b2 -> 1., c2 -> 0, d2 -> 0, e2 -> 0, a3 -> 0, b3 -> 0, c3 -> 0, d3 -> 1., e3 -> 0, k23 -> 1., k31 -> 1., k12 -> 1.}. Note that if add the constraints that k23>0, k31>0, k12 >0 then FindRoot doesn't give the error message when applied after sumOfSquares

 newComboEqs3 = {b1^2 + c1^2 + a1^2 (-1. + k31) == a3^2 k31, 
 b1 d1 + 1. c1 e1 + a1 b1 (-1. + k31) == a3 b3 k31, 
 a1 (b1 + d1 (-1. + k31)) == a3 d3 k31, 
 d1^2 + e1^2 + b1^2 (-1. + k31) + 
   c1^2 (-1. + k31) == (b3^2 + c3^2) k31, 
 a1 d1 + b1 d1 (-1. + k31) + c1 e1 k31 == 
  1. c1 e1 + b3 d3 k31 + c3 e3 k31, 
 b2^2 + c2^2 + a2^2 (-1. + k12) == a1^2 k12, 
 b2 d2 + 1. c2 e2 + a2 b2 (-1. + k12) == a1 b1 k12, 
 a2 (b2 + d2 (-1. + k12)) == a1 d1 k12, 
 d2^2 + e2^2 + b2^2 (-1. + k12) + 
   c2^2 (-1. + k12) == (b1^2 + c1^2) k12, 
 a2 d2 + b2 d2 (-1. + k12) + c2 e2 k12 == 
  1. c2 e2 + b1 d1 k12 + c1 e1 k12, 
 b3^2 + c3^2 + a3^2 (-1. + k23) == a2^2 k23, 
 b3 d3 + 1. c3 e3 + a3 b3 (-1. + k23) == a2 b2 k23, 
 a3 (b3 + d3 (-1. + k23)) == a2 d2 k23, 
 d3^2 + e3^2 + b3^2 (-1. + k23) + 
   c3^2 (-1. + k23) == (b2^2 + c2^2) k23, 
 a3 d3 + b3 d3 (-1. + k23) + c3 e3 k23 == 
  1. c3 e3 + b2 d2 k23 + c2 e2 k23, 
 a1^2 + b1^2 + c1^2 + d1^2 + e1^2 == 1, 
 a2^2 + b2^2 + c2^2 + d2^2 + e2^2 == 1, 
 a3^2 + b3^2 + c3^2 + d3^2 + e3^2 == 1, 
 1. c1 d1 - 1. b1 e1 - 1. a1 c1 (-1. + k31) + a3 c3 k31 == 0, 
 a1 (1. c1 - 1. e1 (-1. + k31)) + a3 e3 k31 == 0, 
 1. a1 e1 + 1. b1 e1 + c1 d1 (-1. + k31) + 
   b3 e3 k31 == (c3 d3 + b1 e1) k31, 
 1. c2 d2 - 1. b2 e2 - 1. a2 c2 (-1. + k12) + a1 c1 k12 == 0, 
 a2 (1. c2 - 1. e2 (-1. + k12)) + a1 e1 k12 == 0, 
 1. a2 e2 + 1. b2 e2 + c2 d2 (-1. + k12) + 
   b1 e1 k12 == (c1 d1 + b2 e2) k12, 
 1. c3 d3 - 1. b3 e3 - 1. a3 c3 (-1. + k23) + a2 c2 k23 == 0, 
 a3 (1. c3 - 1. e3 (-1. + k23)) + a2 e2 k23 == 0, 
 1. a3 e3 + 1. b3 e3 + c3 d3 (-1. + k23) + 
   b2 e2 k23 == (c2 d2 + b3 e3) k23}



sumOfSquares = Total[newComboEqs3 /. x_ == y_ -> {((x) - (y))^2}];

sol = NMinimize[sumOfSquares, vars3, MaxIterations -> 700];

sumOfSquares /. sol[[2]]

{9.72451*10^-14}

initialValues = sol[[2]] /. (x_ -> y_) -> {x, y};
initialValuesWDummy = 
 Join[initialValues, {{dummy1, RandomReal[{-1, 1}] }, {dummy2, 
    RandomReal[{-1, 1}] }, {dummy3, RandomReal[{-1, 1}] }, {dummy4, 
    RandomReal[{-1, 1}] }, {dummy5, RandomReal[{-1, 1}] }, {dummy6, 
    RandomReal[{-1, 1}] }, {dummy7, RandomReal[{-1, 1}] }, {dummy8, 
    RandomReal[{-1, 1}] }, {dummy9, RandomReal[{-1, 1}] }}]
sol2 = FindRoot[newComboEqs3, initialValuesWDummy, AccuracyGoal -> 10];
N[sol2, 6]

{{a1, -0.577351}, {b1, 0.288675}, {c1, -0.5}, {d1, 
  0.288675}, {e1, 0.5}, {a2, -0.57735}, {b2, 
  0.288675}, {c2, -0.500001}, {d2, 0.288675}, {e2, 0.499999}, {a3, 
  0.57735}, {b3, -0.288675}, {c3, 
  0.5}, {d3, -0.288675}, {e3, -0.5}, {k31, 0.961654}, {k23, 
  0.190633}, {k12, 1.65203}, {dummy1, -0.87578}, {dummy2, 
  0.861792}, {dummy3, 0.633492}, {dummy4, 
  0.256425}, {dummy5, -0.432283}, {dummy6, 
  0.315553}, {dummy7, -0.151878}, {dummy8, -0.788699}, {dummy9,
-0.536995}}

During evaluation of In[2258]:= FindRoot::jsing: Encountered a singular Jacobian at the point {a1,b1,c1,d1,e1,a2,b2,c2,d2,e2,a3,b3,c3,d3,e3,k31,k23,k12,dummy1,dummy2,dummy3,dummy4,dummy5,dummy6,dummy7,dummy8,dummy9} = {-0.577351,0.288675,-0.5,0.288675,0.5,<<17>>,-0.432283,0.315553,-0.151878,-0.788699,-0.536995}. Try perturbing the initial point(s). >>

Thanks for your help, much appreciated

$\endgroup$
  • 1
    $\begingroup$ It could be singular due to Underflow[]. Problems with code usually require the code to be solved. Otherwise, we're just guessing. $\endgroup$ – Michael E2 Dec 26 '16 at 5:34
  • 1
    $\begingroup$ Or it could be like this: FindRoot[{(x + y) == 0, (x + y)^2 == 0}, {x, RandomReal[]}, {y, RandomReal[]}]. $\endgroup$ – Michael E2 Dec 26 '16 at 5:35
  • $\begingroup$ edited to add explicit equations $\endgroup$ – physioConfusio Dec 26 '16 at 6:34
  • $\begingroup$ If you change the 1. to just 1 in the new equations and use sol = NMinimize[sumOfSquares, vars3, MaxIterations -> 700, WorkingPrecision -> 100], you'll get the sum of squares down to 6.12209*10^-96. Also you might want to define vars3 maybe something like vars3 = Variables[Flatten[newComboEqs3 /. x_ == y_ -> {x, y}]]. $\endgroup$ – JimB Jan 5 '17 at 2:53
  • $\begingroup$ yes, the sum of squares works nicely on the system, thanks for that $\endgroup$ – physioConfusio Jan 5 '17 at 3:53
4
$\begingroup$

When there are many variables involved sometimes approaching the problem as minimizing a sum of squares gets one better starting values.

First we change the equations to a sum of squares:

sumOfSquares = Total[newComboEqs /. x_ == y_ -> {((x) - (y))^2}];

Now minimize the sum of squares:

sol = NMinimize[
  sumOfSquares, {a1, b1, c1, d1, e1, a2, b2, c2, d2, e2, a3, b3, c3, 
   d3, e3, a4, b4, c4, d4, e4, a5, b5, c5, d5, e5,
   k21, k31, k41, k51, k32, k42, k52, k12, k43, k53, k13, k23, k54, 
   k14, k24, k34, k15, k25, k35, k45}, MaxIterations -> 700];
N[sol, 6]
(* {0.00948411, {a1 -> 0.608546, b1 -> 0.59806, c1 -> 0.0052106, 
  d1 -> 0.325678, e1 -> -0.434394, a2 -> -0.612543, b2 -> -0.597082, 
  c2 -> -0.00225978, d2 -> -0.316305, e2 -> 0.434243, a3 -> 0.703528, 
  b3 -> 0.0320005, c3 -> -0.413592, d3 -> -0.46877, e3 -> -0.199874, 
  a4 -> 0.60926, b4 -> 0.597888, c4 -> 0.00469009, d4 -> 0.324001, 
  e4 -> -0.43435, a5 -> 0.450216, b5 -> -0.461165, c5 -> 0.354001, 
  d5 -> -0.359291, e5 -> -0.581976, k21 -> -1213.47, k31 -> 25.752, 
  k41 -> 653.409, k51 -> 14.1425, k32 -> 25.9353, k42 -> 733.291, 
  k52 -> 14.1653, k12 -> 517.792, k43 -> 495.031, k53 -> 5.3753, 
  k13 -> -467.919, k23 -> 5.19108, k54 -> 14.1329, k14 -> -303.783, 
  k24 -> -1407.02, k34 -> 25.801, k15 -> 454.262, k25 -> -1665.86, 
  k35 -> 38.0675, k45 -> 1210.38}} *)
sumOfSquares /. sol[[2]]
(* {0.009484109258942785`} *)

Now try the original attempt but with better starting values:

initialValues = sol[[2]] /. (x_ -> y_) -> {x, y};
sol2 = FindRoot[newComboEqs, initialValues, AccuracyGoal -> 16];
N[sol2, 6]

sumOfSquares /. sol2
(* {a1 -> 0.608546, b1 -> 0.59806, c1 -> 0.0052106, d1 -> 0.325678, 
 e1 -> -0.434394, a2 -> -0.612543, b2 -> -0.597082, c2 -> -0.00225978,
  d2 -> -0.316305, e2 -> 0.434243, a3 -> 0.703528, b3 -> 0.0320005, 
 c3 -> -0.413592, d3 -> -0.46877, e3 -> -0.199874, a4 -> 0.60926, 
 b4 -> 0.597888, c4 -> 0.00469009, d4 -> 0.324001, e4 -> -0.43435, 
 a5 -> 0.450216, b5 -> -0.461165, c5 -> 0.354001, d5 -> -0.359291, 
 e5 -> -0.581976, k21 -> -1213.47, k31 -> 25.752, k41 -> 653.409, 
 k51 -> 14.1425, k32 -> 25.9353, k42 -> 733.291, k52 -> 14.1653, 
 k12 -> 517.792, k43 -> 495.031, k53 -> 5.3753, k13 -> -467.919, 
 k23 -> 5.19108, k54 -> 14.1329, k14 -> -303.783, k24 -> -1407.02, 
 k34 -> 25.801, k15 -> 454.262, k25 -> -1665.86, k35 -> 38.0675, 
 k45 -> 1210.38} *)

How close are individual equations?

N[newComboEqs /. x_ == y_ -> {((x) - (y))} /. sol2, 6]
(* {0.000279025, 0.00479583, 0.00812411, 0.000584841, -0.00698236, 
-0.00347816, 0.00163562, -0.0166531, -0.00588546, 0.0129383, 
0.00191095, -0.00334305, 0.00154565, 0.00279091, -0.00276151, 
-0.000316227, 0.000743215, 0.00161974, -0.000180572, -0.00116391, 
0.00050836, -0.000911944, 0.00320869, 0.00122184, -0.00170453, 
0.0227961, 0.0203383, -0.0732703, 0.0223259, 0.00847085, 0.00335597,
-0.0258075, -0.00579973, -0.00997272, 0.0322717, 0.00689797, 
0.00150735, -0.000575695, 0.00191585, 0.00131298, -0.00170379,
-0.000712195, 0.00214042, -0.0033176, -0.000499429} *)

You will need to decide if this approximation is close enough.

$\endgroup$
  • 1
    $\begingroup$ Do you get the singular Jacobian error? (I do. When I looked at this back when it was posted, I concluded the rank of the Jacobian is probably generically deficient, of rank 44. I suspect that there may be no solution, but I couldn't show it. Whatever I tried ran too long.) $\endgroup$ – Michael E2 Jan 4 '17 at 23:54
  • 1
    $\begingroup$ @MichaelE2 When I used different starting values I did get the singular Jacobian error message but not with the above starting values. Also, the result changes when I change MaxIterations. That I don't understand. There very well might not be a solution in that the sum of squares doesn't get smaller than around 0.0095. $\endgroup$ – JimB Jan 5 '17 at 0:12
  • $\begingroup$ wow, i was actually to the minute just preparing to post an edit with simpler system that I've found which displays the same behaviour and which I know the solution of (by other means). Its 27 equations with coefficients of unity. I will try out your proposed technique on this system myself and will let you know if it gives results there too. thanks for your help! $\endgroup$ – physioConfusio Jan 5 '17 at 0:19
  • $\begingroup$ ok, one thing i'm noticing is that the solutions output by FindRoot in your answer are exactly the same as those provided by sumOfSquares? In other words FindRoot is adding nothing (except not issuing error message, which is something i guess). As the now edited original question shows, when i try sum of squares on a simpler system it works nicely but then feeding it into FindRoot gives the error message. $\endgroup$ – physioConfusio Jan 5 '17 at 1:10
  • $\begingroup$ although not if some constraints are added to the minimisation $\endgroup$ – physioConfusio Jan 5 '17 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.