How Do I Use Functions for Curve Fitting in Origin Software?

Click For Summary

Discussion Overview

The discussion revolves around the use of functions for curve fitting in Origin software, specifically focusing on two functions intended to model different parts of a curve. Participants explore the implications of using these functions, their mathematical properties, and the relationship to non-linear fitting techniques.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes the functions I(x)=I0-I1cos(x-x0) and I(x)=I2+I3cos(x-x1) as fitting the lowest and highest parts of a curve, respectively, and seeks clarification on their derivation and relation to Taylor's Series.
  • Another participant suggests that instead of fitting the high and low parts separately, it may be more effective to fit all data simultaneously to a single function that combines both, while expressing concern about the non-linear nature of the fitting process.
  • Questions arise regarding the necessity of avoiding non-linear fitting, with one participant noting that non-linear fitting can be sensitive to initial guesses and noise in the data.
  • There is a discussion about the equivalence of using sine and cosine functions in the context of fitting, highlighting that they can represent the same data with appropriate phase shifts.
  • Participants inquire about the significance of the negative and positive signs in the functions, with one noting that they can yield the same fit under certain conditions.

Areas of Agreement / Disagreement

Participants express differing views on the approach to fitting the data, with some advocating for simultaneous fitting and others questioning the implications of non-linear fitting. The discussion remains unresolved regarding the best method to apply.

Contextual Notes

Participants do not provide specific context for the data being fitted, nor do they clarify the assumptions underlying the use of the proposed functions. There is also a lack of consensus on the implications of using sine versus cosine functions.

Who May Find This Useful

This discussion may be useful for individuals interested in curve fitting techniques, particularly in the context of using Origin software, as well as those exploring the mathematical properties of trigonometric functions in data modeling.

SataSata
Messages
39
Reaction score
2
I plotted a graph on Origin software and need to do curve fitting to get accurate results. From my understanding, I need to provide a function for the fitting. So how do I derive the function?

I am actually provided with the function I(x)=I0-I1cos(x-x0) and this function will fit the lowest part of my curve and the program will derive x0 which is the value of x when the y value is the lowest. On the other hand, the function I(x)=I2+I3cos(x-x1) will fit the highest part of the curve and x1 is the value of x when y is the highest.

Can somebody explain those 2 functions and how the software fit the curve with it and how all this can be related to the Taylor's Series?
 
Physics news on Phys.org
I cannot help at all with Origin software, but I can help you with the curve fitting in general.

If you can, a priori, separate your data into "high part" data and "low part" data then you could fit the "high part" data to one function and the "low part" to the other function. My guess is that you cannot do that a priori (i.e. without looking at the y values). Therefore you should simultaneously fit all of the data to a single function which would fit both the high part and the low part. The easiest such function would simply be the sum of the two functions.

The other thing that you would like to avoid is any non-linear fitting. Unfortunately, the way that you have it written is non-linear in both x0 and x1.

So, can you think of a simple function which is equal to the sum of the two functions you have given, and pulls all of the fit parameters outside of the sin and cos functions?
 
  • Like
Likes   Reactions: SataSata
Thank you DaleSpam. I don't understand why we need to avoid non-linear fitting but my curve is suppose to look like a period of cos curve. I guess this is a mathematical question but what does those two functions actually mean? Would the result be different if they are change to sin? Why is it minus for the lowest part and plus for the highest part?
 
SataSata said:
I don't understand why we need to avoid non-linear fitting but my curve is suppose to look like a period of cos curve.
There are non-linear fitting routines, but they usually require an initial guess, and they can converge to bad fits sometimes or be very sensitive to the guess or noise in the data. It is not that you cannot do non-linear fitting, but you usually get better results if you can linearize your system (which you can here).
SataSata said:
I guess this is a mathematical question but what does those two functions actually mean?
I don't know the context, you haven't said. It means that I(x) has a given relationship to x, but I cannot tell you more.

SataSata said:
Would the result be different if they are change to sin?
This is along the lines that you should be thinking about. Since ##\cos(x) = \sin(x+\pi/2)## then if you fit a function to ##\cos(x-x_0)## that is exactly the same as fitting a function to ##\sin(x-k_0)## where ##k_0=x_0+\pi/2##.

SataSata said:
Why is it minus for the lowest part and plus for the highest part?
This is the same as with the previous question. There is no difference between fitting ##I_1 \cos(x)## vs ##-I_3 \cos(x)##. They will both fit the same data equally well simply with the fit parameters ##I_1=-I_3##.
 
  • Like
Likes   Reactions: SataSata

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
5K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K