Error message: Too many contexts



Detlef wrote:

> I have a simple batch program, which causes a to many context error.
> 
> DD:3;
> f(i,j,x,y):=cos(i*(x+y)/2)*sin(j*(x-y)/4);
> pp(x):=cos(x)+cos(2*x);
> Dint(f,v,a,b):=block([FF:ratsimp(integrate(f,v))],subst(b,v,FF)-subst(a,v,FF)
> );
> fn(i,j,x,y):=ratsimp(f(i,j,x,y)/ev(sqrt(Dint(Dint(f(i,j,x,y)*f(i,j,x,y),x,-4*
> %pi,4*%pi),y,-4*%pi,4*%pi))));
> wf(i,x,y):=fn(floor(i/4),mod(i,4)+1,x,y);
> EP1:genmatrix(ev(aa),DD,DD);
> g:2;
> for i from 0 thru DD do (for j from 0 thru DD do
> aa[i,j]:(Dint(Dint(wf(i,x,y)*wf(j,x,y)*(pp(x)+pp(y)),x,-%pi,%pi),y,-%pi,
> %pi)));
> 
> ***
> If I remove the second cos from the function pp everything is fine.
> Is there a way to increase the number of contexts? If so, it would be
> great to include this into the error message.

As far as I know there is currently no easy way to  increase the
number of contexts. The whole machinery is set up initially with a
maximum of 50 contexts at compile-time.
If you know what you are doing you could mimic that in a running
maxima by switching into lisp mode. Have a look at db.lisp to see
what is going on.

I did not look closer at what you are really trying to accomplish,
but just for fun wanted to see if a limit of 1000 contexts would
suffice for your problem, so I cranked up connumber to 1000. But
even that was not enough!

And I must confess, that I don not really understand whats going
on inside db.lisp :-(

'Andreas