\(\renewcommand\AA{\unicode{x212B}}\)
Polynomial¶
Description¶
A polynomial function of degree \(n\) is defined as:
\[y = A_0 + A_1 \times x + A_2 \times x^2 + ... + A_n \times x^n,\]
where \(A_0, ..., A_n\) are constant coefficients.
Usage¶
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')
Attributes (non-fitting parameters)¶
Name |
Type |
Default |
Description |
---|---|---|---|
n |
Integer |
The degree of polynomial |
Properties (fitting parameters)¶
Name |
Default |
Description |
---|---|---|
A0 |
0.0 |
Categories: FitFunctions | Background | Muon\MuonModelling
Source¶
C++ header: Polynomial.h
C++ source: Polynomial.cpp