[VA] SRC#001 - Spiky Integral
|
07-14-2018, 08:38 PM
Post: #14
|
|||
|
|||
RE: [VA] SRC#001 - Spiky Integral
(07-13-2018 06:52 PM)ijabbott Wrote: It's a bit tedious to continue We can use: \[cos(nx)=\frac{e^{inx}+e^{-inx}}{2}\] Thus: \[ \begin{eqnarray} cos(mx)cos(nx) &=&(\frac{e^{imx}+e^{-imx}}{2})(\frac{e^{inx}+e^{-inx}}{2}) \\ &=& \frac{e^{i(m+n)x}+e^{-i(m+n)x}}{4}+\frac{e^{i(m-n)x}+e^{-i(m-n)x}}{4} \\ &=&\frac{cos(m+n)}{2}+\frac{cos(m-n)}{2} \end{eqnarray} \] Let's forget the factor \(\frac{1}{2}\) for a moment and define: \[a_{k}=a^{k}+a^{-k}\] For the same reason as above we have: \[ \begin{eqnarray} a_{m}a_{n}&=&(a^{m}+a^{-m})(a^{n}+a^{-n}) \\ &=&a^{m+n}+a^{-(m+n)}+a^{m-n}+a^{-(m-n)} \\ &=&a_{m+n}+a_{m-n} \end{eqnarray} \] But of course \(a_{k}=a_{-k}\). This allows us to rewrite it as: \[a_{m}a_{n}=a_{m+n}+a_{|m-n|}\] We want to calculate the product: \[p_N=\Pi_{k=1}^{N}a_{k}\] Let's assume we already have \(p_{N-1}\) represented as a sum of \(a_k\) with coefficients \(b_k\): \[p_{N-1}=\Sigma_{k=1}^{M}b_{k}a_{k}\] Then \(p_{N}=a_{N}p_{N-1}\) and thus: \[ \begin{eqnarray} p_{N} &=& a_{N}\Sigma_{k=1}^{M}b_{k}a_{k} \\ &=& \Sigma_{k=1}^{M}b_{k}a_{N}a_{k} \\ &=& \Sigma_{k=1}^{M}b_{k}(a_{N+k}+a_{N-k}) \end{eqnarray} \] This Python program allows us to calculate the coefficients \(b_k\): Code: def spiky(N): Here's the result for the first couple of values: Code: >>> for b in spiky(11): But we're only interested in the coefficient with the index 0: Code: >>> for b in spiky(40): Now it's time to deal with the factor \(\frac{1}{2}\) that we neglected. But that's trivial. We just have to add it to each factor \(a_{k}\). This leads to: \(\frac{1}{2^{N-1}}\) And since we integrate the constant over \(2\pi\) we loose another 2. These are the examples for \(N=39\) and \(N=71\): Code: >>> b = spiky(100) (07-12-2018 08:10 PM)Gerson W. Barbosa Wrote: Expand Product{ k=1..n, x^N + 1/x^N } and take the coefficient of the power of x corresponding to the Nth triangular number in the numerator (if there is no correspondence, then the result will be zero). That's your numerator. Your denominator is 2^(N - 1). Multiply the resulting fraction by \(\pi\). Not sure if I understood that correctly but it might explain the expression: \[x^N+\frac{1}{x^N}\] Thanks both for the challenge and the contributions. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)