I have a system of $n$ ODEs $\frac{dx_i}{dt} = f_i(x_1.\ldots,x_n)$, which I would like to solve at steady state.
However, $\sum_{i} x_i = 1$, and so it's actually only an $n-1$-dimensional system. As a result, the jacobian for my system is singular everywhere (which FindRoot tells me when I try to use it). Is there anyway I can get Find Root to work with this, without rewriting the equations in terms of the $n-1$ variables?
For example, what I would like to do is the following:
eqn1 = y-2x*y;
eqn2 = 2x*y-y;
FindRoot[{eqn1==0,eqn2==0,x+y==1},{{x,0.2},{y,0.2}}].
I know I can use NSolve instead in this scenario, but for the system I'm actually working with, NSolve doesn't compute it in a reasonable time.
This system doesn't actually throw the Jacobian error, but it is a similar system, so I imagine if I can do it for this system, my system of interest will work with the same method.
{min, arg} = Minimize[{eqn1^2 + eqn2^2, x + y == 1}, {x, y}]
$\endgroup$Minimize
finds the global minimum of f subject to the constraints given" and "NMinimize
always attempts to find a global minimum of f subject to the constraints given"; whereas,FindMinimum
"searches for a local minimum". I would only useFindMinimum
if neitherMinimize
norNMinimize
were successful. $\endgroup$Solve[{eqn1 == 0, eqn2 == 0, x + y == 1}, {x, y}]
? $\endgroup$