BubbleProfiler  0.3.0
by Peter Athron, Csaba Balazs, Michael Bardsley, Andrew Fowlie, Dylan Harries & Graham White
shooting.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of BubbleProfiler.
3  *
4  * BubbleProfiler is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * BubbleProfiler is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with BubbleProfiler. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef BUBBLEPROFILER_SHOOTING_HPP_INCLUDED
19 #define BUBBLEPROFILER_SHOOTING_HPP_INCLUDED
20 
32 #include "field_profiles.hpp"
33 
34 #include <boost/array.hpp>
35 #include <boost/numeric/odeint.hpp>
36 
37 #include <functional>
38 
39 namespace BubbleProfiler {
40 
41 class Potential;
42 
44 class Shooting {
45 public:
46  enum Solver_options : unsigned int {
49  };
50 
54  void set_action_arrived_rel(double tol) { action_arrived_rel = tol; }
56  void set_shooting_abs_tol(double tol) { shoot_ode_abs = tol; }
58  void set_shooting_rel_tol(double tol) { shoot_ode_rel = tol; }
60  void set_action_abs_tol(double tol) { action_ode_abs = tol; }
62  void set_action_rel_tol(double tol) { action_ode_rel = tol; }
64  void set_drho_frac(double frac) { drho_frac = frac; }
72  void set_evolve_change_rel(double frac) { evolve_change_rel = frac; }
74  void set_bisect_lambda_max(double l) { bisect_lambda_max = l; }
76  void set_max_iterations(int i) { iter_max = i; }
78  void set_max_periods(double p) { periods_max = p; }
80  void set_f_y_max(double f) { f_y_max = f; }
82  void set_f_y_min(double f) { f_y_min = f; }
84  void set_y_max(double y) { y_max = y; }
89  void solve(const std::function<double(double)>& potential_,
90  const std::function<double(double)>& potential_first_,
91  const std::function<double(double)>& potential_second_,
92  double false_min_, double true_min_, double barrier_,
93  int dim_ = 3,
94  unsigned int options = (Solver_options::Compute_action |
95  Solver_options::Compute_profile));
100  void solve(const Potential& potential, double false_min_,
101  double true_min_, double barrier_, int dim_ = 3,
102  unsigned int options = (Solver_options::Compute_action |
103  Solver_options::Compute_profile));
104 
106  const Field_profiles& get_bubble_profile() const;
108  double get_euclidean_action() const;
109 
111  double quadratic_potential_solution(double) const;
113  double quadratic_potential_solution(double, double) const;
114 
115 private:
116  using evolve_type = boost::array<double, 3>;
117  using state_type = boost::array<double, 2>;
118  using error_stepper_type =
119  boost::numeric::odeint::runge_kutta_dopri5<state_type>;
121  boost::numeric::odeint::controlled_runge_kutta<error_stepper_type>;
122 
124  int dim{3};
125 
127  double lambda_sol{0.};
129  double euclidean_action{0.};
131  bool action_computed{false};
132  bool profile_computed{false};
133 
134  // ODE steppers
137 
139  double drho_guess{0.};
141  double scale{0.};
142 
144  double barrier{0.};
146  double false_min{0.};
148  double true_min{1.};
150  double sign_min{1.};
152  double p_barrier{0.};
154  double p_false_min{0.};
156  double p_true_min{0.};
157 
159  std::function<double(double)> potential{nullptr};
161  std::function<double(double)> potential_first{nullptr};
163  std::function<double(double)> potential_second{nullptr};
164 
165  // Tolerances and integration method settings
167  double action_arrived_rel{1.e-3};
168  double shoot_ode_abs{1.e-4};
169  double shoot_ode_rel{1.e-4};
170  double action_ode_abs{1.e-6};
171  double action_ode_rel{1.e-6};
172  double drho_frac{1.e-3};
173  double evolve_change_rel{1.e-2};
174  double bisect_lambda_max{5.};
175  int iter_max{100000};
176  double periods_max{1.e2};
177  double f_y_max{1.e6};
178  double f_y_min{1.e-3};
179  double y_max{1.e1};
180 
182  const std::function<double(double)>& potential_,
183  const std::function<double(double)>& potential_first_,
184  const std::function<double(double)>& potential_second_,
185  double false_min_, double true_min_, double barrier_, int dim_);
186 
203  void ode(const state_type &x, state_type &dxdt, double rho);
213  double calculate_roll_time(double lambda, double dVdphi,
214  double d2Vdphi2) const;
224  double calculate_roll_velocity(double lambda, double y,
225  double dVdphi, double d2Vdphi2) const;
243  evolve_type evolve(double lambda) const;
253  double bubble_scale() const;
254 
256  double energy(double phi, double dot_phi) const;
257 
267  double shoot(double lambda);
268 
270  double unmap(double lambda) const;
271 
280  double shooting();
281 
302  double integrand(double dot_phi, double rho) const;
303 
305  double action(double lambda);
306 
308  double interior(double lambda);
309 
312 };
313 
314 } // namespace BubbleProfiler
315 
316 #endif // BUBBLEPROFILER_SHOOTING_HPP_INCLUDED
contains the definition of the Field_profiles clas
Field_profiles profiles
Definition: shooting.hpp:130
void set_shooting_rel_tol(double tol)
Definition: shooting.hpp:58
void set_max_iterations(int i)
Definition: shooting.hpp:76
evolve_type evolve(double lambda) const
Uses an approximation solution to evolve the system forward until the field changes by a required amo...
Definition: shooting.cpp:251
boost::array< double, 2 > state_type
Definition: shooting.hpp:117
void solve(const std::function< double(double)> &potential_, const std::function< double(double)> &potential_first_, const std::function< double(double)> &potential_second_, double false_min_, double true_min_, double barrier_, int dim_=3, unsigned int options=(Solver_options::Compute_action|Solver_options::Compute_profile))
Definition: shooting.cpp:81
double calculate_roll_velocity(double lambda, double y, double dVdphi, double d2Vdphi2) const
Find velocity .
Definition: shooting.cpp:200
boost::numeric::odeint::runge_kutta_dopri5< state_type > error_stepper_type
Definition: shooting.hpp:119
void set_bisect_lambda_max(double l)
Definition: shooting.hpp:74
controlled_stepper_type action_stepper
Definition: shooting.hpp:136
const Field_profiles & get_bubble_profile() const
Definition: shooting.cpp:48
Field_profiles calculate_bubble_profile(double lambda)
Definition: shooting.cpp:490
double get_euclidean_action() const
Definition: shooting.cpp:40
double interior(double lambda)
Definition: shooting.cpp:616
void set_f_y_max(double f)
Definition: shooting.hpp:80
double quadratic_potential_solution(double) const
Definition: shooting.cpp:572
double shooting()
Solve for by bisection.
Definition: shooting.cpp:380
double calculate_roll_time(double lambda, double dVdphi, double d2Vdphi2) const
Find the (dimensionless) time at which the field changes by a small amount, .
Definition: shooting.cpp:164
void set_action_rel_tol(double tol)
Definition: shooting.hpp:62
std::function< double(double)> potential_first
Definition: shooting.hpp:161
double bubble_scale() const
Characteristic scale of bubble.
Definition: shooting.cpp:277
boost::array< double, 3 > evolve_type
Definition: shooting.hpp:116
double action(double lambda)
Definition: shooting.cpp:414
void set_f_y_min(double f)
Definition: shooting.hpp:82
void initialize_potential_parameters(const std::function< double(double)> &potential_, const std::function< double(double)> &potential_first_, const std::function< double(double)> &potential_second_, double false_min_, double true_min_, double barrier_, int dim_)
Definition: shooting.cpp:56
void set_evolve_change_rel(double frac)
Definition: shooting.hpp:72
std::function< double(double)> potential_second
Definition: shooting.hpp:163
void ode(const state_type &x, state_type &dxdt, double rho)
ODE for bounce solution.
Definition: shooting.cpp:158
void set_action_arrived_rel(double tol)
Definition: shooting.hpp:54
double shoot(double lambda)
Performs a single shot of our shooting method.
Definition: shooting.cpp:288
void set_action_abs_tol(double tol)
Definition: shooting.hpp:60
void set_max_periods(double p)
Definition: shooting.hpp:78
void set_drho_frac(double frac)
Definition: shooting.hpp:64
double integrand(double dot_phi, double rho) const
Action integrand from kinetic term without pre-factor.
Definition: shooting.cpp:409
void set_y_max(double y)
Definition: shooting.hpp:84
Solve the one-dimensional problem using the shooting method.
Definition: shooting.hpp:44
double energy(double phi, double dot_phi) const
Definition: shooting.cpp:283
double unmap(double lambda) const
Definition: shooting.cpp:375
std::function< double(double)> potential
Definition: shooting.hpp:159
Abstract base class for a generic potential.
Definition: potential.hpp:36
boost::numeric::odeint::controlled_runge_kutta< error_stepper_type > controlled_stepper_type
Definition: shooting.hpp:121
void set_shooting_abs_tol(double tol)
Definition: shooting.hpp:56
void set_bisection_precision_bits(int b)
Definition: shooting.hpp:52
Discretized set of field profiles.
controlled_stepper_type shoot_stepper
Definition: shooting.hpp:135