The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 sum function

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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.)

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/03/2005 1:00:48 PM

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000