Good day, I'm trying to use the function builder in origin (OriginLab) to create a new function to fit with, the broken power law (http://en.wikipedia.org/wiki/Power_law#Broken_power_law)
So, I think I got the actual function part down. For this I used
if(x<xc)
y =x^a1;
if(x>xc)
y = x^(a1-a2)*x^a2;
if(x==xc)
y = 0;
Where xc, a1 and a2 are the parameters. However, I then get to the point where you have to choose a bunch of stuff (parameter ranges, script you run to guess initial values, etc) and I have no clue what to put in there. Does anyone have some experience with this?
Even though the question asks for a suggestion using
OriginLab
, this one is using Python as the OP has accepted to give it a try!The curve-fitting method that exists in Python is from the Scipy package (curve_fit). All python packages for windows can be downloaded in a jiffy from THIS WEBSITE HERE!
When doing a curve fit, the first thing one needs to know is the fitting equation. As you already know the broken power law equation that will fit your data, you are ready to go.
The code for fitting an example data, lets call them
x and y
. Here the fitting parameters area1 and a2
.Just insert your data here and it should work just fine!! For more detailed information if needed on how the code works, CHECK OUT THIS WEBSITE I couldn't find a proper example for your fit-function, so x and y have been left blank. But once you have your data, just plug them in!