Solving (systems of) non-linear equations?



On 3/19/07, Alasdair McAndrew <amca01 at gmail.com> wrote:
> Does Maxima implement any general method of solving these?

Maxima can solve systems of polynomials symbolically in many cases --
see the documentation of solve and algsys.  For example:

  solve([x^2+y^2=1,a*x+b*y=0],[x,y]) =>
       [[x = -b/sqrt(b^2+a^2),y = a/sqrt(b^2+a^2)],[x =
b/sqrt(b^2+a^2),y = -a/sqrt(b^2+a^2)]]

Using Barton Willis's topoly package, it can also solve some systems
involving roots and abs (but with spurious solutions in general):

load(topoly)$
solve( [ topoly( sqrt(x)+sqrt(y) = a) , x^2=y ] , [x, y]) =>
       [[x = -(sqrt(4*a+1)-2*a-1)/2,y = -((2*a+1)*sqrt(4*a+1)-2*a^2-4*a-1)/2],
	[x = (sqrt(4*a+1)+2*a+1)/2,y = ((2*a+1)*sqrt(4*a+1)+2*a^2+4*a+1)/2],
	[x = -(2*a+sqrt(1-4*a)-1)/2,y = (2*a^2+(2*sqrt(1-4*a)-4)*a-sqrt(1-4*a)+1)/2],
	[x = (-2*a+sqrt(1-4*a)+1)/2,y = (2*a^2+(-2*sqrt(1-4*a)-4)*a+sqrt(1-4*a)+1)/2]]

If the polynomial degrees become too high, it reverts to numerical solutions:

solve( [ topoly( sqrt(x)+sqrt(y) = 1 ), x^2+y^2=1/2 ], [x, y]);
(%o47) [[x = 0.025400384368994,y = 0.70665047069541],[x =
0.70665047069541,y = 0.025400384368994],
	[x = 1.2712298*%i-1.3660254,y = 1.2712298*%i-1.3660254],
	[x = -1.2712298*%i-1.3660254,y = 1.2712298*%i-1.3660254]]

It sounds as though you're interested in numerical solutions; I don't
think any of the methods you mention have been implemented yet, so it
would be great if you wanted to contribute them....

               -s