\(\renewcommand\AA{\unicode{x212B}}\)
A polynomial function of degree \(n\) is defined as:
where \(A_0, ..., A_n\) are constant coefficients.
Example - Fit a polynomial background excluding some peaks
# create a sample workspace with a peak at x = 4 and a polynomial background
x = np.linspace(0, 10, 100)
y = np.exp(-4*(x-4)**2) -0.01*(x-5)**2 + 0.3
ws = CreateWorkspace(x, y)
# do a fit with the polynomial fit function
Fit("name=Polynomial,n=2", ws, Exclude=[2, 6], Output='out')
Name | Type | Default | Description |
---|---|---|---|
n | Integer | The degree of polynomial |
Name | Default | Description |
---|---|---|
A0 | 0.0 |
Categories: FitFunctions | Background | Muon\MuonModelling