a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
FindAction Class Reference

FindAction. More...

#include <Metastability.h>

+ Inheritance diagram for FindAction:

Detailed Description

FindAction.

Definition at line 22 of file Metastability.h.

Public Member Functions

double computeThValue ()
 
 FindAction (const StandardModel &SM_i)
 FindAction constructor. More...
 
gslpp::vector< double > rkqs (double y01, double y02, double dydr0, double r0, double dr, double epsfrac[2], double epsabs[2])
 
 ~FindAction ()
 FindAction destructor. More...
 
- Public Member Functions inherited from ThObservable
double getBinMax ()
 A get method to get the maximum value of the bin. More...
 
double getBinMin ()
 A get method to get the minimum value of the bin. More...
 
const StandardModelgetModel ()
 A get method to get the model. More...
 
const std::vector< std::string > getParametersForObservable ()
 A get method to get the parameters for the specific observable. More...
 
void setBinMax (double max)
 A set method to set the maximum value of the bin. More...
 
void setBinMin (double min)
 A set method to set the minimum value of the bin. More...
 
void setParametersForObservable (std::vector< std::string > parametersForObservable_i)
 A set method to get the parameters for the specific observable. More...
 
 ThObservable (const StandardModel &SM_i)
 Constructor. More...
 
 ThObservable (const ThObservable &orig)
 The copy constructor. More...
 
virtual ~ThObservable ()
 The default destructor. More...
 

Public Attributes

double d2Vpar
 
double delta_phi_cutoffpar
 
double dVpar
 
double phi0par
 
gslpp::vector< double > potentialcoefficientspar
 
double rpar
 
double x1par
 
double x2par
 
double x3par
 

Protected Attributes

SUSYScalarPotentialmySUSYScalarPotential
 
- Protected Attributes inherited from ThObservable
double max
 the bin maximum. More...
 
double min
 The bin minimum. More...
 
std::vector< std::string > parametersForObservable
 a vector of parameter namesfor the specific observable More...
 
const StandardModelSM
 A reference to an object of StandardMode class. More...
 

Private Member Functions

template<class F >
gsl_function convertToGslFunctionS (const F &f)
 
double deformedV (double phi)
 
gslpp::vector< double > dY (double y1, double y2, double r)
 
int dYfunc (double r, const double y[], double ODE[], void *flags)
 
int dYJac (double r, const double y[], double *dfdy, double dfdt[], void *order)
 
gslpp::vector< double > ExactSolution (double r, double phi0, double dV, double d2V)
 
double fPS (double x)
 
double func (double rpar)
 
gslpp::vector< double > InitialConditions (double delta_phi0, double rmin, double delta_phi_cutoff, double distance, double dV_at_delta_phi0, double d2V_at_phi0)
 
gslpp::vector< double > integrateProfile (double r0, double y01, double y02, double dr0, double epsfrac[2], double epsabs[2], double drmin, double rmax, double distance)
 
double invertedpotential (double x)
 
double Simpsonintegrand (double r, double phi, double dphi, double VphiMin_i)
 

Static Private Member Functions

template<class F >
static double gslFunctionAdapterS (double x, void *p)
 

Private Attributes

const SUSYmySUSY
 

Constructor & Destructor Documentation

◆ FindAction()

FindAction::FindAction ( const StandardModel SM_i)

FindAction constructor.

Definition at line 18 of file Metastability.cpp.

18  :
19  ThObservable(SM_i),
21  mySUSY(static_cast<const SUSY&> (SM_i))
22 {
24 }

◆ ~FindAction()

FindAction::~FindAction ( )

FindAction destructor.

Definition at line 26 of file Metastability.cpp.

27 {
28  delete mySUSYScalarPotential;
29 }

Member Function Documentation

◆ computeThValue()

double FindAction::computeThValue ( )
virtual
Returns
\(FindAction\)

Implements ThObservable.

Definition at line 31 of file Metastability.cpp.

32 {
33 
34  /* 1. Definition of all potential minima */
35 
36  // define scalar potential
38 
39  double Vmin0=mySUSYScalarPotential->potential(potentialcoefficients, 0.0, 0.0, 0.0);
40 
41 // std::cout << "Vmin0 = " << Vmin0 << std::endl;
42 
43  gslpp::vector<double> dV0=mySUSYScalarPotential->potentialderivative(potentialcoefficients, 0.0, 0.0, 0.0);
44 
45 // std::cout << "dV0 = " << dV0 << std::endl;
46 
47  // calculate all minima (Ayan)
48  // calculate V and dV at origin (V0 and dV0)
49  // check whether there is a charge-breaking minimum very close to the origin
50 // double S_0=0.0;
51  gslpp::vector<double> S(10,0.);
52  //define toy minima (remove this as soon as the true minimum finder is available)
53  gslpp::vector<double> minimavector(3,0.);
54  minimavector(0)=-807192.888;
55  minimavector(1)=807260.056;
56  minimavector(2)=-803413.309;
57 // minimavector(3)=4.0;
58 // minimavector(4)=5.0;
59 // minimavector(5)=6.0;
60 // minimavector(6)=7.0;
61 // minimavector(7)=8.0;
62 // minimavector(8)=9.0;
63  //if mod3 length of minima is not zero, throw error
64  int lengthofminima=3;
65  int NofMinima=lengthofminima/3;
66 
67  gslpp::vector<double> deeperminima(lengthofminima+NofMinima,0.), dV(3,0.);
68 // gslpp::vector<double> deeperminima(3,0.), dV(3,0.);
69  int i,n=0;
70  double x1, x2, x3, Vmin;
71 
72  for(i=0;i<NofMinima;i++)
73  {
74  x1=minimavector(3*i);
75  x2=minimavector(3*i+1);
76  x3=minimavector(3*i+2);
77  Vmin=mySUSYScalarPotential->potential(potentialcoefficients, x1, x2, x3);
78  std::cout << "Vmin = " << Vmin << std::endl;
79  if(Vmin>=Vmin0)
80  {
81  continue;
82  }
83  else
84  {
85  deeperminima(4*n)=minimavector(3*i);
86  deeperminima(4*n+1)=minimavector(3*i+1);
87  deeperminima(4*n+2)=minimavector(3*i+2);
88  deeperminima(4*n+3)=Vmin;
89  n++;
90  }
91  }
92 
93  std::cout << "2." << std::endl;
94 
95  /* 2. Calculation of the tunneling rate for each of the minima */
96 
97 // gslpp::vector<double> path;
98  //n is now the number of deeper minima
99  for(i=0;i<n;i++)
100  {
101  x1=deeperminima(4*i);
102  x2=deeperminima(4*i+1);
103  x3=deeperminima(4*i+2);
104  Vmin=deeperminima(4*i+3);
105  dV=mySUSYScalarPotential->potentialderivative(potentialcoefficients, x1, x2, x3);
106 // path=splinepath(x1,x2,x3,Vmin0,dV0,Vmin,dV);
107  //the following function is supposed to find the cubic spline of the potential along a straight line from one to the other minimum
108  int steps=100;
109  gslpp::vector<double> linearpath(steps,0.);
110  gslpp::vector<double> V(steps,0.);
111 // gslpp::vector<double> spath(steps,0.);
112  //maybe the following will not work in extreme cases
113  double distance=x1*x1+x2*x2+x3*x3;
114  double stepsize=distance/double(steps-1);
115  int k;
116  for(k=0;k<steps;k++)
117  {
118  linearpath(k)=stepsize*k;
119  V(k)=mySUSYScalarPotential->potential(potentialcoefficients, x1*linearpath(k), x2*linearpath(k), x3*linearpath(k));
120 // gsl_interp_accel *acc
121 // = gsl_interp_accel_alloc ();
122 // gsl_spline *spline
123 // = gsl_spline_alloc (gsl_interp_cspline, 10);
124 //
125 // gsl_spline_init (spline, x, y, 10);
126 //
127 // for (xi = x[0]; xi < x[9]; xi += 0.01)
128 // {
129 // yi = gsl_spline_eval (spline, xi, acc);
130 // printf ("%g %g\n", xi, yi);
131 // }
132 // gsl_spline_free (spline);
133 // gsl_interp_accel_free (acc);
134 
135  }
136 
137 
138  /* 2.1 Calculation of the tunneling rate along the undeformed (straight) path */
139 
140  std::cout << "2.1.1" << std::endl;
141 
142 // double xmin = 0.001;
143 // double xmax = std::numeric_limits<double>::infinity();
144 
145  /* 2.1.1 Finding the edge of the tunneling barrier */
146 
147  double min = 1.0e-12;
148  double pos1=0.0; //relative position of the metastable minimum
149  double pos2=1.0; //relative position of the stable minimum
150  double pos = 0.5; //relative position between metastable and stable minimum (first guess)
151  while(fabs(pos1-pos2) > min)
152  {
153  double Vpos = mySUSYScalarPotential->potential(potentialcoefficients, pos*x1, pos*x2, pos*x3);
154  if(Vpos > 0.0) //maybe this should be ">"
155  {
156  pos1 = pos;
157  }
158  else
159  {
160  pos2 = pos;
161  }
162  pos = 0.5*(pos1+pos2);
163  }
164  //pos is now the edge of the barrier
165 
166  /* 2.1.2 Finding the typical scale of the barrier (using gsl 1D minimization) */
167 
168  std::cout << "2.1.2" << std::endl;
169 
170  int status;
171  int iter = 0, max_iter = 100;
172  const gsl_min_fminimizer_type *T;
173  gsl_min_fminimizer *s;
174  double m=0.5*pos;
175  double a=0.0, b=pos;
176  std::cout << "pos =" << pos << std::endl;
177  potentialcoefficientspar=potentialcoefficients;
178  x1par=x1;
179  x2par=x2;
180  x3par=x3;
181  gsl_function F = convertToGslFunctionS(boost::bind(&FindAction::invertedpotential, &(*this), _1));
182 // F.function = -&invertedpotential; //pointer?
183  T = gsl_min_fminimizer_brent;
184  s = gsl_min_fminimizer_alloc(T);
185  gsl_min_fminimizer_set(s, &F, m, a, b);
186  do
187  {
188  iter++;
189  status = gsl_min_fminimizer_iterate(s);
190  m = gsl_min_fminimizer_x_minimum(s);
191  std::cout << "m =" << m << std::endl;
192  a = gsl_min_fminimizer_x_lower(s);
193  b = gsl_min_fminimizer_x_upper(s);
194  status = gsl_min_test_interval(a, b, 0.0, 1.0e-3);
195  } while(status == GSL_CONTINUE && iter<max_iter);
196  gsl_min_fminimizer_free(s);
197  double barriertop=m;
198  if(barriertop<=0.0 || barriertop>=pos)
199  {
200  throw std::runtime_error("Error in Metastability.cpp: Potential barrier top outside the barrier range!");
201  }
202  double barrierheight=mySUSYScalarPotential->potential(potentialcoefficients, barriertop*x1, barriertop*x2, barriertop*x3)-Vmin0;
203 
204  if(barrierheight<=0.0)
205  {
206  throw std::runtime_error("Error in Metastability.cpp: No potential barrier!");
207  }
208  double rscale = barriertop/sqrt(6.0*barrierheight);
209 
210  /* 2.1.3 Finding a phi solution for the tunneling using an overshooting/undershooting algorithm */
211 
212  double x = -log(pos);
213 // double xincrease = 5.0;
214 
215  double rmin = 1.e-4*rscale;
216  double rmax = 1.e4*rscale;
217  double dr0 = rmin;
218  double drmin = 0.01*rmin;
219 
220  double delta_phi = distance;
221  double delta_phi_cutoff = 1.e-2 * delta_phi;
222  double epsabs[2] = {fabs(delta_phi)*1.e-4 , fabs(delta_phi/rscale)*1.e-4};
223  double epsfrac[2] = {1.e-4 , 1.e-4};
224 
225  double eps = distance*1.e-3;
226  gslpp::vector<double> inconds(3,0.);
227  do
228  {
229  double delta_phi0 = distance - exp(-x)*delta_phi;
230  double sdp = delta_phi0/distance; //scaled_delta_phi0
231 
232  double dV_at_delta_phi0 = (mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0-2.0*eps)*x1/distance, (delta_phi0-2.0*eps)*x2/distance, (delta_phi0-2.0*eps)*x3/distance)
233  -8.0*mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0-eps)*x1/distance, (delta_phi0-eps)*x2/distance, (delta_phi0-eps)*x3/distance)
234  +8.0*mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0+eps)*x1/distance, (delta_phi0+eps)*x2/distance, (delta_phi0+eps)*x3/distance)
235  -mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0+2.0*eps)*x1/distance, (delta_phi0+2.0*eps)*x2/distance, (delta_phi0+2.0*eps)*x3/distance) ) / (12.0*eps);
236 
237  double d2V_at_phi0 = (-mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0-2.0*eps)*x1/distance, (delta_phi0-2.0*eps)*x2/distance, (delta_phi0-2.0*eps)*x3/distance)
238  +16.0*mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0-eps)*x1/distance, (delta_phi0-eps)*x2/distance, (delta_phi0-eps)*x3/distance)
239  -30.0*mySUSYScalarPotential->potential(potentialcoefficients, sdp*x1, sdp*x2, sdp*x3)
240  +16.0*mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0+eps)*x1/distance, (delta_phi0+eps)*x2/distance, (delta_phi0+eps)*x3/distance)
241  -mySUSYScalarPotential->potential(potentialcoefficients, (delta_phi0+2.0*eps)*x1/distance, (delta_phi0+2.0*eps)*x2/distance, (delta_phi0+2.0*eps)*x3/distance) ) / (12.0*eps*eps);
242 
243  inconds = InitialConditions(delta_phi0, rmin, delta_phi_cutoff, distance, dV_at_delta_phi0, d2V_at_phi0);
244  if(!std::isfinite(inconds(0)) || !std::isfinite(x))
245  {
246  break;
247  }
248 
249  //r_y = rf, yf1, yf2, convergence=1(converged), 2(undershoot), 3(overshoot)
250  gslpp::vector<double> r_y(4,0.);
251  r_y = integrateProfile(inconds(0), inconds(1), inconds(2), dr0, epsfrac, epsabs, drmin, rmax, distance);
252 //
253 // # Check for overshoot, undershoot
254 // if ctype == "converged":
255 // break
256 // elif ctype == "undershoot": # x is too low
257 // xmin = x
258 // x = x*xincrease if xmax == np.inf else .5*(xmin+xmax)
259 // elif ctype == "overshoot": # x is too high
260 // xmax = x
261 // x = .5*(xmin+xmax)
262 // # Check if we've reached xtol
263 // if (xmax-xmin) < xtol:
264 // break
265 
266  }
267  while(true);
268 
269  /* 2.1.4 Integrate the barrier to get the tunneling action */
270 
271  /* 2.2 Calculation of the tunneling rate along the deformed path */
272 
273  /* 2.2.1 Deforming the path */
274  /* 2.2.2 Calculating the tunneling rate */
275 
276  }//loop over the minima
277 
278 
279 
280  // deform path between origin and i (old path is a line, new path is p_i)
281  //define splines between origin and i
282  //take origin and i
283  //for i_spline < ?
284  //add one knot, calculate its V and dV
285  //split into parallel and orthogonal components
286  //solve parallel tunneling
287  //calculate N and minimize it wrt orthogonal directions
288  // calculate action integrating along p_i
289  int rlength = 10;
290  gslpp::vector<double> r(rlength,0.);
291  gslpp::vector<double> phi(rlength,0.);
292  gslpp::vector<double> dphi(rlength,0.);
293 // double rlength = length of r;
294  double VphiMin_i = deformedV(phi(rlength));
295  //integrate.simps(integrand,r)
296  double integral = 0.0;
297  for(int j=1;j<rlength;j++)
298  {
299  integral += (r(j)-r(j-1))*(Simpsonintegrand(r(j-1),phi(j-1),dphi(j-1),VphiMin_i)
300  +4.0*Simpsonintegrand((r(j)+r(j-1))/2.0,(phi(j)+phi(j-1))/2.0,(dphi(j)+dphi(j-1))/2.0,VphiMin_i)
301  +Simpsonintegrand(r(j),phi(j),dphi(j),VphiMin_i))/(3.0*(double)rlength);
302  }
303 
304 // double volume = r(0)*r(0)*r(0)*r(0)*M_PI*M_PI/2.0;
305 
306 // S.assign(j, integral+volume*(deformedV(phi(0))-VphiMin_i));
307  // check whether action is larger than S_(i-1)
308 
309  return 0.0;
310 }

◆ convertToGslFunctionS()

template<class F >
gsl_function FindAction::convertToGslFunctionS ( const F &  f)
inlineprivate

Definition at line 86 of file Metastability.h.

88 {
89  gsl_function gslFunction;
90 
91  const void* p = &f;
92  assert (p != 0);
93 
94  gslFunction.function = &gslFunctionAdapterS<F>;
95  // Just to eliminate the const.
96  gslFunction.params = const_cast<void*>( p );
97 
98  return gslFunction;

◆ deformedV()

double FindAction::deformedV ( double  phi)
private

Definition at line 317 of file Metastability.cpp.

318 {
319  return 0.0;
320 }

◆ dY()

gslpp::vector< double > FindAction::dY ( double  y1,
double  y2,
double  r 
)
private

Definition at line 548 of file Metastability.cpp.

549 {
550  gslpp::vector<double> values(2,0.);
551 // double alpha=3.0; /*spatial dimensions*/
552  values(0)=y2;
553 // values(1)=(mySUSYScalarPotential->potential(potentialcoefficients, (y1-2.0*eps)*x1/distance, (y1-2.0*eps)*x2/distance, (y1-2.0*eps)*x3/distance)
554 // -8.0*mySUSYScalarPotential->potential(potentialcoefficients, (y1-eps)*x1/distance, (y1-eps)*x2/distance, (y1-eps)*x3/distance)
555 // +8.0*mySUSYScalarPotential->potential(potentialcoefficients, (y1+eps)*x1/distance, (y1+eps)*x2/distance, (y1+eps)*x3/distance)
556 // -mySUSYScalarPotential->potential(potentialcoefficients, (y1+2.0*eps)*x1/distance, (y1+2.0*eps)*x2/distance, (y1+2.0*eps)*x3/distance) ) / (12.0*eps)
557 // -alpha*y2/r;
558  return values;
559 }

◆ dYfunc()

int FindAction::dYfunc ( double  r,
const double  y[],
double  ODE[],
void *  flags 
)
private

◆ dYJac()

int FindAction::dYJac ( double  r,
const double  y[],
double *  dfdy,
double  dfdt[],
void *  order 
)
private

◆ ExactSolution()

gslpp::vector< double > FindAction::ExactSolution ( double  r,
double  phi0,
double  dV,
double  d2V 
)
private

Definition at line 409 of file Metastability.cpp.

410 {
411  gslpp::vector<double> phi_dphi(2,0.);
412  double phi = 0.0;
413  double dphi = 0.0;
414 
415  double curv = sqrt(fabs(d2V));
416  double curv_r = curv*r;
417  double nu = 1.0;
422  if(curv_r<1.e-2)
423  {
424  double s = (d2V>0) ? 1.0 : -1.0;
425  double add_to_phi;
426  for(int k=1;k<=4;k++)
427  {
428  add_to_phi = pow(0.5*curv_r,2.0*k-2.0) * pow(s,k) / (gsl_sf_gamma(k+1)*gsl_sf_gamma(k+1+nu));
429  phi += add_to_phi;
430  dphi += add_to_phi * (2.0*k);
431  }
432  phi *= 0.25 * gsl_sf_gamma(nu+1) * r*r * dV * s;
433  dphi *= 0.25 * gsl_sf_gamma(nu+1) * r * dV * s;
434  phi += phi0;
435  }
436  else if(d2V>0)
437  {
438  phi = (gsl_sf_gamma(nu+1)*pow(0.5*curv_r,-nu) *gsl_sf_bessel_In(int(nu),curv_r)-1.0) * dV/d2V;
439  dphi = -nu*(pow(0.5*curv_r,-nu) / r) * gsl_sf_bessel_In(int(nu), curv_r);
440  dphi += pow(0.5*curv_r,-nu) * 0.5*curv * (gsl_sf_bessel_In(int(nu)-1, curv_r)+gsl_sf_bessel_In(int(nu)+1, curv_r));
441  dphi *= gsl_sf_gamma(nu+1) * dV/d2V;
442  phi += phi0;
443  }
444  else
445  {
446  phi = (gsl_sf_gamma(nu+1)*pow(0.5*curv_r,-nu) * gsl_sf_bessel_Jn(int(nu), curv_r)-1.0) * dV/d2V;
447  dphi = -nu*(pow(0.5*curv_r,-nu) / r) * gsl_sf_bessel_Jn(int(nu), curv_r);
448  dphi += pow(0.5*curv_r,-nu) * 0.5*curv * (gsl_sf_bessel_Jn(int(nu)-1, curv_r)-gsl_sf_bessel_Jn(int(nu)+1, curv_r));
449  dphi *= gsl_sf_gamma(nu+1) * dV/d2V;
450  phi += phi0;
451  }
452  phi_dphi(0)=phi;
453  phi_dphi(1)=dphi;
454  return phi_dphi;
455 }

◆ fPS()

double FindAction::fPS ( double  x)
private

◆ func()

double FindAction::func ( double  rpar)
inlineprivate

Definition at line 51 of file Metastability.h.

52  {
53  double exsol=ExactSolution(rpar, phi0par, dVpar, d2Vpar)(0);
54  return fabs(exsol)-fabs(delta_phi_cutoffpar);
55  };

◆ gslFunctionAdapterS()

template<class F >
static double FindAction::gslFunctionAdapterS ( double  x,
void *  p 
)
inlinestaticprivate

Definition at line 77 of file Metastability.h.

79 {
80  // Here I do recover the "right" pointer, safer to use static_cast
81  // than reinterpret_cast.
82  F* function = static_cast<F*>( p );
83  return (*function)( x );

◆ InitialConditions()

gslpp::vector< double > FindAction::InitialConditions ( double  delta_phi0,
double  rmin,
double  delta_phi_cutoff,
double  distance,
double  dV_at_delta_phi0,
double  d2V_at_phi0 
)
private

Definition at line 340 of file Metastability.cpp.

341 {
342  double phi0 = distance + delta_phi0;
343  double dV = dV_at_delta_phi0;
344  double d2V = d2V_at_phi0;
345  gslpp::vector<double> exsol(2,0.);
346 //switch this on! exsol=ExactSolution(rmin, phi0, dV, d2V);
347  double phi_r0=exsol(0);
348  double dphi_r0=exsol(1);
349 
350  gslpp::vector<double> inc(3,0.);
351  inc(0)=rmin;
352  inc(1)=phi_r0;
353  inc(2)=dphi_r0;
354 
355  if(fabs(phi_r0)<fabs(delta_phi_cutoff) || dphi_r0*delta_phi0>0)
356  {
357  double r = rmin;
358  double rlast=r;
359  while(std::isfinite(r))
360  {
361  rlast = r;
362  r *= 10;
363 //switch this on! exsol=ExactSolution(r, phi0, dV, d2V);
364  if(fabs(exsol(0))>fabs(delta_phi_cutoff))
365  {
366  break;
367  }
368  }
369 
370  rpar=r;
371  phi0par=phi0;
372  dVpar=dV;
373  d2Vpar=d2V;
374  delta_phi_cutoffpar=delta_phi_cutoff;
375 
376  gsl_function F = convertToGslFunctionS(boost::bind(&FindAction::func, &(*this), _1));
377  //gsl root finding algorithm
378  int status;
379  int iter = 0, max_iter = 100;
380  const gsl_root_fsolver_type *T;
381  gsl_root_fsolver *s;
382  double r2 = 0;
383  double x_lo = rlast, x_hi = r;
384  T = gsl_root_fsolver_brent;
385  s = gsl_root_fsolver_alloc (T);
386  gsl_root_fsolver_set (s, &F, x_lo, x_hi);
387  do
388  {
389  iter++;
390  status = gsl_root_fsolver_iterate (s);
391  r2 = gsl_root_fsolver_root (s);
392  x_lo = gsl_root_fsolver_x_lower (s);
393  x_hi = gsl_root_fsolver_x_upper (s);
394  status = gsl_root_test_interval (x_lo, x_hi,
395  0, 0.001);
396  }
397  while (status == GSL_CONTINUE && iter < max_iter);
398  gsl_root_fsolver_free (s);
399  //now r2 is the root
400  exsol = ExactSolution(r2, phi0, dV, d2V);
401  inc(1)=exsol(0);
402  inc(2)=exsol(1);
403  }
404 
405  return inc;
406 }

◆ integrateProfile()

gslpp::vector< double > FindAction::integrateProfile ( double  r0,
double  y01,
double  y02,
double  dr0,
double  epsfrac[2],
double  epsabs[2],
double  drmin,
double  rmax,
double  distance 
)
private

Definition at line 457 of file Metastability.cpp.

458 {
459  double dr = dr0;
461  gslpp::vector<double> dydr0(2,0.);
462  dydr0 = dY(y01, y02, r0);
465  rmax += r0;
466 
467 // int i=1;
468 // int convergence_type = 0;
469 
470  gslpp::vector<double> ret_values(4,0.);
471 
472  do
473  {
474  gslpp::vector<double> r_y_drnext(4,0.);
475 // r_y_drnext = rkqs(y01, y02, dydr0, r0, dr, epsfrac, epsabs);
476 
481 
482  double r1 = r_y_drnext(0);
483  double y11 = y01+r_y_drnext(1);
484  double y12 = y02+r_y_drnext(2);
485 
486  gslpp::vector<double> dydr1 = dY(y11,y12,r1);
487 
488  if (r1 > rmax)
489  {
490  throw std::runtime_error("r > rmax");
491  }
492  else if (dr < drmin)
493  {
494  throw std::runtime_error("dr < drmin");
495  }
496 // else if ( fabs(y11 - distance) < 3.0*epsabs[0] && fabs(y12) < 3.0*epsabs[1] )
497 // {
498 // ret_values(0)=r1;
499 // ret_values(1)=y11;
500 // ret_values(2)=y12;
501 // ret_values(3)=1; //converged
502 // break;
503 // }
504  else if ( y12*(y01-distance) > 0 || (y11-distance)*(y01-distance) < 0 )
505  {
506 // double f=y0*(1-t)**3 + 3*y1*(1-t)*(1-t)*t + 3*y2*(1-t)*t*t + y1*t**3;
507 //(self, y0, dy0, y1, dy1)= y0*mt**3 + 3*y1*mt*mt*t + 3*y2*mt*t*t + y3*t**3
508 // ret_values(0)=r1;
509 // ret_values(1)=y11;
510 // ret_values(2)=y12;
511  ret_values(3)=2; //undershoot
512  break;
513 
514  }
515 // else if ( fabs(y11 - distance) < 3.0*epsabs && fabs(y12) < 3.0*epsabs )
516 // {
517 
518 // }
519 
520 // elif( y1[1]*(y0[0]-self.phi_metaMin) > 0 or (y1[0]-self.phi_metaMin)*(y0[0]-self.phi_metaMin) < 0 ):
521 // f = cubicInterpFunction(y0, dr*dydr0, y1, dr*dydr1)
522 // if(y1[1]*(y0[0]-self.phi_metaMin) > 0):
523 // # Extrapolate to where dphi(r) = 0
524 // x = optimize.brentq(lambda x: f(x)[1], 0, 1 )
525 // convergence_type = "undershoot"
526 // else:
527 // # Extrapolate to where phi(r) = phi_metaMin
528 // x = optimize.brentq(lambda x: f(x)[0]-self.phi_metaMin, 0,1)
529 // convergence_type = "overshoot"
530 // r = r0 + dr*x
531 // y = f(x)
532 // break
533 // # Advance the integration variables
534 // r0,y0,dydr0 = r1,y1,dydr1
535 // dr = drnext
536  }
537  while(true);
538 // # Check convergence for a second time.
539 // # The extrapolation in overshoot/undershoot might have gotten us within
540 // # the acceptable error.
541 // if (abs(y - np.array([self.phi_metaMin,0])) < 3*epsabs).all():
542 // convergence_type = "converged"
543 // return self._integrateProfile_rval(r, y, convergence_type)
544 
545  return ret_values;
546 }

◆ invertedpotential()

double FindAction::invertedpotential ( double  x)
inlineprivate

Definition at line 57 of file Metastability.h.

58  {
60  }

◆ rkqs()

gslpp::vector<double> FindAction::rkqs ( double  y01,
double  y02,
double  dydr0,
double  r0,
double  dr,
double  epsfrac[2],
double  epsabs[2] 
)

◆ Simpsonintegrand()

double FindAction::Simpsonintegrand ( double  r,
double  phi,
double  dphi,
double  VphiMin_i 
)
private

Definition at line 312 of file Metastability.cpp.

313 {
314  return (0.5*dphi*dphi + deformedV(phi)-VphiMin_i) * 2.0*M_PI*M_PI*r*r*r;
315 }

Member Data Documentation

◆ d2Vpar

double FindAction::d2Vpar

Definition at line 40 of file Metastability.h.

◆ delta_phi_cutoffpar

double FindAction::delta_phi_cutoffpar

Definition at line 40 of file Metastability.h.

◆ dVpar

double FindAction::dVpar

Definition at line 40 of file Metastability.h.

◆ mySUSY

const SUSY& FindAction::mySUSY
private

Definition at line 49 of file Metastability.h.

◆ mySUSYScalarPotential

SUSYScalarPotential* FindAction::mySUSYScalarPotential
protected

Definition at line 46 of file Metastability.h.

◆ phi0par

double FindAction::phi0par

Definition at line 40 of file Metastability.h.

◆ potentialcoefficientspar

gslpp::vector<double> FindAction::potentialcoefficientspar

Definition at line 41 of file Metastability.h.

◆ rpar

double FindAction::rpar

Definition at line 40 of file Metastability.h.

◆ x1par

double FindAction::x1par

Definition at line 40 of file Metastability.h.

◆ x2par

double FindAction::x2par

Definition at line 40 of file Metastability.h.

◆ x3par

double FindAction::x3par

Definition at line 40 of file Metastability.h.


The documentation for this class was generated from the following files:
FindAction::rpar
double rpar
Definition: Metastability.h:40
FindAction::convertToGslFunctionS
gsl_function convertToGslFunctionS(const F &f)
Definition: Metastability.h:86
SUSYScalarPotential
SUSYScalarPotential.
Definition: ScalarPotential.h:18
FindAction::InitialConditions
gslpp::vector< double > InitialConditions(double delta_phi0, double rmin, double delta_phi_cutoff, double distance, double dV_at_delta_phi0, double d2V_at_phi0)
Definition: Metastability.cpp:340
FindAction::phi0par
double phi0par
Definition: Metastability.h:40
gslpp::log
complex log(const complex &z)
Definition: gslpp_complex.cpp:342
FindAction::Simpsonintegrand
double Simpsonintegrand(double r, double phi, double dphi, double VphiMin_i)
Definition: Metastability.cpp:312
ThObservable::ThObservable
ThObservable(const StandardModel &SM_i)
Constructor.
Definition: ThObservable.h:32
SUSYScalarPotential::potentialderivative
gslpp::vector< double > potentialderivative(gslpp::vector< double > coefficients, double field1, double field2, double field3)
Definition: ScalarPotential.cpp:137
FindAction::x1par
double x1par
Definition: Metastability.h:40
SUSYScalarPotential::coefficients
gslpp::vector< double > coefficients()
Definition: ScalarPotential.cpp:15
FindAction::delta_phi_cutoffpar
double delta_phi_cutoffpar
Definition: Metastability.h:40
FindAction::d2Vpar
double d2Vpar
Definition: Metastability.h:40
FindAction::invertedpotential
double invertedpotential(double x)
Definition: Metastability.h:57
FindAction::ExactSolution
gslpp::vector< double > ExactSolution(double r, double phi0, double dV, double d2V)
Definition: Metastability.cpp:409
ThObservable::min
double min
The bin minimum.
Definition: ThObservable.h:125
gslpp::pow
complex pow(const complex &z1, const complex &z2)
Definition: gslpp_complex.cpp:395
gslpp::sqrt
complex sqrt(const complex &z)
Definition: gslpp_complex.cpp:385
FindAction::mySUSY
const SUSY & mySUSY
Definition: Metastability.h:49
SUSYScalarPotential::potential
double potential(gslpp::vector< double > coefficients, double field1, double field2, double field3)
Definition: ScalarPotential.cpp:118
gslpp::vector< double >
A class for constructing and defining operations on real vectors.
Definition: gslpp_vector_double.h:33
S
A class for the form factor in .
Definition: MVllObservables.h:1436
FindAction::deformedV
double deformedV(double phi)
Definition: Metastability.cpp:317
FindAction::mySUSYScalarPotential
SUSYScalarPotential * mySUSYScalarPotential
Definition: Metastability.h:46
FindAction::integrateProfile
gslpp::vector< double > integrateProfile(double r0, double y01, double y02, double dr0, double epsfrac[2], double epsabs[2], double drmin, double rmax, double distance)
Definition: Metastability.cpp:457
FindAction::dVpar
double dVpar
Definition: Metastability.h:40
gslpp::exp
complex exp(const complex &z)
Definition: gslpp_complex.cpp:333
FindAction::x3par
double x3par
Definition: Metastability.h:40
FindAction::func
double func(double rpar)
Definition: Metastability.h:51
FindAction::potentialcoefficientspar
gslpp::vector< double > potentialcoefficientspar
Definition: Metastability.h:41
FindAction::dY
gslpp::vector< double > dY(double y1, double y2, double r)
Definition: Metastability.cpp:548
FindAction::x2par
double x2par
Definition: Metastability.h:40