Examples of user-defined functions and the proper syntax

You can enter a very broad class user-defined functions to fit to your data in PAN but the functions' syntax must adhere to some simple guidelines.
  1. Independent variable must be written as x.
  2. Fit parameters must be written as elements of a vector, p, starting with an index 0.
  3. Any built-in IDL function can be used but the proper IDL syntax must be used.
The examples below show the proper syntax for some functions

Sloping line
y = mx + b
PAN:        p[0]*x+p[1]
Symmetric Decay
y = ae-b|x|
PAN:        p[0]*exp(-p[1]*abs(x))
Two-site jump EISF
y = ( 1+jo(rx) ) / 2
PAN:        0.5*(1.0+beselj(p[0]*x,0))
Fourth order polynomial
y = ao+a1x+a2x2+a3 x3+a4x4
PAN:         poly(x,[p[0],p[1],p[2],p[3],p[4]])
Damped oscillation
y = ae-bxcos(cx)
PAN:         p[0]*exp(-p[1]*x)*cos(p[2]*x)
Series of associated Legendre polynomials
y = aP20(bx) + cP41(dx)
PAN:         p[0]*legendre(p[1]*x,2,0)+p[2]*legendre(p[3]*x,4,1)

Back to PAN controls page
Back to PAN page