After a few changes I'm getting "The value of 1 is not of type LIST.".
On May 25, 2011, at 7:00 , Barton Willis wrote:
> In the definition for planch, try changing abs to cabs; thus
>
> planch(f,v):=factor(integrate(cabs(f)^2,v,minf,inf))$
OK, I did this and it worked, though the documentation for abs() is incorrect, or I need to do something to tell Maxima that Ft(f,x,k) is complex:
-- Function: abs (<expr>)
Returns the absolute value <expr>. If <expr> is complex, returns
the complex modulus of <expr>.
Complicating the problem a bit by making the Gaussian adjustable I get a "The value 1 is not of type LIST." lisp error. If I set "c" (the width of the Gaussian) to 1/sqrt(2) the problem goes away. Can someone explain what's up? As I'm sending this I'm wondering why I didn't make a,b, and c scalars, I'll have to see what that does.
====
declare ( x,[real,scalar], k,[real,scalar], a,real, b,real, c,real)$
assume( a>0, b>0, c>0 )$
/* Gaussian. */
gauss(x,a,b,c):=a*%e^(-((x-b)^2)/(2*c^2))$
/* Fourier transform. */
FT(fx,x,k):=integrate(fx*%e^(-2 * %i * %pi * k * x), x, minf, inf)$
/* An even function (shifted gaussian) + odd function (two shifted gaussians, one negative): */
feven:gauss(x,1,0,1/sqrt(2))$
fodd:gauss(x - 1, a, b, c) - gauss(x + 1, a, b, c)$
f:feven+fodd$
/* "Plancherel's sum" - just integrate the square of the modulus over all values. */
planch(f,v):=factor(integrate(cabs(f)^2,v,minf,inf))$
/* I expect these to all be 0. */
planch(feven,x) - planch(FT(feven,x,k),k); /* OK. */
planch(fodd,x) - planch(FT(fodd,x,k),k); /* OK. */
planch(f,x) - planch(FT(f,x,k),k); /* Huh? */
====
...
(%i9) planch(f, v) := factor(integrate(cabs (f), v, minf, inf))
(%i10) planch(feven, x) - planch(FT(feven, x, k), k)
(%o10) 0
(%i11) planch(fodd, x) - planch(FT(fodd, x, k), k)
(%o11) 0
(%i12) planch(f, x) - planch(FT(f, x, k), k)
Maxima encountered a Lisp error:
The value 1 is not of type LIST.
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i14)
====
Peter
-----------------
Peter Dufault
HD Associates, Inc. Software and System Engineering