WallGo.helpers.nextStepDeton
- nextStepDeton(pos1, pos2, pressure1, pressure2, mean2ndDeriv, std2ndDeriv, pressureTol, posMax, overshootProb=0.05)[source]
Function used in
EOMto find detonation solutions. It finds the next point to be sampled to try to bracket a root in such a way that the probability of overshooting a root is roughly equal to overshootProb.To estimate the overshoot probability, it fits the pressure to a quadratic which is equal to
pressure2at :py:data`pos2`, but with uncertain 1st and 2nd derivatives which are assumed to be normally distributed. The mean of the 1st derivative is computed by finite differences from the last 2 points.- Parameters:
pos1 (float) – Position of the first sampled point.
pos2 (float) – position of the second sampled point.
pressure1 (float) – Pressure at pos1.
pressure2 (float) – Pressure at pos2.
mean2ndDeriv (float) – Estimate of the 2nd derivative at pos2.
std2ndDeriv (float) – Uncertainty on the 2nd derivative at pos2.
pressureTol (float) – Relative accuracy at which pressure1 and pressure2 are computed.
posMax (float) – Maximal position that the next step can have.
overshootProb (float, optional) – Desired overshoot probability. A smaller value will lead to smaller step sizes which will take longer to evaluate, but with less chances of missing a root. The default is 0.05.
- Returns:
Position where the overshoot probability is overshootProb (or posMax if there is no solution).
- Return type:
float