⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hybrd_.3

📁 该程序实现了非线性最小二乘问题和非线性方程组的解法
💻 3
字号:
.\"                                      Hey, EMACS: -*- nroff -*-.\" First parameter, NAME, should be all caps.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection.\" other parameters are allowed: see man(7), man(1).TH HYBRD_ 3 "March 8, 2002" Minpack.\" Please adjust this date whenever revising the manpage..SH NAMEhybrd_, hybrd1_ \- find a zero of a system of nonlinear function.SH SYNOPSIS.B #include <minpack.h>.sp.nh.ad l.HP 28.BI "void hybrd1_ ( ".BI "void (*" fcn ")(".BI "int *" n ,.BI "double *" x ,.br.BI "double *" fvec , .BI "int *" iflag  ), .RS 15.BI "int *" n , .BI "double *" x , .BI "double *" fvec , .br.BI "double *" tol , .BI "int *" info , .BI "double *" wa , .br.BI "int *" lwa );.RE.HP 27.BI "void hybrd_" .BI "( void (*" fcn ")(".BI "int * " n , .BI "double *" x , .br.BI "double *" fvec , .BI "int *" iflag ), .RS 14.BI "int *" n , .BI "double *" x , .BI "double *" fvec , .br.BI "double *" xtol , .BI "int *" maxfev ,.BI "int *" ml , .BI "int *" mu , .br.BI "double *" epsfcn , .BI "double *" diag , .BI "int *" mode ,.BI "double *" factor , .BI "int *" nprint , .BI "int *" info , .br.BI "int *" nfev ,.BI "double *" fjac , .BI "int *" ldfjac , .br.BI "double *" r , .BI "int *" lr , .BI "double *" qtf ,.br.BI "double *" wa1 , .BI "double *" wa2 , .BI "double *" wa3 , .BI "double *" wa4 );.RE.hy.ad b.br.SH DESCRIPTIONThe purpose of \fBhybrd_\fP is to find a zero of a system of\fIn\fP nonlinear functions in \fIn\fP variables by a modificationof the Powell hybrid method. The user must provide asubroutine which calculates the functions. The Jacobian isthen calculated by a forward-difference approximation..PP\fBhybrd1_\fP serves the same function but has a simplified callingsequence..br.SS Language notes\fBhybrd_\fP and \fBhybrd1_\fP are written in FORTRAN. If calling fromC, keep these points in mind:.TPName mangling.With \fBg77\fP version 2.95 or 3.0, all the function names end in anunderscore.  This may change with future versions of \fBg77\fP..TPCompile with \fBg77\fP.Even if your program is all C code, you should link with \fBg77\fPso it will pull in the FORTRAN libraries automatically.  It's easiestjust to use \fBg77\fP to do all the compiling.  (It handles C just fine.).TPCall by reference.All function parameters must be pointers..TPColumn-major arrays.Suppose a function returns an array with 5 rows and 3 columns in anarray \fIz\fP and in the call you have declared a leading dimension of7.  The FORTRAN and equivalent C references are:.sp.nf	z(1,1)		z[0]	z(2,1)		z[1]	z(5,1)		z[4]	z(1,2)		z[7]	z(1,3)		z[14]	z(i,j)		z[(i-1) + (j-1)*7].fi.SS Parameters for both functions\fIfcn\fP is the name of the user-supplied subroutine which calculatesthe functions. In FORTRAN, \fIfcn\fP must be declared in an externalstatement in the user calling program, and should be written asfollows:.sp.nfsubroutine fcn(n,x,fvec,iflag)integer n,iflagdouble precision x(n),fvec(n)----------calculate the functions at x andreturn this vector in fvec.---------returnend.fi.sp.spIn C, \fIfcn\fP should be written as follows:.sp.nf  void fcn(int n, double *x, double *fvec, int *iflag)  {    /* calculate the functions at x and       return this vector in fvec. */  }.fi.spThe value of \fIiflag\fP should not be changed by \fIfcn\fP unlessthe user wants to terminate execution of \fBhybrd_\fP.In this case set \fIiflag\fP to a negative integer.\fIn\fP is a positive integer input variable set to the numberof functions and variables.\fIx\fP is an array of length \fIn\fP. On input \fIx\fP must containan initial estimate of the solution vector. On output \fIx\fPcontains the final estimate of the solution vector.\fIfvec\fP is an output array of length \fIn\fP which containsthe functions evaluated at the output \fIx\fP..br.SS Parameters for \fBhybrd1_\fP\fItol\fP is a nonnegative input variable. Termination occurswhen the algorithm estimates that the relative errorbetween \fIx\fP and the solution is at most \fItol\fP.\fIinfo\fP is an integer output variable. If the user hasterminated execution, \fIinfo\fP is set to the (negative)value of \fIiflag\fP. See description of \fIfcn\fP. Otherwise,\fIinfo\fP is set as follows.\fIinfo\fP = 0   improper input parameters.\fIinfo\fP = 1   algorithm estimates that the relative error           between \fIx\fP and the solution is at most \fItol\fP.\fIinfo\fP = 2   number of calls to fcn has reached or exceeded           200*(\fIn\fP+1).\fIinfo\fP = 3   \fItol\fP is too small. No further improvement in           the approximate solution \fIx\fP is possible.\fIinfo\fP = 4   iteration is not making good progress.\fIwa\fP is a work array of length \fIlwa\fP.\fIlwa\fP is a positive integer input variable not less than(\fIn\fP*(3*\fIn\fP+13))/2..br.SS Parameters for \fBhybrd_\fP\fIxtol\fP is a nonnegative input variable. Terminationoccurs when the relative error between two consecutiveiterates is at most \fIxtol\fP.\fImaxfev\fP is a positive integer input variable. Terminationoccurs when the number of calls to \fIfcn\fP is at least \fImaxfev\fPby the end of an iteration.\fIml\fP is a nonnegative integer input variable which specifiesthe number of subdiagonals within the band of thejacobian matrix. If the Jacobian is not banded, set\fIml\fP to at least \fIn\fP - 1.\fImu\fP is a nonnegative integer input variable which specifiesthe number of superdiagonals within the band of thejacobian matrix. If the jacobian is not banded, setmu to at least \fIn\fP - 1.\fIepsfcn\fP is an input variable used in determining a suitablestep length for the forward-difference approximation. Thisapproximation assumes that the relative errors in thefunctions are of the order of \fIepsfcn\fP. If \fIepsfcn\fP is lessthan the machine precision, it is assumed that the relativeerrors in the functions are of the order of the machineprecision.\fIdiag\fP is an array of length \fIn\fP. If \fImode\fP = 1 (seebelow), \fIdiag\fP is internally set. If \fImode\fP = 2, \fIdiag\fPmust contain positive entries that serve asmultiplicative scale factors for the variables.\fImode\fP is an integer input variable. If \fImode\fP = 1, thevariables will be scaled internally. If \fImode\fP = 2,the scaling is specified by the input \fIdiag\fP. Othervalues of mode are equivalent to \fImode\fP = 1.\fIfactor\fP is a positive input variable used in determining theinitial step bound. This bound is set to the product of\fIfactor\fP and the euclidean norm of diag*x if nonzero, or elseto \fIfactor\fP itself. In most cases factor should lie in theinterval (.1,100.). 100. Is a generally recommended value.\fInprint\fP is an integer input variable that enables controlledprinting of iterates if it is positive. In this case,\fIfcn\fP is called with \fIiflag\fP = 0 at the beginning of the firstiteration and every nprint iterations thereafter andimmediately prior to return, with \fIx\fP and \fIfvec\fP availablefor printing. If \fInprint\fP is not positive, no special callsof \fIfcn\fP with \fIiflag\fP = 0 are made.\fIinfo\fP is an integer output variable. If the user hasterminated execution, \fIinfo\fP is set to the (negative)value of \fIiflag\fP. See description of \fIfcn\fP. Otherwise,\fIinfo\fP is set as follows.\fIinfo\fP = 0   improper input parameters.\fIinfo\fP = 1   relative error between two consecutive iterates           is at most \fIxtol\fP.\fIinfo\fP = 2   number of calls to \fIfcn\fP has reached or exceeded           \fImaxfev\fP.\fIinfo\fP = 3   \fIxtol\fP is too small. No further improvement in           the approximate solution \fIx\fP is possible.\fIinfo\fP = 4   iteration is not making good progress, as           measured by the improvement from the last           five jacobian evaluations.\fIinfo\fP = 5   iteration is not making good progress, as           measured by the improvement from the last           ten iterations.\fInfev\fP is an integer output variable set to the number ofcalls to \fIfcn\fP.\fIfjac\fP is an output \fIn\fP by \fIn\fP array which contains theorthogonal matrix \fIq\fP produced by the \fIqr\fP factorizationof the final approximate jacobian.\fIldfjac\fP is a positive integer input variable not less than \fIn\fPwhich specifies the leading dimension of the array \fIfjac\fP.\fIr\fP is an output array of length \fIlr\fP which contains theupper triangular matrix produced by the \fIqr\fP factorizationof the final approximate Jacobian, stored rowwise.\fIlr\fP is a positive integer input variable not less than(\fIn\fP*(\fIn\fP+1))/2.\fIqtf\fP is an output array of length \fIn\fP which containsthe vector (q transpose)*\fIfvec\fP.\fIwa1\fP, \fIwa2\fP, \fIwa3\fP, and \fIwa4\fP are work arrays of length \fIn\fP..SH SEE ALSO.BR hybrj (3),.BR hybrj1 (3)..br.SH AUTHORSBurton S. Garbow, Kenneth E. Hillstrom, Jorge J. More..brThis manual page was written by Jim Van Zandt <jrv@debian.org>,for the Debian GNU/Linux system (but may be used by others).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -