Message Boards Message Boards


FindRoot: why must the number of equations match the number of variables?

Posted 5 months ago
2 Replies
1 Total Likes

I am trying to find numerical solutions to a system of nonlinear equations over the reals. The system has 7 polynomials (that should all be equal to zero) with a total of 8 variables. I know that at least two solutions exists: when all variables are set to zero and another solution I found with FindInstance. I was hoping to find more solutions using numerical methods with varying starting points.

What surprised me was the error message I got from FindRoot: "The number of equations does not match the number of variables in [...]"

I was not aware of this limitation nor was I able to lift it by adding an additional equation that is always true.

What am I missing?

2 Replies
Posted 5 months ago

I guess because it is under-constrained there are infinitely many solutions. You can try NSolve

NSolve[And @@ Thread[polys == 0], vars]

For real solutions

NSolve[And @@ Thread[polys == 0], vars, Reals]

This gives the trivial solution

FindInstance[And @@ Thread[polys == 0], vars, Reals]

I let this run for ~10 min before aborting

FindInstance[And @@ Thread[polys == 0], vars, Reals, 2]

Thank you for the tipps. I guess FindRoot is not meant to work with under-determined systems. I managed to generate an essentially arbitrary amount of solutions by setting k to various values and solving the system with NDSolve:

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract