Application of Groebner BasesProblemSetup of the problem fricas Z==>Integer; Q==>Fraction Z Type: Void
fricas CP==>DistributedMultivariatePolynomial([a, Type: Void
fricas CF==>Fraction CP Type: Void
fricas P==>DistributedMultivariatePolynomial([d, Type: Void
fricas PX==>UnivariatePolynomial('x, Type: Void
fricas p(x:PX):PX == x*(1-x) Type: Void
fricas q(y:PX):PX == a*y^2+b*y+c Type: Void
fricas y:PX := m*x+n
Type: UnivariatePolynomial(x,
fricas r:PX := p(x) - d*q(y) fricas Compiling function p with type UnivariatePolynomial(x, fricas Compiling function q with type UnivariatePolynomial(x,
Type: UnivariatePolynomial(x, Compute the solutionWe must first extract the coefficients, since each coefficient of any power of x must vanish if the polynomial r is identically 0. fricas coeffs := coefficients r
Type: List(DistributedMultivariatePolynomial?([d, Now we compute a Groebner basis and then solve for the respective variables. fricas gb := groebner coeffs
Type: List(DistributedMultivariatePolynomial?([d,
fricas egb: List Equation Fraction Polynomial Z := [p=0 for p in gb]
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas solve(egb,
Type: List(List(Equation(Fraction(Polynomial(Integer))))) In fact, solve is powerful enough so that it is unnecessary to call the Buchberger algorithm explicitly. fricas ecoeffs: List Equation Fraction Polynomial Z := [p=0 for p in coeffs]
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas solve(ecoeffs,
Type: List(List(Equation(Fraction(Polynomial(Integer))))) Of course, the result depends on the order of the variables given to the solve command. ((Unfortunately, the axiom-wiki does not properly show the result, so we have added a semicolon to suppress the output.)) fricas solve(ecoeffs, Type: List(List(Equation(Fraction(Polynomial(Integer)))))
=============================================================== Example code --rrogers, Tue, 02 Dec 2014 23:49:41 +0000 reply fricas ---- Ordered variable lists. Poly_to_Gauss:=[d,
fricas Gauss_to_Poly:=[x,
Type: List(UnivariatePolynomial(x,
fricas ----coefficient arrays. corg := d* matrix [[c,
Type: Matrix(Polynomial(Integer))
fricas ---- Explicit target cgauss := matrix [[0,
Type: Matrix(Integer)
fricas ---- Generalized target ctar := matrix [[w,
Type: Matrix(Polynomial(Integer))
fricas ---- polynomial basis arrays. xorg := matrix ([[1,
Type: Matrix(Polynomial(Integer))
fricas xgauss := matrix([[1,
Type: Matrix(UnivariatePolynomial(x,
fricas ---- Example row(corg * transpose(xorg),
Type: Vector(Polynomial(Integer))
fricas ---- Translation matrix Pascal Pa(n) for 3x3 case ---- see Aceto below for references. Pa(n) == matrix [[1, Type: Void
fricas ---- Scalar matrix Sc(m) == diagonalMatrix [1, Type: Void
fricas ---- Now define transform in matrix form D := corg -(cgauss * Pa(n) * Sc(m)) fricas Compiling function Pa with type Variable(n) -> Matrix(Polynomial( Integer)) fricas Compiling function Sc with type Variable(m) -> Matrix(Polynomial( Integer))
Type: Matrix(Polynomial(Integer))
fricas ---- Now we do a more realistic solve in two steps ---- Step one disallow silly answers E:=groebnerFactorize(row(D,
Type: List(List(Polynomial(Integer)))
fricas ---- and clean it up (a lot). I wish these two steps could be one! solve(E.1,
Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas ---- Now lets test the reasonableness the width to start with is ---- 2*sqrt(b^2-4*a*c)/(2*a) which the left hand term yields. There is a sign ambiguity ---- corresponding to whether the source quadratic is to the left or right. ---- I could swap n,
Type: Matrix(Polynomial(Integer))
fricas Z==>Integer; Q==>Fraction Z Type: Void
fricas CP==>DistributedMultivariatePolynomial([a, Type: Void
fricas CF==>Fraction CP Type: Void
fricas P==>DistributedMultivariatePolynomial([d, Type: Void
fricas PX==>UnivariatePolynomial('x, Type: Void
fricas p(x:PX):PX == x*(1-x) Type: Void
fricas fp(x:PX):PX == u*x^2+v*x+w Type: Void
fricas q(y:PX):PX == a*y^2+b*y+c; Type: Void
fricas y:PX := m*x+n
Type: UnivariatePolynomial(x,
fricas r:PX := p(x) - d*q(y) fricas Compiling function p with type UnivariatePolynomial(x, fricas Compiling function q with type UnivariatePolynomial(x,
Type: UnivariatePolynomial(x,
fricas s:PX := fp(x) - d*q(y) fricas Compiling function fp with type UnivariatePolynomial(x,
Type: UnivariatePolynomial(x,
fricas coeffs := coefficients r
Type: List(DistributedMultivariatePolynomial?([d,
fricas fcoeffs := coefficients s
Type: List(DistributedMultivariatePolynomial?([d,
fricas gb := groebner coeffs
Type: List(DistributedMultivariatePolynomial?([d,
fricas fgb := groebner fcoeffs
Type: List(DistributedMultivariatePolynomial?([d,
fricas egb: List Equation Fraction Polynomial Z := [p=0 for p in gb]
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas fegb: List Equation Fraction Polynomial Z := [p=0 for p in fgb]
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas ecoeffs: List Equation Fraction Polynomial Z := [p=0 for p in coeffs]
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas fecoeffs: List Equation Fraction Polynomial Z := [p=0 for p in fcoeffs]
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas cc:=solve(egb, Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas cc.1
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas dd:=solve(ecoeffs, Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas dd.1
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas fcc:=solve(fegb, Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas fcc.1
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas fdd:=solve(fecoeffs, Type: List(List(Equation(Fraction(Polynomial(Integer)))))
fricas fdd.1
Type: List(Equation(Fraction(Polynomial(Integer))))
|