Calculation of the reflection of a regular wave.

April 02

Feb 03

June 05

 

To calculate the reflection of a regular wave, a Matlab program Refreg has been written in the Laboratory of Fluid Mechanics. The method used has been described by Goda and Suzuki (1976), see Goda (1985). In this method two wave gauges are used at a distance of about one fourth of the wave length.  

Basic equations in the case of a regular wave with wave gauges at positions x=x1 en x=x2 are:

 

           

           (1a)

                                                                            

           (1b)

 

where

            η                      the water-surface elevation relative to the mean water level,

            t                       the time,

            ai,n , ar,n          the amplitude of the n-th harmonic of the incoming and the reflected wave,

            kn                      the wave number of the n-th harmonic,

ωn                     the angular wave frequency of the n-th harmonic,

φi,n ,φr,n              the phase of the n-th harmonic of the incoming and the reflected wave.

 

In the Refreg program, the first harmonic is used only. Higher harmonic components and free or bound harmonics are not taken into account.

 

Equations (1a) and (1b) for the first harmonic are

 

           

                                        (2a)

           

                                       (2b)

 

(2a) can be written as

 

         

                                   

or

                                                                    (3a)

 

In the same way, (2b) can be written as

         

                                                      (3b)

                  

where

                                                             (4a)

                                                              (4b)

                                                                        (4c)

                                                                         (4d)

 

(4a) through 4(d) lead to the complex equations:

           

           

                                                                      (5a)

            ,                                                                    (5b)

 

where i=√-1.

 

(5a) and (5b) can be written as matrices:

 

           

                                                                (6)

 

The A and B in the right hand side of (6) can be found from a harmonic analysis of η(x1,t) and η(x2,t) in (3a) and (3b), e.g. by using a Fast Fourier Transform (FFT). In the program Refreg  two zero crossings with the same sign, one at the begin and one at the end of the first data series, are used to determine the length of the series to be analysed. In that case the data series can be regarded as cyclic. The only error is a cut off error if the wave period does not fit on the time step. The FFT of Matlab is used on the two data series from the wave gauges under consideration, where the number of points used fits to the time between the zero crossings as meant above. The period with the maximum modulus of the FFT-coefficients is used as the base period.

 

 


Short description of the program Refreg:

 

N.B.:     This program uses dialog boxes. In Matlab 7, dialog boxes will not be deleted immediately after clicking OK, but the program will continue; please don’t click OK again.

 

N.B.      After closing a (sub)menu, allways check the number of Matlab Windows (see Matlab icon in lower bar of monitor), and close all windows left open (except Labmenu, and the main program being in use).

            Don’t forget to jump back to a dialog box if help is consulted, and the box is left open.

 

 

Remarks:

  • To get a reliable value of the wave period, the time step in the measurements must be small enough (at maximum 0.05 times the wave period).
  • In a later version of this program, the moving average over the length of a period, using the time step of the data file as step, is substracted before calculation of the reflection. This version is called Refreg19, and is stored on the cd in subfolder Lab_process\Extra_s.

 

 


1.  Input parameters

 

  • Click on File, Open, Data file,
  • Search the measurements file to be processed,
  • Click on Open.

 

 

Parameters to be typed via dialog boxes :

 

read all samples?           choose yes (no only in case of files of 10 Mb or more),

number of header lines   0 in case of a Dasylab file (prog. determines length of header); otherwise: the number of header lines,           

 

At this point an error message may occur, see point 7.

 

time step in original data file,

number of harmonic components to be printed,

average water depth in m.

 

For each of the two wave gauges:

column number of the wave gauge series in the file,

position of the wave gauge in m,

scale factor of measurements from volts to meters.

 

Next, a graph of the read samples will appear, together with a dialog box to choose a suitable time interval. The graph can be helpful to choose this interval.

 

After making your choise, click on OK; a new graph will be displayed, showing the time interval chosen; close this graph to start the calculation.

 

Next an output file must be chosen. Choose a file, and click on OK, or click on Cancel to stop.

The output file will be opened after the calculation, and the user can view the results.

 

 

2.  Subtraction of mean value

 

In Refreg, the mean value of the time signal is substracted. In Refreg19 (folder Lab_process\Extra_s), a moving average over the length of the basic period is substracted. The step used in the moving average is the time step in the data file.

 

3.  Determination of the length of the signal

 

In the input part of the program, the user specified the part of the data that can be used in the calculation. From the begin and endpoint of this part, two zero crossings with equal sign are searched. This is done for the first wave gauge. The length of the series between the two zero crossings enables the program to find the correct base period from the FFT.

 

 

4.  Checking the time step

 

Generally, a period does not contain an integer number of samples. To reduce the error caused by this fact, the Matlab function Resample is used if there less than 20 points per period are present. Note that the phase may be inaccurate in that case.

 

 

5.  Calculating the first harmonic using the FFT of Matlab

 

The frequency having the maximum C-coefficient will be taken, where C = √(A2 + B2).

To coeffficients are determined by the Matlab function fft, and multiplied by 2/N as a scaling factor, where N is the number of points used in the FFT (see "using Matlab, v. 6, p. 6-32).

 

 

6.  Calculating the amplitude and the phase of the incoming and the reflected wave

 

Equation (6) has the form La = b, where a and b are vectors and L is a matrix. This equation system  can be solved in Matlab directly.

 

The wave number k is determined by the dispersion relation in case of free gravitation surface waves is used:

 

            ,

where ω is the angular frequency and g the gravitational acceleration constant. The calculation is performed by the Matlab-function Disper, written by Gert Klopman.

 

 

7. How to handle if a file cannot be read

 

The next errors may occur:

 

  • If the number of header lines specified in case of a non-Dasylab file is less than the actual number, the read function used in the scripts gives a message. However, in some cases Matlab gives the next error:

 

Number of colums in line -- of ASCII file ... must be the same as the previous line.

 

In such a case, remove all spaces, signs, or numbers from the first position of each header line.

 

If the number of header lines specified is more than the actual number, no message will occur, but less data lines will be read.

 

  • If a Dasylab file gives an error like above, check if the right file has been chosen. If yes, copy this file, delete the first line, and read the copy specifying the remaining number of header lines.

 

  • The maximum number of samples to be read is exceeded. This number is set to 500000/nchan,

where nchan is the number of channels used. If more data are needed, change the value of maxnum in \Functions\FN_indata7, line 86, or read the file in parts, using different sample numbers. Sample numbers to be read can be specified via the dialog box:

 

   read all samples?

           

            Specify No in this case.   

 

 

In a Dasylab file, it is preferable to store the time in decimal format. The time format with a ':' in Dasylab is not read as a time in Matlab.

 

Program  used to test Refreg

 

To test Refreg, a program ‘testsig’ has been written. In this program, an incoming and a reflected wave with one frequency are generated. The user must specify the following parameters:

 

name of the output file,

number of wave periods to be generated,

time step,

wave period,

water depth,

distance between water gauges,

reflection coefficient,

            phase of the incoming wave,

            phase of the reflected wave,

amplitude of normally distributed random noise.

 

The program has been tested with an amplitude of 1 for the incoming wave (To get an answer in meters, in the program Refreg a scaling factor may be used).

The random noise has been used only to investigate the influence of noise on the frequency of the first harmonic found. If the time step is small, this kind of noise can influence the frequency found, since the zero crossings with equal sign can be shifted by half a period if the frequency of the noise has the order of half the sampling frequency. This kind of noise will normally not be found in waves. It is better to use another kind of disturbance if testing the program. It may be useful to add higher harmonic components to the test signals in the future.

 

 

Things to be investigated

 

1.       The influence of the time step, the duration of the measurements, and the wave period on the results.

 

2.    A method to detect the wave period from the measurements, e.g. a regression method.

 

3.       The influence of perturbations, e.g. due to the equipment or caused by undesired objects in the   measurement system.

 

4.       A sensitivity analysis of the results. If some noise of a period of about two times the time step is present, an error may be found in the first harmonic component found from the zero crossings. This kind of noise is not expected in surface waves. On the other hand a small shift of the wave gauges can change the results.

A sensitivity analysis can be done by cross correlation methods.

 

 

Additional program points in the future

 


1.       The water velocity as a parameter (now: velocity 0).

 

2.       Adding more (higher) harmonics to the calculation, and splitting into bounded and free components. To be able to find the reflection of more harmonics, more than two wave gauges are needed.

 

 

References

 

Goda, Y. en Y. Suzuki (1976). "Estimation of Incident and Reflected Waves in Random Wave

Experiments". Proc. 15th Int Conf. Coastal Engrg., Honolulu, ASCE, New York, N.Y., 1,

pp. 828-845.

Goda, Y. (1985). Random seas and design of maritime structures. Univ. Tokyo Press, Tokyo, Japan.