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
 Origin Forum
 Differentiate vs. derivative

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
Zenbeggar Posted - 11/02/2015 : 2:43:45 PM
Origin Ver. 8.6
OS Win7

What is the difference between derivative and differentiate? Why do they give two different results?
4   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 11/03/2015 : 8:57:26 PM
You can also use the differentiate X-Function in a single like, for example, to operation on the active sheet

differentiate iy:=(3,2) oy:=(4,5)

Will use col(3) as X col(2) as Y as input and col(4) as X and col(5) as Y as output

Older LabTalk command takes a dataset as input, and the associated X column will be accurate only if operating on the active graph, but on a worksheet it may depend on which column was used as X the last time, so it is not as reliable.

CP
KenLefebvre Posted - 11/03/2015 : 3:55:06 PM
So as it turns out, I've been somewhat mistaken about this. CP, one of the program's co-creators added the following-

Derivative is an old LabTalk command that will only pick up the correct X column/series of values in a graph.

Differentiate is an X-Function that accepts XYRanges so the user can specify which series of values represents X in the taken derivative [so, you can set it to derive your rate of change over specifically defined intervals when you have several XY columns in a worksheet].

In short, it's okay to use the Derivative Labtalk command with an active graph window, but in general the Differentiate function will give you better control when working with multiple sets of XY data.


To view more examples of using differentiate in a script, go to your Script Window and try "differentiate -h" to bring up the program help file on this function.

Ken Lefebvre
Technical Service Representative
OriginLab
KenLefebvre Posted - 11/03/2015 : 09:39:22 AM
Hi Zenbeggar,

I looked into this and here's what I could find. Both perform the same function, however derivative appears to be an older command that is no longer recommended as the standard. Although it's still supported in our most recent versions, it appears to have been grandfathered in for our userbase. Otherwise the main differences between differentiate and derivative appear to be-

(1) A shorter syntax. Derivative requires manually defining a range of data first, as opposed to differentiate which can perform the same task in one line.

e.g.
range a2 = [Book1]Sheet1!col(B)
derivative a2;

differentiate iy=Col(2);

(2) Without additional scripting derivative will replace any values it operates on.

I ran a random set of 10 integers through both functions and found the same results. Unless you're running your data through derivative and then differentiate (without copying your original values), there should be no difference between these two besides syntax. As Jason suggested, if you can send us a screenshot of your data and outputs, that might make it much easier to troubleshoot this.

Hope this helps some-
Ken Lefebvre
Technical Service Representative
OriginLab
jasonzhao Posted - 11/02/2015 : 9:42:14 PM
Hello,

Would you please take a screenshot on the results or dialog settings to help us better understand the question.

Best regards!
Jason
OriginLab Technical Service

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