<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Function Specification</TITLE> <META NAME="description" CONTENT="Function Specification"> <META NAME="keywords" CONTENT="vol1"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <LINK REL="STYLESHEET" HREF="vol1.css"> <LINK REL="next" HREF="node134.html"> <LINK REL="previous" HREF="node128.html"> <LINK REL="up" HREF="node127.html"> <LINK REL="next" HREF="node134.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html2223" HREF="node134.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html2219" HREF="node127.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html2213" HREF="node132.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html2221" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html2222" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html2224" HREF="node134.html">External Functions</A> <B> Up:</B> <A NAME="tex2html2220" HREF="node127.html">Fitting of Data</A> <B> Previous:</B> <A NAME="tex2html2214" HREF="node132.html">The Corrected Gauss-Newton No</A> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION001320000000000000000"> </A> <A NAME="function-specification"> </A> <BR> Function Specification </H1> <P> The functions to be fitted to data are linear combinations of a set of, so called, ``basic'' functions. Basic functions are either defined in the system or defined by the user as external FORTRAN routines. The actual combination of basic functions is defined via an interactive editor, (MIDAS command <TT>EDIT/FIT</TT>) <P> Basic functions are specified by the name, the independent variable(s) and parameter(s), with optional guesses for the parameters, following the syntax:<BLOCKQUOTE> <TT>name(var1[,</TT><IMG WIDTH="31" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img288.gif" ALT="$\ldots$"><TT>];par1[,</TT><IMG WIDTH="30" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img289.gif" ALT="$\ldots$"><TT>]) [par1=value] </TT><IMG WIDTH="31" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img290.gif" ALT="$\ldots$"></BLOCKQUOTE>The function name <TT>name</TT> defines the basic function used, it can be a system function, as defined in the table <A HREF="node133.html#basic-fit-functions">8.1</A>, or a external function with name <TT>USER00</TT>, ..., <TT>USER09</TT>. In this case, the corresponding file(s) <TT>USER00.FOR</TT>, ..., <TT>USER09.FOR</TT> will exist in the working area and will contain the definition of the routines following the syntax described in the next section. <P> The number of independent variables of the function is determined by the string <TT>var1[,</TT><IMG WIDTH="30" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img291.gif" ALT="$\ldots$"><TT>]</TT>. The actual names of the independent variables are considered as dummy names but their number has to coincide with the actual number of parameters of the function. All the functions defined in a given fit <B>must</B> have the same number of independent variables. <P> Parameters are defined by unique names after the semicolon in the function specification. Parameters are interpreted according to the position and to the number of independent variables in the function. <P> A parameter is generally given a first guess on the same line, as <TT>pari=value</TT>, it can also be fixed to a given value or kept proportional to another parameter. The parameter is defined as fixed with the symbol @ immediately following the value as <TT>pari=value@</TT>. Linear constrains between parameters are defined as <TT>pari=parj*value</TT> or <TT>pari=parj/value</TT>. <P> According to these rules, a one dimensional gaussian function is specified with the <TT>EDIT/FIT</TT> command as<BLOCKQUOTE> <TT>1 GAUSS(X;A,B,C) A=10. B=3200.@ C=1.</TT></BLOCKQUOTE>where <TT>X</TT> is the dummy name of the only independent variable, the first parameter, defining the maximum of the function, is called <TT>A</TT>, initialized to 10, the second parameter, defining the position of the gaussian, is called <TT>B</TT>, and its fixed value is 3200 in world coordinates, and the FWHM is the parameter <TT>C</TT>, with initial value 1. <P> A linear combination of a gaussian and a Cauchy distribution, centered at the same position is specified as<BLOCKQUOTE> <TT>1 GAUSS(X;A1,B1,C1) A1=10. B1=3200. C1=1. <BR> 2 CAUCHY(X;A2,B2,C2) A2=A1/10. B2=B1 C2=4.</TT></BLOCKQUOTE>in this case, the maximum of the Cauchy distribution is determined by the corresponding parameter of the Gaussian. <P> We include in table <A HREF="node133.html#basic-fit-functions">8.1</A> a summary of the system basic functions; the actual mathematical expressions, with the meaning of the function parameters are given in section <A HREF="node139.html#basic-functions">8.8</A>. <P> <BR> <DIV ALIGN="CENTER"><A NAME="11366"> </A> <TABLE> <CAPTION><STRONG>Table 8.1:</STRONG> Basic Fit Functions</CAPTION> <TR><TD> <DIV ALIGN="CENTER"> <TABLE CELLPADDING=3 BORDER="1" ALIGN="CENTER"> <TR><TD ALIGN="LEFT"><TT>POLY(X;A,B,...) </TT></TD> <TD ALIGN="LEFT">polynomial (1D, 2D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>LOG(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">natural logarithm</TD> </TR> <TR><TD ALIGN="LEFT"><TT>EXP(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">exponential</TD> </TR> <TR><TD ALIGN="LEFT"><TT>SIN(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">sinus</TD> </TR> <TR><TD ALIGN="LEFT"><TT>TAN(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">tangent</TD> </TR> <TR><TD ALIGN="LEFT"><TT>SINC(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">sinc</TD> </TR> <TR><TD ALIGN="LEFT"><TT>SINCS(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">sinc square</TD> </TR> <TR><TD ALIGN="LEFT"><TT>GAUSS(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">(FWHM) Gaussian distribution (1D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>GAUSS(X,Y;A,B,C,D,E,F) </TT></TD> <TD ALIGN="LEFT">(FWHM) Gaussian distribution (2D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>GAUSSA(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">(Standard) Gaussian distribution (1D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>CAUCHY(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">Cauchy distribution (1D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>CAUCHY(X,Y;A,B,C,D,E,F) </TT></TD> <TD ALIGN="LEFT">Cauchy distribution (2D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>LORENTZ(X,Y;A,B,C,D,E,F) </TT></TD> <TD ALIGN="LEFT">Modified Cauchy (Lorentz) distribution</TD> </TR> <TR><TD ALIGN="LEFT"><TT>LAPLACE(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">Laplace distribution</TD> </TR> <TR><TD ALIGN="LEFT"><TT>TRIANG(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">Triangular distribution</TD> </TR> <TR><TD ALIGN="LEFT"><TT>POISSON(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">Poisson distribution</TD> </TR> <TR><TD ALIGN="LEFT"><TT>IGAUSS(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">Integrated (FWHM) Gaussian distribution (1D)</TD> </TR> <TR><TD ALIGN="LEFT"><TT>IGAUSSA(X;A,B,C) </TT></TD> <TD ALIGN="LEFT">Integrated (Standard) Gaussian distribution (1D)</TD> </TR> </TABLE></DIV> <A NAME="basic-fit-functions"> </A></TD></TR> </TABLE> </DIV> <BR> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html2223" HREF="node134.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html2219" HREF="node127.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html2213" HREF="node132.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html2221" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html2222" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html2224" HREF="node134.html">External Functions</A> <B> Up:</B> <A NAME="tex2html2220" HREF="node127.html">Fitting of Data</A> <B> Previous:</B> <A NAME="tex2html2214" HREF="node132.html">The Corrected Gauss-Newton No</A> <!--End of Navigation Panel--> <ADDRESS> <I>Petra Nass</I> <BR><I>1999-06-09</I> </ADDRESS> </BODY> </HTML>