Previous Page Next Page Contents

ground -- ground term (constant coefficient) of a polynomial

Introduction

ground(p) returns the constant coefficient p(0,0,...) of the polynomial p.

Call(s)

ground(p)
ground(f)
ground(f, vars)

Parameters

p - a polynomial of type DOM_POLY
f - a polynomial expression
vars - a list of indeterminates of the polynomial: typically, identifiers or indexed identifiers

Returns

an element of the coefficient ring of p, an arithmetical expression, or FAIL.

Overloadable:

p, f

Related Functions

coeff, collect, degree, degreevec, lcoeff, ldegree, lmonomial, lterm, nterms, nthcoeff, nthmonomial, nthterm, poly, poly2list, tcoeff

Details

Example 1

We demonstrate how the indeterminates influence the result:

>> f := 2*x^2 + 3*y + 1:
   ground(f), ground(f, [x]), ground(f, [y]),
   ground(poly(f)), ground(poly(f, [x])), ground(poly(f, [y]))
                               2                     2
                1, 3 y + 1, 2 x  + 1, 1, 3 y + 1, 2 x  + 1

The result is the evaluation at the origin:

>> subs(f, x = 0, y = 0), subs(f, x = 0), subs(f, y = 0)
                                          2
                           1, 3 y + 1, 2 x  + 1

Note the difference between ground and tcoeff:

>> g := 2*x^2 + 3*y:
   ground(g), ground(g, [x]);
   tcoeff(g), tcoeff(g, [x]);
                                  0, 3 y
      
                                  3, 3 y
>> delete f, g:

Example 2

The result of ground is not fully evaluated:

>> p := poly(27*x^2 + a, [x]): a := 5:
   ground(p), eval(ground(p))
                                   a, 5
>> delete p, a:

Example 3

The following expression is syntactically not a polynomial expression, and ground returns FAIL:

>> f := (x^2 - 1)/(x - 1): ground(f)
                                   FAIL

After cancellation via normal, ground can compute the constant coefficient:

>> ground(normal(f))
                                     1
>> delete f:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000