###------------------------------------------------------------------------------------------------ ### TOPIC Data Analysis based on the Newton Interpolation Polynomial (NIP) ###------------------------------------------------------------------------------------------------ ### FILE NAME NIP_input_StudyCase_1_Polynomial.txt ### DESCRIPTION INPUT FILE of NIP.pl (perl script) ### CREATED So 24 Mai 2015 09:07:18 CEST ###------------------------------------------------------------------------------------------------ ### AUTHOR NIP.pl written by Amar Khelil, ### www.khelil.de, 2014-2015, All rights reserved ###------------------------------------------------------------------------------------------------ ### FURTHER INFOS See project description http://www.khelil.de/Ref_Projekte_Intern/Projekte_perl_NIP_EN.html ### Chapter 'Study Cases' ###------------------------------------------------------------------------------------------------ ### GENERAL CONDITIONS ###------------------------------------------------------------------------------------------------ ### The treatment steps: ### -1- READ the Input Data stored in SECTION INPUT_DATA ### (limited by literals __BEGIN_INPUT_DATA__, __END_INPUT_DATA__) ### -2- CALCULATE the b-coefficients of the NIP (Newton Interpolation Polynomial) N(X) ### N(X) = b0 + b1 (X-X0) + b2 (X-X0) (X-X1) + ... + bn (X-X0)...(X-X(n-1)) ### -3- ANALYSE the results ### The calculated coefficients will be used to calculate y-values as defined in SECTION ANALYSIS ### (limited by literals __BEGIN_ANALYSIS__, __END_ANALYSIS__) ### ### General reading principles: ### -1- Lines starting with '#' are comments. Comments are ignored. ### -2- Each data category is read within a dedicated SECTION {__BEGIN_SECTION__, __END_SECTION__} ### -3- Each single data is identified by means of a pattern (data_identifier data_value) ### Advantage : The items must not be ordered - except for the (xi,yi) values (data indices are ignored) ### Shortcoming: Data cannot be read, if the pattern has been damaged i.e. the data_identifier cannot be recognized! ### __BEGIN_INPUT_DATA__ ###------------------------------------------------------------------------------------------------ ### DESCRIPTION OF SECTION 'INPUT DATA' ###------------------------------------------------------------------------------------------------ ### To define the measurements points out of which the NIP is calculated ### -1- Number of (measurement) points to read ### -2- x-value of the first measurement point P0 = (x0, y0) ### -3- Delta_x = (xi+1 - xi) is the equi-distance between 2 consecutive x-values ### -4- The y-values starting from y0 to yN (Number of measures - 1): It is assumed Pi=(xi,yi) ###------------------------------------------------------------------------------------------------ Number of measures : 10 # (X0 to X9) (b0 to b9: NIP is a polynomial of degree 9) x-value_00 : 0.0 Delta-x : 0.1 # # Beware: # -1- y-values MUST be entered in increasing order y0, y1,... yi, yi+1,... # the value-indices _i are not parsed in the current program version. # -2- The yi-values have been estimated using LibreOffice calc Y= 1 + X + 0.5 X**2 + 0.25 X**3 + 2 X**5 # -3- ALL legal values (21) stored will be READ, BUT NOT MORE than the given number in 'Number of measures' (10) will be CONSIDERED, when solving the problem. # y-value_00 :1,000000 y-value_01 :1,105270 y-value_02 :1,222640 y-value_03 :1,356610 y-value_04 :1,516480 y-value_05 :1,718750 y-value_06 :1,989520 y-value_07 :2,366890 y-value_08 :2,903360 y-value_09 :3,668230 y-value_10 :4,750000 y-value_11 :6,258770 y-value_12 :8,328640 y-value_13 :11,120110 y-value_14 :14,822480 y-value_15 :19,656250 y-value_16 :25,875520 y-value_17 :33,770390 y-value_18 :43,669360 y-value_19 :55,941730 y-value_20 :71,000000 __END_INPUT_DATA__ ###------------------------------------------------------------------------------------------------ ### DESCRIPTION OF SECTION ANALYSIS ### The following data determines which y-values will be recalculated using the (complete or incomplete) NIPs ###------------------------------------------------------------------------------------------------ __BEGIN_ANALYSIS__ # Characteristics of the Data Analysis # -1- Name of the function that has been interpolated is known # # -2- The x-values to recalculate have been chosen in such a manner that # - All the original values are recalculated # At least for the complete NIP there should be no differences between original and interpolated data. # # - New values INSIDE the original data range are recalculated # Check whether the NIP starts waving between the interpolation points # - which is a negative sign # # - New values OUTSIDE the original data range are recalculated # In most cases 'extrapolation' proves to work very poorly. # In this particular case it should work fine, because # the NIP must quite equalize the original function. # Name of interpolated function : 1 + X + 0.5 X**2 + 0.25 X**3 + 2 X**5 Number of calculation points : 41 x-value_00 : 0.0 Delta-x : 0.05 b-max_00 : 5 # NIP=N5(x)=b0 +..+ b5(X-X0)...(X-X4) b-max_01 : 9 # NIP=N9(x)=b0 +..+ b5(X-X0)...(X-X4)+...+ b9 (X-X0)...(X-X8) # __END_ANALYSIS__ __END_OF_FILE__