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
 Unused x-values in derivative w/ curve.x & sgderiv

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
JSchoeck Posted - 01/09/2009 : 04:57:18 AM
Hi all,

I'm trying to calculate the derivative of a dataset that has varying and non-uniform x-value distances.

According to all examples I've found in the help and this forum the appropriate parameter to set the column for the x-values is "curve.x$ = wks_X;". Sadly, Origin ignores the x-values and assumes a uniform distance on the x-axis of 1.

Here's the command I'm using:

curve.x$ = wks_U;
curve.data$ = wks_I;
curve.result$ = wks_Deri;
curve.i1 = -1;
curve.smoothpts = 5;
curve.derivdeg = 1;
worksheet -t 2 4; //the 2nd column is I and originally type Y
curve.sgderiv();
worksheet -t 2 1; //converting it back to a Y-axis for plotting purposes


A problem that I have is that the derivative is only then calculated as long a the data-column is of the X-type (even though it should be of the Y-type!). That's why I declared it to be X-type initially, but of course this cannot be correct.

Can anyone point out the correct way of using a X-value column and a Y-value column together with curve.sgderiv() please?

Thanks for your time,
Johannes

Origin Ver. and SR (Select Help-->About Origin): 8 SR4
Operating System: WinXP
3   L A T E S T    R E P L I E S    (Newest First)
VincentLiu Posted - 01/12/2009 : 04:49:10 AM
quote:
Originally posted by JSchoeck

Thanks for the hint. :)



You can also select Analysis-> Mathematics-> Differentiate open the Differentiate dialog to get the derivative of a dataset. For more details please refer to

http://www.originlab.com/www/helponline/Origin8/en/mathematics/differentiate.htm
JSchoeck Posted - 01/12/2009 : 04:24:18 AM
Thanks for the hint. :)
VincentLiu Posted - 01/12/2009 : 04:02:29 AM
curve.sgderiv() uses Savitzky-Golay method to differentiate the dataset. And the Savitzky-Golay method requires a constant X-spacing within the data. So that why you cannot get the right results.

Origin offers another function "Derivative" to calculate the derivative, which do not need a constant X-spacing within the data. For more details, please first select Help-> Programming-> LabTalk to open the LabTalk CHM. Then choose Search tab to search with the keywords Derivative.

Best regard,
Vincent
OriginLab Tech Services

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