Algorithm for shifting a curve

158 Views Asked by At

I have to following problem that I would like to solve.

I have a vector of coefficients $V = [a_N, \ldots ,a_1, a_0]$ which represents the coefficients of a polynomial $P$, i.e.: $$ P(x) = a_N x^N + ... + a_1 x + a_0 $$

I would like to write an algorithm for shifting the curve on the horizontal axis, i.e., given a shift factor $h$ I would like to find a generalized way for automatically writing the coefficients of the polynomial: $$ P(x-h) = a_N (x-h)^N + \ldots + a_1(x-h) + a_0 $$ on MATLAB, without computing them at hand.

Thanks in advance.

2

There are 2 best solutions below

0
On BEST ANSWER

Based on the answer of kaharas, I will add some corrections.

Given the polynomial: $$ P(x) = a_N x^N + ... + a_1x + a_0 $$ the coefficients of the polynomial: $$ P(x-h) = a_N^* x^N + ... + a_1^* + a_0^* $$ can be found as follows: $$ \left \{ \begin{array}{ll} a_i^* = \sum_{j=i}^N \binom{j}{i} a_j h^{j-i}(-1)^{j-i} & i = 1...N \\ a_0^* = \sum_{j=0}^N a_j h^j (-1)^j & \end{array} \right . $$

3
On

Hoping that by "without calculating them" you mean "without calculating the $(x-h)^k$ polinomials", this should work:

$a^*_{i} = \sum_{j=i}^n\binom{j}{i}a_jh^{j-i}$