Problems 11
  1. Theory.
    1. Suppose you want to use the revtex4 document class from American Physical Society. How do you install it on your box from Ubuntu repositories?
      • Hint:

        apt-cache search revtex
        
        tells you that the object revtex is contained in the package texlive-publishers. You can read about the object revtex in the package with
        apt-cache show texlive-publishers | grep revtex
        
        And you can install the package with
        sudo apt-get install texlive-publishers
        
    2. What is the signature of the structure gsl_multimin_function, what are the members of the structure and where in GSL is this structure used.
      • Hint: find the include directory with gsl-config --cflags and

        grep --before-context=9 "gsl_multimin_function;" /usr/include/gsl/*.h
        
    3. What is the signature of the structure gsl_multiroot_fsolver, what are the members of the structure and where in GSL is this structure is used.
      • Hint: find the include directory with gsl-config --cflags and

        grep --before-context=9 "gsl_multiroot_fsolver;" /usr/include/gsl/*.h
        
  2. Practice.
    1. An example of examination exercise: the error function.
      1. Implement the error function erf(x) and the complimentary error function erfc(x) using the integration routines from GSL.
        • Hint: you can implement mutually recursive functions:

          double erfc(double x);
          double erf(double x){
          	if(x < 0) return -erf(-x);
          	if(x > 1) return 1-erfc(x);
          	/* calculate erf(x) where 0≤x≤1 */
          	return result;
          }
          double erfc(double x){
          	if(x < 0) return 2-erfc(-x);
          	if(x < 1) return 1-erf(x);
          	/* calculate erfc(x) where 1≤x */
          	return result;
          }
          				
      2. Create a short report about the error function using the material from the corresponding article in wikipedia and about your implementation. You should use the integration subroutines from GSL. Use LaTeX document class article or revtex4 (or your other favourite class).
      3. The plots of the error function and the complementary error function must be done using pyxplot/gnuplot and your implementation of the error function.