DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sum function

 
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions
View previous topic :: View next topic  
Author Message
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Mon Mar 01, 2010 3:53 pm    Post subject: Sum function Reply with quote

I'm having a little trouble understanding where and how this function could be used.

I'd love to do this: sum(if(Y1>600,1,0))

and have DPlot immediately calculated a running total of equation at each point dX. But that is not allowed.

I first have to build the curve, then sum it. Or from the menu, I could integrate the curve in this case. Both generate an additional curve, and I'm trying to stay under that 9 curve limit for being able to do calculations on curves.

Any ideas? (Am I doing this all wrong?)
Back to top
View user's profile Send private message
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Fri Nov 21, 2014 10:49 am    Post subject: Reply with quote

David, I'd still like to do something like SUM("insert function") and not waste a curve. Or have more than 1-9 to work with for the number of curves. Something like 0-9 plus "A-F" perhaps. (or some other digit or symbol?). Any chance?? Thanks again.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Nov 21, 2014 11:19 am    Post subject: Reply with quote

There's a "Running Total" command on the Generate menu that will do (as far as I can tell) what you want. You can run this from a macro with
RunPlugin("Running Total")
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Fri Nov 21, 2014 4:20 pm    Post subject: Reply with quote

You must mean "Integrate a Curve". (There's no other "running total" command in 2.3.5.3??) Yes, I saw that, but didn't try it because I thought it acted "odd" the last time I played with it. But now I see it actually does do a SUMY() as I thought it should. But that process still generates 2 curves, instead of leaving out the intermediate step if I could stack the equation.

But I'll make that work.

Thanks for the reply.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Nov 21, 2014 5:10 pm    Post subject: Reply with quote

Ack! I now notice I've never included the "Running Total" plugin with the distribution. Probably because I didn't get around to allow you to specify which curves to operate on - it will always operate on ALL curves, meaning you end up with twice as many curves as you started with, plus your originals will always be preserved.

If you're interested you can get it from http://www.dplot.com/plugins/generate/runsum.dll

Copy that file to [dplot folder]\plugins\generate.

"Integrate a Curve" is equivalent ONLY if your data starts at Y=0 and X is incremented by 1. "Integrate..." gives you a running area under a curve, while "Running Total" does pretty much what you'd expect it to do.

Back to your original question, it looked like you wanted to sum Y's based on whether an existing Y was greater than some constant. There's no way to do that presently but in the context of your question I don't get the negative on producing a second curve. I suppose "Running Total" should prompt for whether to preserve or discard the data you're operating on. SUM() still can't be used in that context, but that's a simple enough addition I think.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Fri Nov 21, 2014 5:50 pm    Post subject: Reply with quote

Thanks, but runsum is not quite ready for prime time! (Definitely needs to be able to select a curve(s), and the generated curves are not labeled.) Guess I'll stick with what I'm doing. I have 4 or 5 data curves, and using stacked IF statements comparing Y values in several of the curves, I assign 1 or 0 in 1 second intervals (or .5 second then divide/2 later on). Then I sum that conditional curve for a cumulative total using SUMY(n). If I could SUMY the stacked IF curve I could eliminate 1 curve each time I do this. Of course, I guess I could delete the IF curve after I make the SUMY() curve and effectively do the same thing. It just seems that I keep bumping into the 9 curve limit by a curve or 2.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group