algexact SciMax Toolbox alias

SciMax Toolbox >> algsys

algsys

Maxima Function

Calling Sequence

algsys ([expr_1, ..., expr_m], [x_1, ..., x_n])
algsys([eqn_1,...,eqn_m],[x_1,...,x_n])

Description

Solves the simultaneous polynomials expr_1, ..., expr_m or polynomial equations eqn_1, ..., eqn_m for the variables x_1, ..., x_n. An expression expr is equivalent to an equation expr = 0. There may be more equations than variables or vice versa.

algsys returns a list of solutions, with each solution given as a list of equations stating values of the variables x_1, ..., x_n which satisfy the system of equations. If algsys cannot find a solution, an empty list [] is returned.

The symbols %r1, %r2, ..., are introduced as needed to represent arbitrary parameters in the solution; these variables are also appended to the list %rnum_list.

The method is as follows:

(1) First the equations are factored and split into subsystems.

(2) For each subsystem S_i, an equation E and a variable x are selected. The variable is chosen to have lowest nonzero degree. Then the resultant of E and E_j with respect to x is computed for each of the remaining equations E_j in the subsystem S_i. This yields a new subsystem S_i' in one fewer variables, as x has been eliminated. The process now returns to (1).

(3) Eventually, a subsystem consisting of a single equation is obtained. If the equation is multivariate and no approximations in the form of floating point numbers have been introduced, then solve is called to find an exact solution.

In some cases, solve is not be able to find a solution, or if it does the solution may be a very large expression.

If the equation is univariate and is either linear, quadratic, or biquadratic, then again solve is called if no approximations have been introduced. If approximations have been introduced or the equation is not univariate and neither linear, quadratic, or biquadratic, then if the switch realonly is true, the function realroots is called to find the real-valued solutions. If realonly is false, then allroots is called which looks for real and complex-valued solutions.

If algsys produces a solution which has fewer significant digits than required, the user can change the value of algepsilon to a higher value.

If algexact is set to true, solve will always be called.

(4) Finally, the solutions obtained in step (3) are substituted into previous levels and the solution process returns to (1).

When algsys encounters a multivariate equation which contains floating point approximations (usually due to its failing to find exact solutions at an earlier stage), then it does not attempt to apply exact methods to such equations and instead prints the message: "algsys cannot solve - system too complicated."

Interactions with radcan can produce large or complicated expressions. In that case, it may be possible to isolate parts of the result with pickapart or reveal.

Occasionally, radcan may introduce an imaginary unit %i into a solution which is actually real-valued.

Examples:

(%i1) e1: 2*x*(1 - a1) - 2*(x - 1)*a2;
(%o1)              2 (1 - a1) x - 2 a2 (x - 1)
(%i2) e2: a2 - a1;
(%o2)                        a2 - a1
(%i3) e3: a1*(-y - x^2 + 1);
                                   2
(%o3)                   a1 (- y - x  + 1)
(%i4) e4: a2*(y - (x - 1)^2);
                                       2
(%o4)                   a2 (y - (x - 1) )
(%i5) algsys ([e1, e2, e3, e4], [x, y, a1, a2]);
(%o5) [[x = 0, y = %r1, a1 = 0, a2 = 0],
                                  [x = 1, y = 0, a1 = 1, a2 = 1]]
(%i6) e1: x^2 - y^2;
                              2    2
(%o6)                        x  - y
(%i7) e2: -1 - y + 2*y^2 - x + x^2;
                         2        2
(%o7)                 2 y  - y + x  - x - 1
(%i8) algsys ([e1, e2], [x, y]);
                 1            1
(%o8) [[x = - -------, y = -------],
              sqrt(3)      sqrt(3)
        1              1             1        1
[x = -------, y = - -------], [x = - -, y = - -], [x = 1, y = 1]]
     sqrt(3)        sqrt(3)          3        3
algexact SciMax Toolbox alias