Package gov.nih.mipav.model.algorithms
Class NESolve
java.lang.Object
gov.nih.mipav.model.algorithms.NESolve
- Direct Known Subclasses:
SchwarzChristoffelMapping2.stpfun3
This is a port of nesolve.m and supporting files coded in MATLAB by Richard T. Behrens in 1988
with portions replaced to be closer to original pseudocode in appendix A of
Numerical Methods for Unconstrained Optimization and Nonlinear Equations.
NESolve produces the solution to a system of nonlinear equations
For example, find the x, y, and z that solve the simultaneous equations:
sin(x) + y^2 + log(z) - 7 = 0
3*x + 2^y - z^3 + 1 = 0;
x + y + z - 5 = 0
nesolve.m coded in MATLAB by Ricaard T. Behrens, April 1988.
Revised 11/278/88 JNL
Hookstep option added 8/21/90 RTB.
Hello William,
Thank you for contacting MathWorks Technical Support. My name is Stephen and I am writing in reference to your
Technical Support Case #02445410 regarding 'Permission to port nesolve.m'.
Thank you for contacting us about this. It appears that "nesolve" is a File Exchange function that is not part
of the MATLAB code base. The author included parts of a MATLAB function help header, but none of its source code.
Therefore, we neither grant nor deny permission to copy the contents of that file as it does not pertain to
the MATLAB code base.
If you have any more related questions, let me know and I would be happy to help.
Sincerely,
Stephen Jue
MathWorks Technical Support Department
In a document with the title
NONLINPK
NESOLVE and UMSOLVE
Release 1.1, August 31, 1990
by Richard T. Behrens
He states:
The UMSOLVE files are distributed as Shareware (but NESOLVE is
public domain).
nesolve.m is based on Algorithm D6.1.3: Part of the modular software system from the
appendix of the book "Numerical Methods for Unconstrained Optimization and Nonlinear Equations"
by Dennis invalid input: '&' Schnabel, 1983. Refer to that book for more detailed information about the
algorithms.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate final intprotected double[]private final intprotected doubleprotected double[]private doubleprotected double[]private final intprotected double[]private final intprivate final intprotected booleanprotected intprivate final intintintprotected int[]private intprivate intprivate final intprivate final intprivate final intprotected double[][]intintprotected int[]private intprivate booleanprivate doubleprivate final intintprotected double[]protected double[] -
Constructor Summary
ConstructorsConstructorDescriptionNESolve()NESolve(boolean initialJacobianIdentity, double[] x0, double[] fparam, boolean analyticJacobian, double[][] scale, Vector<Double> path, double[] btrack, int trace, int method, int maxIterations, double fvectol, double steptol, double maxStepSize, double details11, int scaling) -
Method Summary
Modifier and TypeMethodDescriptionvoiddriver()private voidvoidprivate voidabstract voidfitToFunction(double[] fvplus, double[] xplus, double[] fparam) abstract voidfitToJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam) voidfitToTestFunction(double[] fvplus, double[] xplus, double[] fparam) voidfitToTestJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam) intdouble[]private voidnebroyuf(double[][] A, double[] xc, double[] xp, double[] fc, double[] fp, double[] sx, double eta) private voidnechdcmp(double[][] L, double[] maxadd, double[][] H, double maxoffl) private doubleneconest(double[][] M, double[] M2) private voidnefdjac(double[][] J, int[] nofun, double[] fc, double[] xc, double[] sx, double[] details, double[] fparam) private voidnefn(double[] fplus, double[] fvplus, int[] nofun, double[] xplus, double[] sf, double[] fparam) private voidnehook(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, double[] details, double[] trustvars, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[][] H, double[] sn, double[] sx, double[] sf, int itn, double[] fparam) private voidneinck(double[] dout, double[] sx, double[] sf, int[] termcode, double[] x0, double[] f0, double[] din, double[][] scale) private voidnelnsrch(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] nofun, double[] btrack, double[] xc, double fc, double[] g, double[] p, double[] sx, double[] sf, double[] details, double[] fparam) private voidnemodel(double[][] m, double[][] h, double[] sn, double[] fc, double[][] J, double[] g, double[] sf, double[] sx, double globmeth) private voidneqrdcmp(double[][] M, double[] M1, double[] M2, int[] sing) private voidneqrsolv(double[] b, double[][] M, double[] M1, double[] M2) private voidnersolv(double[] b, double[][] M, double[] M2) private voidnestop(int[] consecmax, int[] termcode, double[] xc, double[] xp, double[] F, double[] Fnorm, double[] g, double[] sx, double[] sf, int retcode, double[] details, int itncount, boolean maxtaken) private voidnetrust(double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] retcode, double[] xpprev, double[] fpprev, double[] Fpprev, double[] details, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[] s, double[] sx, double[] sf, boolean newttaken, int steptype, double[][] H, boolean umflag, double[] fparam) voidprintExitStatus(int exitStatus) private doubleshiftedChebyshev(double x, int n) private doubleshiftedChebyshevDerivative(double x, int n) private doublesign(double x)
-
Field Details
-
NO_SCALING
public int NO_SCALING -
SCALING_WITHOUT_SCALE
public int SCALING_WITHOUT_SCALE -
SCALING_WITH_SCALE
public int SCALING_WITH_SCALE -
LINE_SEARCH
public int LINE_SEARCH -
TRUST_REGION
public int TRUST_REGION -
x0
protected double[] x0 -
details
protected double[] details -
initialJacobianIdentity
protected boolean initialJacobianIdentity -
fparam
protected double[] fparam -
analyticJacobian
protected boolean analyticJacobian -
scale
protected double[][] scale -
xf
protected double[] xf -
fvc
protected double[] fvc -
chiSquared
protected double chiSquared -
termcode
protected int[] termcode -
path
-
btrack
protected double[] btrack -
nofun
protected int[] nofun -
itncount
protected int itncount -
eps
private double eps -
testMode
private boolean testMode -
testCase
private int testCase -
ROSENBROCK
private final int ROSENBROCK- See Also:
-
FREUDENSTEIN_AND_ROTH
private final int FREUDENSTEIN_AND_ROTH- See Also:
-
HELICAL_VALLEY
private final int HELICAL_VALLEY- See Also:
-
POWELL_SINGULAR
private final int POWELL_SINGULAR- See Also:
-
BROWN_ALMOST_LINEAR
private final int BROWN_ALMOST_LINEAR- See Also:
-
CHEBYQUAD
private final int CHEBYQUAD- See Also:
-
LEVMAR_ROSENBROCK
private final int LEVMAR_ROSENBROCK- See Also:
-
POWELL_2_PARAMETER
private final int POWELL_2_PARAMETER- See Also:
-
HOCK1
private final int HOCK1- See Also:
-
TRIGONOMETRIC
private final int TRIGONOMETRIC- See Also:
-
tol
private double tol -
param
private int param -
nPts
private int nPts
-
-
Constructor Details
-
NESolve
public NESolve() -
NESolve
-
-
Method Details
-
fitTestModel
private void fitTestModel() -
driverCalls
private void driverCalls() -
dumpTestResults
public void dumpTestResults() -
getParameters
public double[] getParameters() -
getExitStatus
public int getExitStatus() -
printExitStatus
public void printExitStatus(int exitStatus) -
fitToFunction
public abstract void fitToFunction(double[] fvplus, double[] xplus, double[] fparam) -
fitToTestFunction
public void fitToTestFunction(double[] fvplus, double[] xplus, double[] fparam) -
fitToJacobian
public abstract void fitToJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam) -
fitToTestJacobian
public void fitToTestJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam) -
shiftedChebyshev
private double shiftedChebyshev(double x, int n) -
shiftedChebyshevDerivative
private double shiftedChebyshevDerivative(double x, int n) -
driver
public void driver() -
nefn
private void nefn(double[] fplus, double[] fvplus, int[] nofun, double[] xplus, double[] sf, double[] fparam) -
neinck
private void neinck(double[] dout, double[] sx, double[] sf, int[] termcode, double[] x0, double[] f0, double[] din, double[][] scale) -
nefdjac
private void nefdjac(double[][] J, int[] nofun, double[] fc, double[] xc, double[] sx, double[] details, double[] fparam) -
sign
private double sign(double x) -
nemodel
private void nemodel(double[][] m, double[][] h, double[] sn, double[] fc, double[][] J, double[] g, double[] sf, double[] sx, double globmeth) -
neqrdcmp
private void neqrdcmp(double[][] M, double[] M1, double[] M2, int[] sing) -
neconest
private double neconest(double[][] M, double[] M2) -
nersolv
private void nersolv(double[] b, double[][] M, double[] M2) -
nechdcmp
private void nechdcmp(double[][] L, double[] maxadd, double[][] H, double maxoffl) -
neqrsolv
private void neqrsolv(double[] b, double[][] M, double[] M1, double[] M2) -
nelnsrch
private void nelnsrch(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] nofun, double[] btrack, double[] xc, double fc, double[] g, double[] p, double[] sx, double[] sf, double[] details, double[] fparam) -
nehook
private void nehook(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, double[] details, double[] trustvars, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[][] H, double[] sn, double[] sx, double[] sf, int itn, double[] fparam) -
netrust
private void netrust(double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] retcode, double[] xpprev, double[] fpprev, double[] Fpprev, double[] details, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[] s, double[] sx, double[] sf, boolean newttaken, int steptype, double[][] H, boolean umflag, double[] fparam) -
nebroyuf
private void nebroyuf(double[][] A, double[] xc, double[] xp, double[] fc, double[] fp, double[] sx, double eta) -
nestop
private void nestop(int[] consecmax, int[] termcode, double[] xc, double[] xp, double[] F, double[] Fnorm, double[] g, double[] sx, double[] sf, int retcode, double[] details, int itncount, boolean maxtaken)
-