boundfun.cpp File Reference

### (* \$Id: boundfun.cpp 1712 2014-02-28 23:52:33Z johnoel \$)

Code to implement placing constraints on parameters. More...

`#include "fvar.hpp"`
`#include <stdlib.h>`
`#include <stdio.h>`
`#include <math.h>`

Go to the source code of this file.

## Defines

#define USE_BARD_PEN

## Functions

dvariable boundp (const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
dvariable boundp (const prevariable &x, double fmin, double fmax, const prevariable &_fpen)
Compute penalty for exceeding bounds on parameter; variable ojbects.
double boundp (double x, double fmin, double fmax)
Return scaled variable to original units; constant objects.
double boundp (double x, double fmin, double fmax, const double &_fpen)
Compute penalty for exceeding bounds on parameter; constant ojbects.
double boundpin (double x, double fmin, double fmax, double s)
Scale model variable over [-1,1]; constant objects.
double boundpin (double x, double fmin, double fmax)
Scale model variable over [-1,1]; constant objects.
double boundpin (const prevariable &x, double fmin, double fmax, double s)
Scale model variable over [-1,1]; variable objects.
double boundpin (const prevariable &xx, double fmin, double fmax)
Scale model variable over [-1,1]; variable objects.
dvariable dfatan1 (dvariable x, double fmin, double fmax, const prevariable &_fpen)
Scale input variable between upper and lower bounds and compute a penalty for exceeding the bounds.
dvariable dfboundp (const prevariable &x, double fmin, double fmax)
Computes the derivative of dvariable boundp(const prevariable& x, double fmin, double fmax,const prevariable& _fpen)
double dftinv (double x, double fmin, double fmax)
Inverse of dvariable dfatan1(dvariable x, double fmin, double fmax, const prevariable& _fpen)
double dmax (double x, double y)
Returns the maximum of two numbers.
double dmin (double x, double y)
Returns the minimum of two numbers.
double nd2fboundp (double x, double fmin, double fmax, const double &fpen)
Scale input variable between upper and lower bounds and compute a penalty for exceeding the bounds.
double ndfboundp (double x, double fmin, double fmax, const double &fpen)
Derivatative code for double nd2fboundp( double x, double fmin, double fmax,const double& fpen)

## Detailed Description

Code to implement placing constraints on parameters.

See in Section 10.1 of the AUTODIF manual. The code in thse section of the AUTODIF manual appears to be out of date with respect to some of the code in this file.

Definition in file boundfun.cpp.

## Define Documentation

 #define USE_BARD_PEN

Use penalties recomended in Bard, Y. (1974) Nonlinear parameter estimation. Academic Press, New York.

Definition at line 21 of file boundfun.cpp.

## Function Documentation

 dvariable boundp ( const prevariable & x, double fmin, double fmax, const prevariable & _fpen, double s )

Compute penalty for exceeding bounds on parameter; variable ojbects.

Parameters:
 x Variable scaled between [-1,1] fmin Lower bound of x fmin Upper bound of x _fpen On return, contains penalty if x > 1 or x < -1 s Divide x by s before scaling and setting bounds
Returns:
The variable x in original units

Definition at line 95 of file boundfun.cpp.

 dvariable boundp ( const prevariable & x, double fmin, double fmax, const prevariable & _fpen )

Compute penalty for exceeding bounds on parameter; variable ojbects.

Parameters:
 x Variable scaled between [-1,1] fmin Lower bound of x fmin Upper bound of x _fpen On return, contains penalty if x > 1 or x < -1
Returns:
The variable x in original units

Definition at line 108 of file boundfun.cpp.

 double boundp ( double x, double fmin, double fmax )

Return scaled variable to original units; constant objects.

Parameters:
 x Variable scaled between [-1,1] fmin Lower bound of x fmin Upper bound of x
Returns:
The variable x in original units

Definition at line 250 of file boundfun.cpp.

 double boundp ( double x, double fmin, double fmax, const double & _fpen )

Compute penalty for exceeding bounds on parameter; constant ojbects.

Inverse of double boundp(const double& x, double fmin, double fmax, const double& _fpen).

Parameters:
 x Model variable fmin Lower bound of x fmin Upper bound of x _fpen On return, contains penalty if x > fmax or x < fmin
Returns:
The variable x in original units

Definition at line 316 of file boundfun.cpp.

 double boundpin ( double x, double fmin, double fmax, double s )

Scale model variable over [-1,1]; constant objects.

Inverse of double boundp(double x, double fmin, double fmax)

Parameters:
 x Model variable fmin Lower bound of x fmin Upper bound of x s Divide x by s before scaling and setting bounds
Returns:
The variable x in original units

Definition at line 384 of file boundfun.cpp.

 double boundpin ( double x, double fmin, double fmax )

Scale model variable over [-1,1]; constant objects.

Inverse of double boundp(double x, double fmin, double fmax)

Parameters:
 x Model variable fmin Lower bound of x fmin Upper bound of x
Returns:
Scaled model variable over [-1,1].

Definition at line 397 of file boundfun.cpp.

 double boundpin ( const prevariable & x, double fmin, double fmax, double s )

Scale model variable over [-1,1]; variable objects.

Inverse of dvariable boundp(const prevariable& x, double fmin, double fmax,const prevariable& _fpen, double s).

Parameters:
 x Model variable fmin Lower bound of x fmin Upper bound of x s Divide x by s before scaling and setting bounds
Returns:
Scaled model variable over [-1,1].

Definition at line 444 of file boundfun.cpp.

 double boundpin ( const prevariable & xx, double fmin, double fmax )

Scale model variable over [-1,1]; variable objects.

Parameters:
 x Model variable fmin Lower bound of x fmin Upper bound of x
Returns:
Scaled model variable over [-1,1].

Definition at line 457 of file boundfun.cpp.

 dvariable dfatan1 ( dvariable x, double fmin, double fmax, const prevariable & _fpen )

Scale input variable between upper and lower bounds and compute a penalty for exceeding the bounds.

Parameters:
 x Variable to be scaled fmin Lower bound of x fmin Upper bound of x _fpen On return, contains penalty if x > fmax or x < fmin
Returns:
Scaled value of x between fmin and fmax in the range [-1,1]

Definition at line 40 of file boundfun.cpp.

 dvariable dfboundp ( const prevariable & x, double fmin, double fmax )

Computes the derivative of dvariable boundp(const prevariable& x, double fmin, double fmax,const prevariable& _fpen)

Parameters:
 x Variable to be scaled fmin Lower bound of x fmin Upper bound of x
Returns:
Derivative of scaled variable

Definition at line 176 of file boundfun.cpp.

 double dftinv ( double x, double fmin, double fmax )

Inverse of dvariable dfatan1(dvariable x, double fmin, double fmax, const prevariable& _fpen)

Parameters:
 x Variable to be scaled fmin Lower bound of x fmin Upper bound of x

Definition at line 69 of file boundfun.cpp.

 double dmax ( double x, double y )

Returns the maximum of two numbers.

Parameters:
 x First number y Second number

Definition at line 519 of file boundfun.cpp.

 double dmin ( double x, double y )

Returns the minimum of two numbers.

Parameters:
 x First number y Second number

Definition at line 503 of file boundfun.cpp.

 double nd2fboundp ( double x, double fmin, double fmax, const double & fpen )

Scale input variable between upper and lower bounds and compute a penalty for exceeding the bounds.

Intended for use with df1b2 variables.

Parameters:
 x Variable to be scaled fmin Lower bound of x fmin Upper bound of x _fpen On return, contains penalty if x > fmax or x < fmin
Returns:
Scaled value of x between fmin and fmax in the range [-1,1]

Definition at line 288 of file boundfun.cpp.

 double ndfboundp ( double x, double fmin, double fmax, const double & fpen )

Derivatative code for double nd2fboundp( double x, double fmin, double fmax,const double& fpen)

Parameters:
 x Variable to be scaled fmin Lower bound of x fmin Upper bound of x fpen Unchanged on return.
Returns:
Derivative of scaled variable

Definition at line 216 of file boundfun.cpp.