Post Reply 
[VA] SRC#001 - Spiky Integral
07-15-2018, 06:26 PM
Post: #17
RE: [VA] SRC#001 - Spiky Integral
This RPL program calculates the coefficients:
Code:
«
  « → m
    « { 1 m } 0 CON OBJ→ DROP m →LIST
    »
  » → n ZEROS
  « { 0 1 } 2 n
    FOR k DUP SIZE → a s
      « k ZEROS EVAL a +
        a 1 k SUB 0 + REVLIST s 1 - ZEROS EVAL +
        ADD
        a k 1 + s SUB k 2 * ZEROS EVAL +
        ADD
      »
    NEXT
  »
»

Example:
The value for 4 is:
{ 1 0 2 0 2 0 1 0 1 0 1 }

To get the value for 5 we create the following lists:
{ 0 0 0 0 0 1 0 2 0 2 0 1 0 1 0 1 }
{ 0 2 0 2 0 1 0 0 0 0 0 0 0 0 0 0 }
{ 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 }


And then we just ADD them up:
{ 0 3 0 3 0 3 0 2 0 2 0 1 0 1 0 1 }

The 2nd and the 3rd list is just the 1st list reversed and then again mirrored at the left border.
That's a consequence of \(a_k=a^k+a^{-k}\) being symmetric, that is \(a_k=a_{-k}\). We don't want negative indices.

Cheers
Thomas

PS: Is there a better way to create a list of m zeros?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC#001 - Spiky Integral - pier4r - 07-11-2018, 11:10 AM
RE: [VA] SRC#001 - Spiky Integral - Pjwum - 07-12-2018, 10:32 AM
RE: [VA] SRC#001 - Spiky Integral - Thomas Klemm - 07-15-2018 06:26 PM
RE: [VA] SRC#001 - Spiky Integral - DavidM - 07-15-2018, 07:53 PM
RE: [VA] SRC#001 - Spiky Integral - Werner - 07-18-2018, 06:17 AM



User(s) browsing this thread: 1 Guest(s)