class AlgebraicLoopDirector.Homotopy extends AlgebraicLoopDirector.AlgebraicLoopSolver
Modifier and Type | Field and Description |
---|---|
protected double |
_acfac
Acceleration factor for step length control
|
protected double |
_angmax
Maximal angle
|
protected double[][] |
_b
Matrix b used in Newton algorithm.
|
protected double |
_c1
Value c1 used in Newton algorithm.
|
protected double |
_c2
Value c2 used in Newton algorithm.
|
protected double |
_cdmax
Maximum for condition estimate
|
protected double |
_ctmax
Maximum contraction rate in corrector step, 0 < ctmax < 1.
|
protected double[] |
_deltaX
Step size for finite difference approximation
|
protected double |
_dmax
Maximal norm for H
|
protected double |
_dmin
Minimal norm for H
|
protected double |
_h
Initial step size
|
protected double |
_hmax
Maximal step size
|
protected double |
_hmin
Minimal step size
|
protected double |
_hmn
Minimal Newton step size
|
protected int |
_n1
Number of independent variables including the homotopy factor
|
protected double[][] |
_q
Matrix q used in Newton algorithm.
|
protected double[] |
_r
Result of Newton step
|
protected double[] |
_t
Tangent vector to homotopy curve.
|
protected boolean |
_test
Test for step length in Newton algorithm
|
protected double[] |
_xIni
Initial guess
|
protected double[] |
_y
Current guess of solution
|
_converged, _iterationCount, _maxIterations, _tolerance, _variableNames
Constructor and Description |
---|
Homotopy(java.lang.String[] variableNames,
double[] tolerance,
int maxIterations)
Construct an algebraic loop solver.
|
Modifier and Type | Method and Description |
---|---|
(package private) double |
_decomp()
Conduct a QR decomposition.
|
protected double |
_getOrientation()
Return the direction in which the curve will be traversed.
|
(package private) void |
_givens(int l1,
int l2,
int l3)
Perform a Givens rotation.
|
(package private) double[][] |
_jac(double[] x,
double h)
Evaluate the transpose of the Jacobian of H(x, lambda) = x - lambda F(x)
by using forward differences.
|
protected double |
_l2norm(double[] x)
Return the L2 norm.
|
(package private) double[] |
_map(double[] x)
Compute y = H(x), where H(x)=0 is curve to be traced.
|
protected void |
_newton(double[] u,
double[] v,
double[] w)
Conduct a Newton step.
|
protected void |
_updateQB(double[] w,
double angmax)
Update _q and _b arrays.
|
void |
solve(double[] xIni)
This method solves u - lambda F(u) = 0
with initial values u=0 and lambda=0.
|
_didConverge, converged, getIterationCount
protected double _ctmax
protected double _dmax
protected double _dmin
protected double _hmax
protected double _hmin
protected double _hmn
protected double _h
protected int _n1
protected double _cdmax
protected double _angmax
protected double _acfac
protected double[][] _b
protected double[][] _q
protected double[] _t
protected double[] _r
protected double[] _xIni
protected double[] _y
protected boolean _test
protected double _c1
protected double _c2
protected double[] _deltaX
public Homotopy(java.lang.String[] variableNames, double[] tolerance, int maxIterations) throws IllegalActionException
variableNames
- Names of each break variable.tolerance
- Tolerance for each variable.maxIterations
- Maximum number of iterations.IllegalActionException
public void solve(double[] xIni) throws IllegalActionException
solve
in class AlgebraicLoopDirector.AlgebraicLoopSolver
xIni
- Array with the initial values of the variables, which will be replaced
by this method with the obtained solution.IllegalActionException
- If the prefire() method
returns false having previously returned true in the same
iteration, or if the prefire() or fire() method of the actor
throws it, or if evaluating the function yields a value that
is not a double, or if the solver fails to find a solution.double[][] _jac(double[] x, double h) throws IllegalActionException
x
- Point at which the Jacobian is approximated.h
- Step size.IllegalActionException
- If the prefire() method
returns false having previously returned true in the same
iteration, or if the prefire() or fire() method of the actor
throws it, or if evaluating the function yields a value that
is not a double.double[] _map(double[] x) throws IllegalActionException
x
- Independent variable where the last element is the homotopy factor.IllegalActionException
- If the prefire() method
returns false having previously returned true in the same
iteration, or if the prefire() or fire() method of the actor
throws it, or if evaluating the function yields a value that
is not a double.protected double _getOrientation()
void _givens(int l1, int l2, int l3)
l1
- Coordinate to be acted upon.l2
- Coordinate to be acted upon.l3
- Coordinate to be acted upon.double _decomp()
protected void _newton(double[] u, double[] v, double[] w) throws IllegalActionException
u
- w
- This argument is changed by this function.IllegalActionException
- If the prefire() method
returns false having previously returned true in the same
iteration, or if the prefire() or fire() method of the actor
throws it, or if evaluating the function yields a value that
is not a double.protected void _updateQB(double[] w, double angmax)
protected double _l2norm(double[] x)
x
- Argument for which norm is returned.