EP 208 Computational Methods in Physics
 


Computer Labs

Lab sheets:

Additional Notes on Least Square Fitting:

  1. Data file for the inverse square law
    Light source (LED)      Light detector
    
        /
       o --                       D
        \
    
        <----------- x ----------->
    
    * DATA
    file isl_data.txt
    first  column (x): Distance in meter
    second column (I): Light intensity in %
    
    
    * FIT
    General model:
           f(x) = a/x^n
    Coefficients (with 95% confidence bounds):
           a =       38.27  (38.12, 38.42)
           n =       1.952  (1.931, 1.972)
    
    Goodness of fit:
       S: 18.14
      r2: 0.9969
    
    gnuplot> plot "isl_data.txt", 38.27/x**1.952
    



  2. Notes on the Hanging Chain
    y(x) = A cosh(x/A) -A

    Data:

    x = {-1.0000,   -0.8000,   -0.6000,   -0.4000,   -0.2000,    0.0000,    0.2000,    0.4000,    0.6000,    0.8000,    1.0000};
    y = { 0.5000,    0.3300,    0.1900,    0.0800,    0.0200,    0.0000,    0.0200,    0.0900,    0.1700,    0.3000,    0.5000};
    
    
    gnuplot> plot [-1:1] 1/0.8*cosh(0.8*x)-1/0.8, 0.42*x**2
University of Gaziantep - Department of Engineering Physics (2009 - 2024)