## `solvelib::getElement` -- get one element of a set

#### Introduction

`solvelib::getElement``(S)` returns an element of `S`.

#### Call(s)

`solvelib::getElement(S)`

#### Parameters

`S` | - | any set

#### Returns

`solvelib::getElement` returns a MuPAD object representing an object of `S`, or `FAIL` if no element could be determined.

### Overloadable:

`S`

#### Related Functions

`solve`

#### Details

- `solvelib::getElement` may return `FAIL` either if `S` is the empty set, or if no element of the set could be computed because the solver is not strong enough, or if the answer depends on the value of some parameter.

#### Example 1

If `S` is a finite set, just one of its elements is returned.

    >> solvelib::getElement({2, 7, a})

                                         a

#### Example 2

For image sets, an element is obtained by replacing every parameter by a constant.

    >> S:=Dom::ImageSet(k*PI, k, solvelib::BasicSet(Dom::Integer))

                               { X1*PI |  X1 in Z_ }

    >> solvelib::getElement(S)

                                         0

#### Example 3

`solvelib::getElement` may fail to find an element of a set although that set is not empty.

    >> solvelib::getElement(solve(exp(x)+x=0,x))

                                       FAIL

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000