Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
mej
Posted - 01/03/2005 : 11:34:50 AM Origin Version (Select Help-->About Origin): 6.1 pro Operating System: win 2000
Hi everybody and happy new year in 2005 I would like to know if the function sum for n=0 to n=infinity of a give function exists in Origin
Thanks
1 L A T E S T R E P L I E S (Newest First)
Mike Buess
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.)