lambda2alpha.h

The combustion problem – inversion of the parameter function

#include "lambda_c.h"
Float lambda2alpha (Float lambda, bool up = false) {
static const Float ac = alpha_c();
Float tol = 1e2*numeric_limits<Float>::epsilon();
size_t max_iter = 1000;
Float a_min = up ? ac : 0;
Float a_max = up ? 100 : ac;
for (size_t k = 0; abs(a_max - a_min) > tol; ++k) {
Float a1 = (a_max + a_min)/2;
Float lambda1 = 8*sqr(a1/cosh(a1));
if ((up && lambda > lambda1) || (!up && lambda < lambda1))
{ a_max = a1; }
else { a_min = a1; }
check_macro (k < max_iter, "lambda2alpha: max_iter=" << k
<< " reached and err=" << a_max - a_min);
}
return(a_max + a_min)/2;
};
Float
see the Float page for the full documentation
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
lambda2alpha
Float lambda2alpha(Float lambda, bool up=false)
Definition: lambda2alpha.h:26
lambda_c.h
The combustion problem – the critical parameter value as a function.
alpha_c
Float alpha_c()
Definition: lambda_c.h:36
lambda
Definition: yield_slip_circle.h:34
epsilon
Float epsilon
Definition: transmission_error.cc:25