dstaple

15 Reputation

One Badge

10 years, 172 days

MaplePrimes Activity


These are questions asked by dstaple

I'd like to know how to ask Maple to find numerical solutions to underspecified systems of nonlinear equations.  For example, suppose I had a system of equations like this:

eq1 := y1 = tanh(x1);

eq2 := y2 = cosh(x1 + x2);

eq3 := y1 + y2 = 2.0;

Typing this:

fsolve([eq1, eq2, eq3]);

results in the following error:

Error, (in fsolve) number of equations, 3, does not match number of variables, 4

In this situation I can easily artificially restrict the system to find a solution.  For example, I can do:

eq4 := x1 = 0.0;

fsolve([eq1, eq2, eq3, eq4]);

which will result in the following solution:

{x1 = 0., x2 = 1.316957897, y1 = 0., y2 = 2.000000000}

The issue here is that I pulled x1 = 0.0; out of thin air.  Setting a single variable to zero would not work to solve an arbitrary set of nonlinear equations.  How can I ask Maple to find a single (not necessarily unique) solution to an underspecified system of nonlinear equations?

Page 1 of 1