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 for Programming
 Forum for Origin C
 Curve differentiation problems
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

evanm

Canada
Posts

Posted - 05/27/2004 :  08:23:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,
I think I have a really strange and unique problem here. I want to read a curve from a worksheet using Origin C and then differentiate it using "Curve_derivative". This works just fine when I create the worksheet by importing from an ASCII file or open the worksheet, but it never works at all when I create a worksheet from an opened graph. it doesn't even work if I save the worksheet that was created from the graph and then reopen it. I think there must be something different internally in the way Origin manages the data. This is a huge problem because I often transfer graphs and then open them elsewhere and view its corresponding worksheet. Has anyone heard of this happening? By the way I am using Origin 7.
Thank you, Evan Morris.

evanm

Canada
Posts

Posted - 05/27/2004 :  08:27:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
To add to that, for any curve I create from the graph-created-worksheet, I can view and change the data using the square brackets curve[i]. The problem is that Curve_derivative DOES NOT change the data in the pResults curve that I pass the function. It does however change the passed results curve for a curve created fom a "good" worksheet.
Go to Top of Page

evanm

Canada
Posts

Posted - 05/27/2004 :  11:09:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Opps....please disregard this thread. My "problem" is no where near what I thought and Origin does not have some wierd perk to it. My problem was simply that Curve_bspline and Curve_derivative require Curves that are sorted with increasing X, I had decreasing. This was not in the documentation (help) files, but since I am using an older version (7) it has probebly changed without me knowing. Evan.
Go to Top of Page

Mike

USA
357 Posts

Posted - 05/27/2004 :  2:20:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Evan, I looked to see what the Origin 7 Help file (the Origin C Language Reference) had to say about Curve_bspline and Curve_derivative. Both list the following return values:

quote:
Returns zero on successful exit and a non-zero error code on failure.
Errors:
-1=System can not allocate enough memeory
-2=Curve data type error
-4=The result curve range can not be set
5=The smoothness parameter must be equal to or greater than 0
11=The number of data points is less than 4
63=The sequence of X in source data is not increasing
73=Memory allocation failed
240=The weights are not all positive
254=The smoothness parameter is too small


I hope this helps, but it sounds as though you may have worked this through.

Mike
OriginLab
Go to Top of Page

Mike

USA
357 Posts

Posted - 05/27/2004 :  2:31:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Evan, I did a bit of checking and the OriginC Help file in earlier Origin 7 builds was lacking the info that I posted above. So make sure that you are using SR4 and be sure to get the latest version 7 Help files (http://www.originlab.com/index.aspx?s=12&lm=+66).

Mike
OriginLab
Go to Top of Page

evanm

Canada
Posts

Posted - 06/01/2004 :  08:59:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike, that's exactly what I could have used. I was getting the return value 63 but I didn't know what it meant. Evan.
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