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
 Origin Forum
 B-Spline
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a_user

USA
0 Posts

Posted - 08/19/1998 :  7:10:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Is there a way to curve fit using a b-spline in Origin 5? I know it's
possible to connect points using "plot details - connect using b-spline"
but I can't get the worksheet for it.

Barb Tobias

USA
305 Posts

Posted - 08/19/1998 :  7:23:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Creating a New Interpolated Data Plot

One approach...
Change the line connection type to b-spline in the Plot Details dialog box.
Then select Analysis:Inter/Extrapolate. Specify the settings in the resultant
dialog box and click OK. Now you have a data plot based on your original data
with a b-spline connection.
To view the Y data associated with this new data plot, perform the following:
1. Double-click on the new data plot. Alternatively, you can hold down the
CTRL key and select Data:NewDatasetName from the data list (where
NewDatasetName is the newly created b-spline data plot).
Either of these actions opens the Plot Details dialog box for the new data
plot.
2. Click the Worksheet button to view the Y data associated with this data
plot.

Go to Top of Page

gschmied

USA
5 Posts

Posted - 06/02/2001 :  9:05:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Is there a way to change the number of data points used to calculate the b-spline fit? I tried adjusting the SplineStep variable in the ORIGIN.INI file as suggested on page 402 of the version 6 manual, but it didn't seem to change anything (perhaps this only affects the Spline fit). Thanks for your help!
Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 06/05/2001 :  10:47:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have another related question: is there a direct way for using splines (or other) as interpolation when using datasets as functions, instead of lineal interpolation?

To explain this: If I have two datasets in the Data1 worksheet as follows:

A(X) B(Y)
1 3.1
2 6.6
3 8.3
4 9.2

and I ask LabTalk to give

DATA1_B(2.5)=

I get 7.45. It is supposed to have made a linear interpolation between the second and third points, and given the Y value for X=2.5.

Now, if I plot this in a line-plot with straight connections and do the same thing, I get the same value of Y=7.45. This value changes if I change the plot connection, as pointed in previous replies to this topic. If, for instance, I connect the points with a B-Spline and do the same query, I get Y=7.395.

But see what happens if now I kill this graph, and only the initial worksheet remains: now the result is Y=6.294. Why don't I get the same initial result? The plotting has changed the behaviour of the interpolation, and it gives an absurd value now.

Now I create a New Function, called F1, and define it as Data1_b(x), and plot it from X=0 to X=5. I reproduce the same line I had in the line-plot I have just deleted, i.e., B-Spline connected points. So my query magically gives again DATA1_B(2.5)=7.395. But if I again delete this graph the weird Y value of 6.294 is recovered.

So, after I have changed the plot connection to B-Spline, it looks as the datasets must be plotted to give correct values when used as functions.

Is there any way to control this, and even to select the type of interpolation without having to plot the data? Using datasets as functions is something I do frequently in my scripts, and I'd like to have further control on it (appart from being sure that I am getting correct results).

All this happens with my Origin 6.0 SR2.

Related topic: Do an interpolation directly with LabTalk


jose.

Go to Top of Page

rtoomey

USA
184 Posts

Posted - 06/05/2001 :  2:59:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
gschmied,

You are correct in assuming the SplineStep setting affects the Spline connection method only.

I think the best way to increase the number of points used for a B-Spline connection would be to interpolate it (after the fact) as described in Barb Tobias' response.

Jose,

Spline and B-Spline connection methods are supported in graphs only. This is the reason for the erroneous results you were getting.

If you want to use a Spline/B-Spline interpolation method without first creating a graph, you might consider using the interpolation calculations directly. The equations used for the B-Spline connection method are clearly documented in our Origin User's Manual.

- rtoomey





Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 06/11/2001 :  08:23:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
rtoomey said: "Spline and B-Spline connection methods are supported in graphs only. This is the reason for the erroneous results you were getting."

Well, but in any case Origin uses a simple connection method (linear) to give results when no graph is done. How can this method be recovered after a graph is created and deleted?

Imagine I have a script that makes use of this capability of the Origin of using datasets as functions, for example to get uniformely x-separated data from random experimental adquisitions. This script can fail if the user has previously plotted a spline with his/her data and then deleted this graph! I miss some further control over this.

The knowledge base doen't say anything about the necessity of having the data plotted!

j.

Go to Top of Page

rtoomey

USA
184 Posts

Posted - 06/12/2001 :  12:17:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

Jose,



If you're doing these activities through script, try changing the line connection back to Straight (Linear) before deleting the graph. One line of script is required:



set %C -l 1;



That should solve the problem.

Furthermore, in response to the following comment: "The knowledge base doesn't say anything about the necessity of having the data plotted!"...please keep in mind that the Knowledge Base is not as comprehensive as the User's Manual; nor does it cover exactly the same material!

- rtoomey

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