package com.dwave.math;
public final class StiffMethods {
private StiffMethods() {}
/**
* Fourth-order Rosenbrock step for integrating stiff o.d.e.'s, with monitoring of local
* truncation error to adjust stepsize. Input are the dependent variable vector y[1..n]
* and its derivative dydx[1..n] at the starting value of the independent varable
* x. Also input are the stepsize to be attempted htry, the required
* accuracy eps, and the vector yscal[1..n] against which
* the error is scaled. On output, y and x are replaced by their
* new values, hdid is the stepsize that was actually accomplished, and
* hnext is the estimated next stepsize. derivs is the
* user-supplied routine that computes the derivatives of the right-hand side with
* respect to x, while jacobn(a fixed name) is a user-supplied
* routine that computes the Jacobi matrix of derivatives of the right-hand side with respect
* to the components of y.
*/
public static void stiff() {
int MAXTRY = 40;
float SAFETY = 0.9F,
GROW = 1.5F,
PGROW = -0.25F,
SHRNK = 0.5F,
PSHRNK = -1F/3F,
ERRCON = 0.1296F,
gam = 1f/2f,
a21 = 2f,
a31 = 48f/25f,
a32 = 6f/25f,
c21 = -8f,
c31 = 12f/5f,
c41 = -112f/125f,
c42 = -54f/125f,
c43 = -2f/5f,
b1 = 19f/9f,
b2 = 1f/2f,
b3 = 25f/108f,
b4 = 125f/108f,
e1 = 17f/54f,
e2 = 7f/36f,
e3 = 0f,
e4 = 125f/108f,
c1x = 1f/2f,
c2x = -3f/2f,
c3x = 121f/50f,
c4x = 29f/250f,
a2x = 1f,
a3x = 3f/5f;
}
}