|
Mike Buess
USA
3037 Posts |
Posted - 01/03/2005 : 12:43:39 PM
|
There's no built in function for that but you can write a LabTalk script that will extend the summation until the result reaches a predetermined precision. The following script will stop summing when the result after the nth term is within 0.1% of the previous result.
precision=1E-3; sum=0; for(n=0;n>=0;n++) { x=<your function of n>; if( abs(x)<precision*abs(sum) ) break; sum+=x; if( mod(n,100) ) continue; type $(n): $(sum); }; n=; // how long it took to converge sum=; // resulting sum
It types a partial result every 100 terms for a reality check. (Hit Escape if it looks like the sum is not converging.)
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 01/03/2005 1:00:48 PM |
 |
|