non-analytical solutions
PiStosHiO17
I assume that I can give IGOR the following (a function, the fit parameters, and a given Intensity) and then ask it to ask it to return to me the Time at 0.9*maximum, 0.5*maximum, 0.4*maximum, and 0.1*maximum. Can someone help me?
Here is the function I am using. Also included is the fit parameters for a feature, and the representative feature that I am trying to work with. Thanks!!!!!
Function XES_Fit1(param, xx) // basis: SAK2_Gauss, added lorentzian functions
// Param [0] XES_Fit1 Y0 (offset)
// Param [1] XES_Fit1 A (amplitude)
// Param [2] XES_Fit1 x0 (peak position)
// Param [3] XES_Fit1 half width (width)
// Param [4] XES_Fit1 mixing (Gaussian : Lorentzian)
// Param [5] XES_Fit1 Skew
// Param [6] XES_Fit1 LW-ratio
wave param; variable xx
variable tempA
tempA = param[0]+param[1]*(param[4]*ga1(param,xx)+(1-param[4])*lre1(param,xx))
return tempA
end
Function ga1(param,xx)
Wave param; Variable xx
Variable tempB
tempB= exp((-ln(2)*(xx-param[2])^2)/(((param[3]+(xx-param[2])*param[5])*param[6])^2))
return TempB
end
Function lre1(param,xx)
Wave param;Variable xx
Variable TempC
TempC=(param[3]+(xx-param[2])*param[5])^2/((param[3]+(xx-param[2])*param[5])^2+(xx-param[2])^2)
return tempC
end
// Param [0] XES_Fit1 Y0 (offset)
// Param [1] XES_Fit1 A (amplitude)
// Param [2] XES_Fit1 x0 (peak position)
// Param [3] XES_Fit1 half width (width)
// Param [4] XES_Fit1 mixing (Gaussian : Lorentzian)
// Param [5] XES_Fit1 Skew
// Param [6] XES_Fit1 LW-ratio
wave param; variable xx
variable tempA
tempA = param[0]+param[1]*(param[4]*ga1(param,xx)+(1-param[4])*lre1(param,xx))
return tempA
end
Function ga1(param,xx)
Wave param; Variable xx
Variable tempB
tempB= exp((-ln(2)*(xx-param[2])^2)/(((param[3]+(xx-param[2])*param[5])*param[6])^2))
return TempB
end
Function lre1(param,xx)
Wave param;Variable xx
Variable TempC
TempC=(param[3]+(xx-param[2])*param[5])^2/((param[3]+(xx-param[2])*param[5])^2+(xx-param[2])^2)
return tempC
end
Here are the parameters for the following feature:
0
-8.17597
7.29073e-06
2.26073e-08
0.207583
0.271577
1
Intensity Time (mSec)
0 -1.4993e-06
0 -1.4983e-06
0 -1.4973e-06
0 -1.4963e-06
0 -1.4953e-06
[the rest of the data was removed by aclight because it was too long]
I think the extreme size of the data you included in your original post was preventing the post from being displayed. I have edited your original post to remove all but the first few lines of the data. If the data is important, please attach it as a file.
January 2, 2013 at 07:36 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 2, 2013 at 11:07 am - Permalink
Read the associated help file Multi-peak Fitting 2 Help.ihf, and try the demo experiment for further details.
January 2, 2013 at 12:34 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 2, 2013 at 04:55 pm - Permalink
When I use the FindRoots option it gives me the solutions in the command window. For an assymetric function is there a good way to store one of the solutions as a point in a wave?
PiSTosHiO
Stosh Kozimor
January 3, 2013 at 04:40 am - Permalink
Access the results via the variables that FindRoots creates. Since your function is univariate, use the variables for a single 1D funtion. From the FindRoots documentation:
The results of finding roots of a single 1D function are put into several variables:
V_numRoots Number of roots found. Either 1 or 2.
V_Root The root.
V_YatRoot Y value of the function at the root. *Always* check this; some discontinuous functions may give an indication of success, but the Y value at the found root isn't even close to zero.
V_Root2 The second root if FindRoots found two roots.
V_YatRoot2 Y value at the second root.
Wrap FindRoots in a user-defined function; you can access the roots from the output variables and assign them to a wave after FindRoots returns. Be sure your code checks V_flag to make sure the root finder didn't encounter obvious problems. Be sure to check V_numRoots to decide if you need to run a second FindRoots for your asymmetric peaks. Be sure to check V_YatRoot (and V_YatRoot2) to make sure that the found root is really a root. As long as the /H and /L brackets are set reasonably, your function is well-behaved and you shouldn't have problems with finding roots that aren't roots.
Read the help file about how FindRoots works- copy this command, paste it into the command line and press Enter:
DisplayHelpTopic "Finding Function Roots"
You can skip the section on polynomial roots :)
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 3, 2013 at 09:12 am - Permalink
January 3, 2013 at 11:59 am - Permalink