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
 Forum for Origin C
 Simple code for obtaining first 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
Wendy_Yang Posted - 05/15/2009 : 3:53:08 PM
Origin Ver. and Service Release (Select Help-->About Origin): Origin7 SR4
Operating System: Windows XP

I would like to differentaite one dataset and write the result into a new dataset. How do I write the codes in OriginC? For example, I have a worksheet named "Data1". There are 3 columns: X, Y and Deriv. I have X and Y filled with data, and would like to differentiate Y and put the derivative data in Deriv. So I start with:

Dataset dsX("Data1_X");
Dataset dsY("Data1_Y");
Dataset dsDeriv("Data1_Deriv");

How do I proceed from there? By the way, the codes need to be part of a user-defined function.

Thanks!
1   L A T E S T    R E P L I E S    (Newest First)
Iris_Bai Posted - 05/27/2009 : 02:21:02 AM
Hi Wendy,

In Origin7 you can use this function

int Curve_derivative( curvebase * pcrvData, curvebase * pcrvResults, int nOrder = 1, double dSmoothness = BSPLN_OFF, Dataset * pdsWeights = NULL )


Example code:

void test_Curve_derivative()
{
	Curve crvData("Data1_X", "Data1_Y");
	Curve crvResult("Data1_X", "Data1_Deriv");
	crvResult.SetSize(crvData.GetSize());
	
	int nOrder = 1;
	Curve_derivative(&crvData, &crvResult, nOrder);	
}


Iris

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