Subject:
Why do I receive the error message "Error, integer too large in context" while using the Symbolic Math Toolbox?
Problem Description:
The following example produces an error:
I=sqrt(-1);
j=0;
for E=1000:0.01:1100,
j=j+1;
f(j)=zeta(0.5+I*E);
end
复制代码
The error message I receive is:
??? Error using ==> maple
Error, integer too large in context
Error in ==> C:\MATLAB6p5\toolbox\symbolic\digits.m
On line 18 ==> r = eval(maple('Digits;'));
Error in ==> C:\MATLAB6p5\toolbox\symbolic\@sym\double.m
On line 16 ==> d = digits;
Error in ==> C:\MATLAB6p5\toolbox\symbolic\zeta.m
On line 10 ==> Z = double(zeta(sym(n)));
Error in ==> C:\MATLAB6p5\work\sven_aberg\test.m
On line 9 ==> f(j)=zeta(0.5+i*E);
Solution:
This may be a problem with the way memory management is performed by Maple. At present, the only potential workaround is to wrap your call to a symbolic calculation that operates on numbers with large numbers of digits inside a TRY/CATCH block and clear the Maple function using the following commands:
For Symbolic Math 2.1.3 (R13) and earlier:
maple clear
% or
maple restart
复制代码
For Symbolic Math 3.0 (R13+) and later:
clear maplemex
复制代码
Alternatively you may increase the frequency of automatic garbage
collections, which occurs (approximately) after every <integer>
words used in maple using the following command:
maple('kernelopts(gcfreq=10000)');
复制代码
For further information on the use of this command type: