Page 1 of 1

calculating the diffference from data ?

Posted: Sun Oct 23, 2011 4:42 am
by bfennema
Dear forum,

my name is Boris and I am new to DPlot but very impressed with the ease of use.

There is one task that I would like to do in Dplot and perhaps it is possible,

I have data such like
(x,y)
(1,10)
(2,20)
(3,20)
(4,25)
(5,32)

and would like to produce a sequence where each point in Y is the difference between Y(n)-Y(n-1) - this would make the first point invalid.

(.,.)
(2,10) -- 20-10
(3,0) -- 20-20
(4,5) -- 25 -20
(5,7) -- 32 - 25

Can this be done ?

The file is large so I cannot do it in Excel.

best regards,

B.

Posted: Sun Oct 23, 2011 9:19 am
by bfennema
p.s.

Just figured, since x increments by 1, I can differentiate the curve

I will try that once I have the data set here.

B.

Posted: Sun Oct 23, 2011 12:10 pm
by DPlotAdmin
The Differentiate command in the current version will not do what you want (or at least not what you described). (The next release will, because it includes a "Previous point" method that uses Y(n) and Y(n-1), as opposed to the "Central difference" method, which uses Y(n+1) and Y(n-1)).

You can do this: Use Edit>Copy>Data values and Edit>Paste to add a copy of your original data. Use Edit>Operate on X with X=X+1 on the copy. This shifts all points in the copy to the right by 1. Then use Generate>Y=f(X,Y1,Y2,...) with Y=Y2-Y1.

Posted: Mon Oct 24, 2011 3:45 am
by bfennema
Many thanks,

That should do what I need - excellent. I had not thought of that combination of moves, that is very flexible.

Thank you !

B.