Hi @Ben_BarrIngh ,
actually, I was trying to fit 2 peaks and tried to limit the fit range for the centers.
Difficult to fit the Peaks when the tails don't match to the fit curve ; )
While playing with the fit, I wondered if I can optimize the fit by restricting the range for the x1/x2 scan.
... and wondered if there is a way in the platform to restrict.
dt = New Table( "spectra",
Add Rows( 200 ),
New Column( "X",
Formula( Row() )
),
New Column( "input",
Formula(
Parameter(
{h1 = 1, W = 40, h2 = 1},
(h1 * W ^ 2) / ((:X - 70) ^ 2 + W ^ 2) + (h2 * W ^ 2) / ((:X - 130)
^ 2 + W ^ 2)
)
)
),
New Column( "fit",
Formula(
Parameter(
{h1 = 1, W = 40, h2 = 1, x1 = 0, x2 = 200},
h1 * Exp( -(:X - x1) ^ 2 / (2 * W ^ 2) ) + h2 *
Exp( -(:X - x2) ^ 2 / (2 * W ^ 2) )
)
)
)
);
dt << Nonlinear( Y( :input ), X( :fit ))