###------------------------------------------------------------------------------------------------ ### TOPIC Data Analysis based on the Newton Interpolation Polynomial (NIP) ###------------------------------------------------------------------------------------------------ ### FILE NAME NIP_input_StudyCase_3_sin.txt ### DESCRIPTION INPUT FILE of NIP.pl (perl script) ### CREATED So 24 Mai 2015 17:17:35 CEST ### LAST MODIFIED Do 4 Jun 2015 17:30:51 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 : 12 x-value_00 : 0.0 Delta-x : 0.6 # # 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= SIN(X) # -3- ALL legal values (25) stored will be READ, BUT NOT MORE than the given number in 'Number of measures' (12) will be CONSIDERED, when solving the problem. # y-value_00 : 0,0000000000 # X = 0.00 y-value_01 : 0,5646424734 # X = 0.60 y-value_02 : 0,9320390860 # X = 1.20 y-value_03 : 0,9738476309 # X = 1.80 y-value_04 : 0,6754631806 # X = 2.40 y-value_05 : 0,1411200081 # X = 3.00 y-value_06 : -0,4425204433 # X = 3.60 y-value_07 : -0,8715757724 # X = 4.20 y-value_08 : -0,9961646088 # X = 4.80 y-value_09 : -0,7727644876 # X = 5.40 y-value_10 : -0,2794154982 # X = 6.00 y-value_11 : 0,3115413635 # X = 6.60 # Last measurement considered for calculating the NIP y-value_12 : 0,7936678638 # X = 7.20 y-value_13 : 0,9985433454 # X = 7.80 y-value_14 : 0,8545989081 # X = 8.40 y-value_15 : 0,4121184852 # X = 9.00 y-value_16 : -0,1743267812 # X = 9.60 y-value_17 : -0,6998746876 # X =10.20 y-value_18 : -0,9809362301 # X =10.80 y-value_19 : -0,9193285257 # X =11.40 y-value_20 : -0,5365729180 # X =12.00 y-value_21 : 0,0336230472 # X =12.60 y-value_22 : 0,5920735147 # X =13.20 y-value_23 : 0,9436956694 # X =13.80 y-value_24 : 0,9656577765 # X =14.40 __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 : SIN(X) Number of calculation points : 42 x-value_00 : 0.0 Delta-x : 0.3 # The complete NIP=NIP(10) and NIP(5) has used to interpolate the data b-max_00 : 5 # Interpolation considers an x-range of about [0, pi] (half a period) b-max_01 : 11 # Interpolation considers an x-range of about [0,2pi] (the complete period) __END_ANALYSIS__ __END_OF_FILE__