login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Submitted by : (unknown) at: 2007-11-17T22:01:54-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

Some examples:

fricas
)set output algebra on
 
fricas
)set output tex off
L := [ A = 2*X+Y, B = 2*Y+X, C = 2*U+V, D = 2*V+U];
Type: List(Equation(Polynomial(Integer)))
fricas
solve(L, [X,Y])
(2) []
Type: List(List(Equation(Fraction(Polynomial(Integer)))))

However:

fricas
solve(L,[X,Y,U,V])
- B + 2A 2B - A - D + 2C 2D - C (3) [[X= --------,Y= ------,U= --------,V= ------]] 3 3 3 3
Type: List(List(Equation(Fraction(Polynomial(Integer)))))

Note that solution should satisfy all equations. Quantities which are not variables are treated as parameters and solution is valid for generic parameters. There are no values of X and V which solve the last two equations: generically C is different than 2*U+V

Simpler:

fricas
solve([a - b = 0, c - d = 0],[b])
(4) []
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas
linSolve([a - b, c - d],[b])
(5) [particular= "failed",basis= []]
Type: Record(particular: Union(Vector(Fraction(Polynomial(Integer))),"failed"),basis: List(Vector(Fraction(Polynomial(Integer)))))

The operation solve calls linSolve, which sets up the corresponding matrix and vector and solves it using solve$LinearSystemMatrixPackage. This in turn returns "failed", since the last columns of the matrix contain zeros, the vector does not. In the example above, the matrix and vector are:

         +- 1+
   [mat= |   |,vec= [- a,d - c]]
         + 0 +

Note that

fricas
linSolve([a - b, 0],[b])
(6) [particular= [a],basis= []]
Type: Record(particular: Union(Vector(Fraction(Polynomial(Integer))),"failed"),basis: List(Vector(Fraction(Polynomial(Integer)))))

works. The same happens, if the equation is not linear:

fricas
L := [ A = 2*X^2+Y, B = 2*Y+X, C = 2*U+V, D = 2*V+U];
Type: List(Equation(Polynomial(Integer)))
fricas
solve(L, [X, Y])
(8) [[]]
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas
)set output algebra on
 
fricas
)set output tex off
solve(L, [X, Y, U, V])
2 2 - D + 2C 2D - C (9) [[X= - 2Y + B,8Y + (- 8B + 1)Y + 2B - A= 0,U= --------,V= ------]] 3 3
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas
)set output algebra off
 
fricas
)set output tex on

So, very probably, a fix would need to do two things:

  • seperate the equations into those that do and those that don't contain the given variables.
  • check whether those that don't contain the variables are contradicting.
  • solve the others.

The second point is necessary, since

fricas
L := [ A = P+Q, B = P-Q, C = 1, C = -1];
Type: List(Equation(Polynomial(Integer)))
fricas
solve(L, [P,Q])

\label{eq1}\left[ \right](1)
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas
solve(L,[P,Q,C])

\label{eq2}\left[ \right](2)
Type: List(List(Equation(Fraction(Polynomial(Integer)))))

really has no solution. As far as I know, this would have to be done in the very last function defined in syssolp.spad, which is:

       -- general solver. Input in polynomial style  --
       solve(lr:L F,vl:L SE) ==
           empty? vl => empty()
           checkLinear(lr,vl) =>
                            -- linear system --
               soln := linSolve(lr, vl)
               soln case "failed" => []
               eqns: L EQ F := []
               for i in 1..#vl repeat
                   lhs := (vl.i::(P R))::F
                   rhs :=  rhs soln.i
                   eqns := append(eqns, [lhs = rhs])
               [eqns]

                         -- polynomial system --
           if R has GcdDomain then
             parRes:=triangularSystems(lr,vl)
             [[makeEq(map(makeR2F,f)$PP2,vl) for f in pr]
                                                        for pr in parRes]
           else [[]]

The letter F is a macro for FRAC POLY R here. To check whether an equation contains a variable we have to check numerator and denominator of both sides of the equation with variables$POLY R. I do not know however, how to find out whether the equations independent of vl are contradicting.

Status: open => rejected




  Subject:   Be Bold !!
  ( 14 subscribers )  
Please rate this page: