tcl_func.c
Bindings for FUNC
TCL SYNTAX:
funcNew "<name>" "[list]"
TCL HELP STRING:
Return the handle to a func.
gauss is a gaussian; parameters are position, sigma, and normalization
hubble is Hubble power law; parameters are I0 and a
devauc is de Vaucouleurs law; parameters are Ie and Re
freeman is Freeman power law; parameters are I0 and r0
Return the handle to the new func.
TCL ARGUMENTS:
:
"<name>" : Kind of the func to return
"[list]" : Optional list of VECTORs
TCL SYNTAX:
funcDel "<func>"
TCL HELP STRING:
Delete a FUNC and its handle
TCL ARGUMENTS:
:
"<func>" : The FUNC to delete
TCL SYNTAX:
funcEval "<func>" "<x>"
TCL HELP STRING:
Evaluate a FUNC at x
Reurn the evaluated value
TCL ARGUMENTS:
:
"<func>" : The FUNC to evaluate
"<x>" : Where to evaluate FUNC
TCL SYNTAX:
funcPlot "<pg>" "<func>" "-resFunc" "<xmin>" "<xmax>" "<npt>"
TCL HELP STRING:
Plot a FUNC from xmin to xmax
TCL ARGUMENTS:
:
"<pg>" : Where to plot
"<func>" : The FUNC to evaluate
"-resFunc" : FUNC to subract at each point
"<xmin>" : Starting x value
"<xmax>" : Ending x value
"<npt>" : Number of points to plot
TCL SYNTAX:
methNew "<name>"
TCL HELP STRING:
Return the handle to a meth.
chi2 is for least squares minimization
The handle.
TCL ARGUMENTS:
:
"<name>" : Kind of meth to retrn
TCL SYNTAX:
methDel "<meth>"
TCL HELP STRING:
Delete a METH and its handle
TCL ARGUMENTS:
:
"<meth>" : The METH to delete
TCL SYNTAX:
dnls1 "<meth>" "<func>" "<x>" "<y>" "<w>" "-mask" "-iopt" "-ftol" "-xtol" "-gtol" "-maxfev" "-epsfcn" "<diag>" "-mode" "-factor" "-nprint"
TCL HELP STRING:
The purpose of DNLS1 is to minimize the sum of the squares of M
nonlinear functions in N variables by a modification of the
Levenberg-Marquardt algorithm. The user must provide a subrou-
tine which calculates the functions. The user has the option
of how the Jacobian will be supplied. The user can supply the
full Jacobian, or the rows of the Jacobian (to avoid storing
the full Jacobian), or let the code approximate the Jacobian by
forward-differencing. This code is the combination of the
MINPACK codes (Argonne) LMDER, LMDIF, and LMSTR.
Returns a keyed list of func, info, nfev, njev
TCL ARGUMENTS:
:
"<meth>" : how to minimize
"<func>" : the function to fit
"<x>" : vector of x values
"<y>" : vector of y values
"<w>" : vector of weights
"-mask" : mask vector
"-iopt" : only 1 works now
"-ftol" : relative error in sum of squares to terminate iteration; defaults to square root of the machine precisionn
"-xtol" : relative error in successive iterations to terminate iteration; defaults to square root of the machine precision
"-gtol" : tolerence on cos of angle between fvec and any column of the Jacobian to terminate iteration; defaults to zero
"-maxfev" : maximum number of calls to meth; defaults to 200*(n+1)
"-epsfcn" : step size; defaults to machine precision
"<diag>" : if mode=2, n entries that serve as implicit multiplicative scale factors for the parameters
"-mode" : 1 variables scaled internally; 2 scaling specified by diag
"-factor" : used to determine initial step bound
"-nprint" : each nprint call to meth has iflag=0
TCL SYNTAX:
dnls1e "<meth>" "<func>" "<x>" "<y>" "<w>" "-mask" "-nprint" "-iopt" "<tol>"
TCL HELP STRING:
The purpose of DNLS1E is to minimize the sum of the squares of M
nonlinear functions in N variables by a modification of the
Levenberg-Marquardt algorithm. This is done by using the more
general least-squares solver DNLS1. The user must provide a
subroutine which calculates the functions. The user has the
option of how the Jacobian will be supplied. The user can
supply the full Jacobian, or the rows of the Jacobian (to avoid
storing the full Jacobian), or let the code approximate the
Jacobian by forward-differencing. This code is the combination
of the MINPACK codes (Argonne) LMDER1, LMDIF1, and LMSTR1.
Returns info: 1, 2, or 3 are OK
TCL ARGUMENTS:
:
"<meth>" : how to minimize
"<func>" : the function to fit
"<x>" : vector of x values
"<y>" : vector of y values
"<w>" : vector of weights
"-mask" : mask vector
"-nprint" : number of calls with iflag=0
"-iopt" : only 1 works now
"<tol>" : relative error to define termination