Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

GSL Multidim Minimizer - How to handle unphyiscal values

  1. Jul 8, 2015 #1
    Hello,

    For my master thesis I'm looking at the Two-Higgs-Doublet-Modell at finite Temperature and I'm searching for the Minimum values of the two VEVs of the Doublets. Therefore i have my Potential with Input Parameters v1 and v2 in which I want to minimize the Potential and a Vector with User Input Parameters like the Temperature and the Couplings.

    In the Progress of calculating the Potential I have 4 4x4 Matrices which depend on v1 and v2. I calculate the Eigenvalues with Eigen and in my Potential I need these Values to the Power of 3/2.

    The actual Problem: For some values of v1 and v2 these Eigenvalues are negative and I need to get rid of these Input set as they are unphysical. The Minimization Process receives and Error at these unphysical values because the programm tries to calculate the square root of these Eigenvalues which gives NaN.
    How can I tell the Minimizer to ignore those values? Either as an Option to the Minimizer or as an Output of the Function calculating the Potential.

    To Minimize my Potential I use the gsl nmsimplex 2 Method as shown below (similiar to the GSL Manual Example).



    Code (C):
    const gsl_multimin_fminimizer_type *T = gsl_multimin_fminimizer_nmsimplex2;
      gsl_multimin_fminimizer *s = NULL;
      gsl_vector *ss, *x;
      gsl_multimin_function minex_func;

    size_t iter = 0;
      int status;
      double size;

    /* Starting point */
          x = gsl_vector_alloc (2);
          gsl_vector_set (x, 0, v1Start);
          gsl_vector_set (x, 1, v2Start);

    /* Set initial step sizes to 1 */
          ss = gsl_vector_alloc (2);
          gsl_vector_set_all (ss, 1.0);

    /* Initialize method and iterate */
          minex_func.n = 2;
          minex_func.f = my_f;
          minex_func.params = par;

          s = gsl_multimin_fminimizer_alloc (T, 2);
          gsl_multimin_fminimizer_set (s, &minex_func, x, ss);


          do
            {
              iter++;
              status = gsl_multimin_fminimizer_iterate(s);

              if (status)
                break;

              size = gsl_multimin_fminimizer_size (s);
              status = gsl_multimin_test_size (size, C_MinTOL); // Teste Toleranz auf MinTOL

              if (status == GSL_SUCCESS)
                {
                  printf ("converged to minimum at\n");
                  printf ("%5d %10.3e %10.3e f() = %7.3f size = %.3f\n",
                      iter,
                      gsl_vector_get (s->x, 0),
                      gsl_vector_get (s->x, 1),
                      s->fval, size);
                    printf(" at Temperature %lf \n " , Temptmp);
                 
                }


            }
          while (status == GSL_CONTINUE && iter < 1000);
     
  2. jcsd
  3. Jul 10, 2015 #2
    Another possibility would be to change the Minimization Method (doesn't have to be gsl). So if you know one which could handle this case, please let me know it.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: GSL Multidim Minimizer - How to handle unphyiscal values
  1. Exception Handling (Replies: 7)

Loading...