Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a certain multivariate polynomial (in 4 variables) written in terms of monomials, and I would like to change the basis into Chebyshev orthogonal basis.
Is there any function to do that?
$\begingroup$@DanielLichtblau: I'm having trouble, I tried f = Sum[RandomInteger[{-5, 5}] x^k, {k, 0, 5}]; b = Table[ChebyshevT[k, x], {k, 0, 5}]; PolynomialReduce[f, b, x] and it's just giving $a_1$ as the original polynomial. Am I doing something dumb?$\endgroup$
$\begingroup$@DumpsterDoofus Try defining each Chebyshev polynomial as a new variable, using b = Table[y[k] - ChebyshevT[k, x], {k, 0, 5}];. Then see what PolynomialReduce produces.$\endgroup$
$\begingroup$@DanielLichtblau: Hm, still having trouble understanding. With randomly generated polynomial 5 - 3 x + 3 x^2 + 2 x^3, the output by PolynomialReduce is {{0, 3 - 2 x^2 + x (-3 - 2 y[1]) - 3 y[1] - 2 y[1]^2, 0, 0, 0, 0}, 5 - 3 y[1] + 3 y[1]^2 + 2 y[1]^3}, but I don't see how that gives the correct answer of Chebyshev polynomial coefficients, which is supposed to be {13/2, -(3/2), 3/2, 1/2, 0}.$\endgroup$
$\begingroup$@DumpsterDoofus Ah. Yes, you are getting a "correct" result in terms of the polynomial rewrite, it's just not a useful result (it involves powers of y[1], which is x, which is useless). If I get something worked out I'll post.$\endgroup$
PolynomialReduce
. $\endgroup$f = Sum[RandomInteger[{-5, 5}] x^k, {k, 0, 5}]; b = Table[ChebyshevT[k, x], {k, 0, 5}]; PolynomialReduce[f, b, x]
and it's just giving $a_1$ as the original polynomial. Am I doing something dumb? $\endgroup$b = Table[y[k] - ChebyshevT[k, x], {k, 0, 5}];
. Then see whatPolynomialReduce
produces. $\endgroup$5 - 3 x + 3 x^2 + 2 x^3
, the output byPolynomialReduce
is{{0, 3 - 2 x^2 + x (-3 - 2 y[1]) - 3 y[1] - 2 y[1]^2, 0, 0, 0, 0}, 5 - 3 y[1] + 3 y[1]^2 + 2 y[1]^3}
, but I don't see how that gives the correct answer of Chebyshev polynomial coefficients, which is supposed to be{13/2, -(3/2), 3/2, 1/2, 0}
. $\endgroup$y[1]
, which isx
, which is useless). If I get something worked out I'll post. $\endgroup$