Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added testing for the O(4) symmetric potentials. #144

Merged
merged 22 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4785a1e
Implemented Dilogarithm/Spencer's funtion and unit tests for it.
vollous May 7, 2024
8b40f91
Espinosa-Konstandin - Example A
vollous May 8, 2024
7f0d060
Espinosa-Konstandin - Example B
vollous May 8, 2024
26cab49
Correct typo
vollous May 8, 2024
5e9d06d
Fix wrong sign in numerical derivative of analytical solution when d2…
vollous May 13, 2024
3e0eb4c
Fix recursive step that assumed l0 = 0.
vollous May 13, 2024
4cd0e49
Protect against infinite recursion in "BounceActionInt::ExactSolution…
vollous May 13, 2024
1173018
Espinosa-Konstandin - Example D
vollous May 13, 2024
fabf242
Include "gsl_sf_expint" in tests
vollous May 13, 2024
673d57c
Espinosa-Konstandin - Example C
vollous May 13, 2024
7c623a9
Espinosa-Konstandin - Example E
vollous May 13, 2024
14cea54
Espinosa-Konstandin - Example 2D
vollous May 14, 2024
eac7562
Espinosa-Konstandin - Example 3D
vollous May 15, 2024
c343168
Delete test.txt (#142)
phbasler May 7, 2024
ade858f
Conan use default profile (#140)
vollous May 10, 2024
6b73e37
Add GSL to CmakeLists.txt of GenericTests
vollous May 15, 2024
a9e2a92
Add GSL to CMakeLists.txt of utility
vollous May 15, 2024
b0bad0a
Merge branch 'master' into Espinosa-Konstandin-testing
phbasler May 15, 2024
d73cea7
Merge branch 'master' into Espinosa-Konstandin-testing
phbasler May 16, 2024
d57b7bf
Changed "Li2()", instead of sum starting with sum=1e-100 and k = 1, i…
vollous May 17, 2024
944b9fa
Impose threshold instead of relying on numerical precision errors for…
vollous May 17, 2024
daaffa3
Update minor version
May 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/bounce_solution/action_calculation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,14 @@
ss << rho_up << "\t" << l << "\t" << dVdl << "\t" << d2Vdl2 << "\n";
BSMPT::Logger::Write(BSMPT::LoggingLevel::BounceDetailed, ss.str());
ss.str(std::string());
if (l0 == l0 + (l - l0) / 10.)
if (abs((l - l0) / Spline.L) < 1e-10)
phbasler marked this conversation as resolved.
Show resolved Hide resolved
{
// Maximum numerical precision reached.
StateOfBounceActionInt = ActionStatus::Integration1DFailed;

Check warning on line 480 in src/bounce_solution/action_calculation.cpp

View check run for this annotation

Codecov / codecov/patch

src/bounce_solution/action_calculation.cpp#L480

Added line #L480 was not covered by tests
// Abort calculation
return {0, 0, 0};

Check warning on line 482 in src/bounce_solution/action_calculation.cpp

View check run for this annotation

Codecov / codecov/patch

src/bounce_solution/action_calculation.cpp#L482

Added line #L482 was not covered by tests
}
return (ExactSolutionLin(l0, l0 + (l - l0) / 10., dVdl, d2Vdl2));

Check warning on line 484 in src/bounce_solution/action_calculation.cpp

View check run for this annotation

Codecov / codecov/patch

src/bounce_solution/action_calculation.cpp#L484

Added line #L484 was not covered by tests
}
}
else
Expand Down Expand Up @@ -585,8 +585,12 @@
if (not ExactSolutionThreshold.has_value())
return ExactSolutionLin(l0, l, dVdl, d2Vdl2);

if (dVdl <= -1e-3)
if (dVdl <= 0)
{
// Assume negative grad is numerical error if close to the true minimum
if (l0_minus_lmin / Spline.L < 1e-2) return ExactSolutionFromMinimum(l);
// If we are not close to the minimum then probably l0 in not a solution as
// it will roll backwards
ss << " \n l = " << l0 << std::endl;
ss << " dVdl = " << dVdl << std::endl;
ss << " d2Vd2l = " << d2Vdl2 << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions src/utility/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ double Li2(const double &x)
if (x < -1) return -pow(M_PI, 2) / 6. - pow(log(-x), 2) / 2. - Li2(1. / x);
if (x < 0) return 1 / 2. * Li2(-x * -x) - Li2(-x);
if (x > 0.5) return pow(M_PI, 2) / 6. - log(x) * log(1 - x) - Li2(1 - x);
double sum = 1e-100;
for (int k = 1; k <= 1e5; k++)
double sum = x; // k = 1 element of the sum
for (int k = 2; k <= 1e5; k++) // Sum starts at k = 2
{
if (abs((pow(x, k) / pow(k, 2.)) / sum) < 1e-10)
{
Expand Down