Commit 3d0a0851 authored by gsell's avatar gsell
Browse files

cleanup beam envelope tracker: fixes

parent 5c45f4f3
......@@ -53,11 +53,11 @@ static double rootValue = 0.0;
// used in setLShape for Gaussian
static void erfRoot(double x, double *fn, double *df) {
double v = erfc(std::abs(x));
double v = std::erfc(std::abs(x));
double eps = 1.0e-05;
*fn = v - rootValue;
*df = (erfc(std::abs(x) + eps) - v) / eps;
*df = (std::erfc(std::abs(x) + eps) - v) / eps;
}
......
......@@ -282,8 +282,9 @@ double Profile::Leff() {
gsl_function F = { &f1, NULL};
gsl_integration_romberg_workspace* w = gsl_integration_romberg_alloc (30);
size_t neval = 0;
gsl_integration_romberg (&F, x[0], x[n-1] / ym, 1.0e-4, 1000, &result, &neval, w);
gsl_integration_romberg (&F, x[0], x[n-1], 1.0e-4, 1000, &result, &neval, w);
gsl_integration_romberg_free (w);
result /= ym;
}
return result;
}
......@@ -298,8 +299,9 @@ double Profile::Leff2() {
gsl_function F = {&f2, NULL};
gsl_integration_romberg_workspace* w = gsl_integration_romberg_alloc (30);
size_t neval = 0;
gsl_integration_romberg (&F, x[0], x[n-1] / ym, 1.0e-4, 1000, &result, &neval, w);
gsl_integration_romberg (&F, x[0], x[n-1], 1.0e-4, 1000, &result, &neval, w);
gsl_integration_romberg_free (w);
result /= ym;
}
return result;
}
......@@ -314,8 +316,9 @@ double Profile::Labs() {
gsl_function F = {&f3, NULL};
gsl_integration_romberg_workspace* w = gsl_integration_romberg_alloc (30);
size_t neval = 0;
gsl_integration_romberg (&F, x[0], x[n-1] / ym, 1.0e-4, 1000, &result, &neval, w);
gsl_integration_romberg (&F, x[0], x[n-1], 1.0e-4, 1000, &result, &neval, w);
gsl_integration_romberg_free (w);
result /= ym;
}
return result;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment