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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Differentiate vs. derivative
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Zenbeggar

7 Posts

Posted - 11/02/2015 :  2:43:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.6
OS Win7

What is the difference between derivative and differentiate? Why do they give two different results?

jasonzhao

China
262 Posts

Posted - 11/02/2015 :  9:42:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

KenLefebvre

USA
66 Posts

Posted - 11/03/2015 :  09:39:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - KenLefebvre on 11/03/2015 10:02:50 AM
Go to Top of Page

KenLefebvre

USA
66 Posts

Posted - 11/03/2015 :  3:55:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 11/03/2015 :  8:57:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000