meshi.optimizers
Class SteepestDecent
java.lang.Object
meshi.optimizers.Optimizer
meshi.optimizers.Minimizer
meshi.optimizers.SteepestDecent
public class SteepestDecent
- extends Minimizer
This class implements a simple steepest descent minimizer, using a simple back tracking line search.
The search direction is given by the gradient of the energy function, at the minimizer position.
The step length first tried is the previous iteration step length, multiplied by some expansion factor.
If it leads to energy reduction it is choosen, otherwise it is shortened by some factor and tried again. This repeats
until energy reduction is achieved.
To run this minimizer:
a) Instantiate this class with the desired minimization parameters.
b) Put the initial coordinates in the 'coordinates' variable at the 'energy' class.
c) Activate SteepestDecent.run().
d) Check for thrown errors to see if the minimization succeeded.
e) The minimized position is in the 'coordinates' variable at the 'energy' class.
Parameters in the full constructor:
----------------------------------
- energy - pointer to a TotalEnergy object, where the energy function is.
- tolerance - Minimization stops when the magnitude of the maximal gradient component drops below tolerance.
- maxIteration - The maximal number of iteration steps allowed
- reoprtEvery - The frequency of the minimization reports.
- initialStepLength - parameter of the line search. The first step length to be tried after the calculation of the
first gradient. This parameter should normally be 1 unless very large gradients (such as clashhing
of VDW atoms) are expected in the first steps. In that case it should be a much smaller number.
- stepSizeReduction - parameter of the line search. The step length is multiplied by this factor if no reduction
in energy is achieved.
- stepSizeExpansion - parameter of the line search. The first step length tried is the step length from previous
line search multiplied by this factor. (Note that non-positive values to this paramater cause
special options to be called (see the SimpleStepLength class help).
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
lineSearch
private SimpleStepLength lineSearch
coordinates
private double[][] coordinates
bufferCoordinates
private double[][] bufferCoordinates
iterationNum
private int iterationNum
lastStepLength
private double lastStepLength
magnitudeForce
private double magnitudeForce
DEFAULT_TOLERANCE
private static final double DEFAULT_TOLERANCE
- See Also:
- Constant Field Values
DEFAULT_MAX_ITERATION
private static final int DEFAULT_MAX_ITERATION
- See Also:
- Constant Field Values
DEFAULT_REPORT_EVERY
private static final int DEFAULT_REPORT_EVERY
- See Also:
- Constant Field Values
reportEvery
private int reportEvery
DEFAULT_INITIAL_STEP_LENGTH
private static final double DEFAULT_INITIAL_STEP_LENGTH
- See Also:
- Constant Field Values
DEFAULT_STEP_SIZE_REDUCTION
private static final double DEFAULT_STEP_SIZE_REDUCTION
- See Also:
- Constant Field Values
DEFAULT_STEP_SIZE_EXPENTION
private static final double DEFAULT_STEP_SIZE_EXPENTION
- See Also:
- Constant Field Values
initialStepLength
private double initialStepLength
stepSizeReduction
private double stepSizeReduction
stepSizeExpansion
private double stepSizeExpansion
SteepestDecent
public SteepestDecent(TotalEnergy energy,
double tolerance,
int maxSteps,
int reportEvery,
double initialStepLength,
double stepSizeReduction,
double stepSizeExpansion)
SteepestDecent
public SteepestDecent(TotalEnergy energy,
double tolerance,
int maxSteps,
int reportEvery)
SteepestDecent
public SteepestDecent(TotalEnergy energy)
init
protected void init()
throws OptimizerException
- Specified by:
init in class Minimizer
- Throws:
OptimizerException
minimizationStep
protected boolean minimizationStep()
throws OptimizerException
- Specified by:
minimizationStep in class Minimizer
- Throws:
OptimizerException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
lastStepLength
public double lastStepLength()
kickStart
protected void kickStart()
throws OptimizerException
- Specified by:
kickStart in class Minimizer
- Throws:
OptimizerException