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 |
|
|