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? Curve_derivative problem

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
schuettm Posted - 07/05/2006 : 9:31:22 PM
Origin Version (7.0 SR0):
Operating System: WinXP

I begin with 2 columns of x,y data. I add mathematically-manipulated data into new y columns, and then add new x and y columns to hold a derivative. Then I fill these new x and y columns with data from the first x column to set them to the correct column length. Finally, I define two curves - one for the data I want the derivative of (the original x column vs. one of the mathematically-manipulated y columns), and another for the derivative-holding columns. When I use Curve_derivative(&lnJV_C,&dlnJdV_C,1), where lnJV_C is the pdata and dlnJdV_C is the presult, it does not change the data in the dlnJdV_C columns.

I have no problems taking the derivative of the data in columns 0 and 1 of my worksheet, only when I try taking the derivative of the data in colums 0 and (something other than 1). What might I be doing wrong here? Thanks a lot!

(my code:)

void ideality(string wksName, int colV0, int colI0)
{

Worksheet wks(wksName);

Curve IV_C(wks, colV0, colI0);

// new column to hold J
int colJ0 = wks.AddCol("J");

// J calculation from I
Dataset J0(wks,colJ0);
Dataset I0(wks,colI0);
J0 = I0/(3.14159*(100E-4/2)^2); // for d=100um diode

// new column for lnJ
int collnJ0 = wks.AddCol("lnJ");

// lnJ calculation
Dataset lnJ0(wks,collnJ0);
lnJ0 = ln(J0); // natural log of current density

// new columns to hold V and dlnJ/dV
int coldV1 = wks.AddCol("dV");
int coldlnJ0 = wks.AddCol("dlnJ");
wks.Columns(coldV1).SetType(OKDATAOBJ_DESIGNATION_X);

// Fill new V column with original V values
Dataset dV0(wks,coldV1);
Dataset V0(wks,colV0);
dV0 = V0;

// curve of ln(J) vs V
Curve lnJV_C(wks,colV0,collnJ0);

// curve to hold derivative of lnJ w.r.t. V
Curve dlnJdV_C(wks,coldV1,coldlnJ0);

// fill new dlnJ column with V values, to make it the correct size
dlnJdV_C = dV0;

// derivative of lnJ w.r.t. V
// Curve_derivative(&IV_C,&dlnJdV_C,1); // this works fine
Curve_derivative(&lnJV_C,&dlnJdV_C,1); // this doesn't work

}

Edited by - schuettm on 07/05/2006 9:34:35 PM
2   L A T E S T    R E P L I E S    (Newest First)
zachary_origin Posted - 07/10/2006 : 12:16:48 AM
Hi Schuette,

I have looked at the data you sent through the mail and tested it.

It is found that in the column of J (the 3rd column) of the data,
there are some data with negative values so that lnJ will return
missing value. Then derivative can not get the correct answer. So
you need clear the data with negative and then do the derivative, it
will work.

Any question, feel free to contact us.

Zachary
OriginLab GZ Office
zachary_origin Posted - 07/06/2006 : 05:19:42 AM
Hi Schuette,

We have tested the function in Origin 7.0 SR5, WinXP with row numbers as the value X column and uniform random numbers as the value of Y column. Your function works fine, so I think maybe it something about your data, because derivate may throw errors if the data are "bad".

Would you send us your data so that we can take a further look at the problem? tech@originlab.com

Zachary
OriginLab GZ Office

Edited by - zachary_origin on 07/06/2006 05:29:44 AM

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