numapprox
chebsort
sort the terms in a Chebyshev series
Calling Sequence
Parameters
Description
Examples
chebsort(e)
e
-
expression assumed to be a Chebyshev series
The input expression e is assumed to be a polynomial expressed in terms of a Chebyshev basis T0,x,....
First the expression e is collected in 'T'. Then the terms in the collected polynomial expression are sorted in ``Chebyshev order''; i.e. the Tk,x basis polynomials are ordered in ascending order with respect to the first argument.
If some basis polynomials Tk,x have non-numeric first argument then ordering will be attempted using the ``is'' predicate. If that is not successful then ordering is performed only with respect to numeric first arguments (other terms are left as trailing terms).
Note that chebsort is a destructive operation because it invokes the Maple sort function (see sort); i.e. the input expression is sorted ``in-place''.
The command with(numapprox,chebsort) allows the use of the abbreviated form of this command.
withnumapprox:
Digits≔3:
a≔chebyshevsinx,x:
b≔chebyshevcosx,x:
c≔a+b
c≔0.880T1,x−0.0391T3,x+0.000500T5,x+0.765T0,x−0.230T2,x+0.00495T4,x
chebsortc
0.765T0,x+0.880T1,x−0.230T2,x−0.0391T3,x+0.00495T4,x+0.000500T5,x
assume5<j,j<k
d≔1.2y+cjTj,x+a+ckTk,x
d≔1.2y+cjTj~,x+0.880T1,x−0.0391T3,x+0.000500T5,x+ckTk~,x
chebsortd
0.880T1,x−0.0391T3,x+0.000500T5,x+cjTj~,x+ckTk~,x+1.2y
See Also
collect
is
numapprox[chebyshev]
orthopoly[T]
sort
Download Help Document