Polynomial

Description

A polynomial function of degree n is defined as:

y=A0+A1×x+A2×x2+...+An×xn,

where A0,...,An 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