I can't get this to work.



Here is my relevant code

(start:1,stop:50)$

f(xval,energy,qn):=
block
([fpprec:fpp,a,p,i,acc,hbar,m,mu,x,y,yt,e,maxterms:100000],x:bfloat(xval),e:bfloat(energy),
    a[-5]:0,a[-4]:0,a[-3]:0,a[-2]:0,a[-1]:0,a[0]:if mod(qn, 2)=1 then 1b0 else 0b0,a[1]:if mod(qn,2)=0 then 1b0 else 
0b0,
    hbar:1,mu:1/10000,m:1,
    if mod(qn,2)=1 then (y:bfloat(a[0]),acc:1b0) else (y:bfloat(a[1]*x), acc:x),
    for i: 2 + if mod(qn,2)=1 then 0 else 1 thru maxterms step 2 do (
        a[i]:(mu * a[i-6] - a[i-2] * e)/(i * (i - 1) * hbar^2/(2*m)),
        acc:acc*x*x,
        yt:acc*a[i],
        y:y+yt,
        if abs(yt) < 1b-50 then (b:i,i:maxterms + 1000) else b:i
    ),
    y
)$

%Psi(x,t):=sum(C[qn]*(1/sqrt(A[qn])*f(x,Allowed_Energy[qn][1],qn))*exp(((-Allowed_Energy[qn][1])*%i*t)),qn,start,stop);

apply
(
    draw,
    append
    (
        [
            pic_width=550,
            pic_height=400,
            delay = 50,
            file_name = "c:/Harmonic Stationary Fast",
            terminal = 'animated_gif
        ],
        makelist(gr2d(title="Gaussian in a x^4 Potential", yrange=[0,1], color=blue, 
explicit(realpart(conjugate('%Psi(x, t/90*%pi))*'%Psi(x,t/90*%pi)),x,-5,5)), t, 0, 1)
    )
);

C[i], Allowed_Energy[i][1] and A[i] are big floats, just real numbers not functions.

I get "Storage for stream is exausted." in the draw command.  I think the reason is because Maxima is trying to evaluate 
the function before x and t have numerical values assigned to them.  I have only two frames and I get the error.  I want 
to do at least 90 frames.  I am not sure what that number will work out to yet and I don't care how long it takes to 
run.

Help!

Rich