tmr7 - experimental methods in marine hydrodynamics … · ... time series analysis september 7,...

25
MATLAB Fast and efficient algorithms Relatively easy to learn and write scripts (MATLAB editor) Several options for visualization of data Computations on large datasets Specific applications (MATLAB toolbox) J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 12 / 32

Upload: duongnhi

Post on 19-May-2018

252 views

Category:

Documents


14 download

TRANSCRIPT

Page 1: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

MATLAB

Fast and efficient algorithms

Relatively easy to learn and write scripts (MATLAB editor)

Several options for visualization of data

Computations on large datasets

Specific applications (MATLAB toolbox)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 12 / 32

Page 2: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

MATLAB

Fast and efficient algorithms

Relatively easy to learn and write scripts (MATLAB editor)

Several options for visualization of data

Computations on large datasets

Specific applications (MATLAB toolbox)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 12 / 32

Page 3: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

MATLAB

Fast and efficient algorithms

Relatively easy to learn and write scripts (MATLAB editor)

Several options for visualization of data

Computations on large datasets

Specific applications (MATLAB toolbox)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 12 / 32

Page 4: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

MATLAB

Fast and efficient algorithms

Relatively easy to learn and write scripts (MATLAB editor)

Several options for visualization of data

Computations on large datasets

Specific applications (MATLAB toolbox)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 12 / 32

Page 5: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

MATLAB

Fast and efficient algorithms

Relatively easy to learn and write scripts (MATLAB editor)

Several options for visualization of data

Computations on large datasets

Specific applications (MATLAB toolbox)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 12 / 32

Page 6: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Time Series Tools - MATLAB

Opened by writing tstool in the command prompt

Import data

Plot the time series data

Select data subsets for analysis (filter)

Process the data (statistics)

Plot spectrum

Further analysis (power spectra) can be performed with built-in functionsof the Signal Processing Toolbox

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 13 / 32

Page 7: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Table of Contents

1 Motivation

2 Background information

3 MATLAB for data analysis

4 Examples

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 14 / 32

Page 8: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Examples

1 Simple mathematical functions

2 Flow past a circular cylinder and determination of the dominant(Strouhal) frequency

3 Irregular waves

4 Example of response amplitude operator (RAO)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 15 / 32

Page 9: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Examples

1 Simple mathematical functions

2 Flow past a circular cylinder and determination of the dominant(Strouhal) frequency

3 Irregular waves

4 Example of response amplitude operator (RAO)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 15 / 32

Page 10: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Examples

1 Simple mathematical functions

2 Flow past a circular cylinder and determination of the dominant(Strouhal) frequency

3 Irregular waves

4 Example of response amplitude operator (RAO)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 15 / 32

Page 11: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Examples

1 Simple mathematical functions

2 Flow past a circular cylinder and determination of the dominant(Strouhal) frequency

3 Irregular waves

4 Example of response amplitude operator (RAO)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 15 / 32

Page 12: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Filtering of data

High-pass filter Removes low frequency componentsLow-pass filter Removes high frequency componentsBand-pass filter Select a frequency interval for filtering

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 16 / 32

Page 13: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 1 - Simple functions

Beat frequency: interference between two frequencies f1and f2

0 1 2 3 4 5

−0.2

−0.1

0

0.1

0.2

0.3

f1+f

2

t*

Function with random noise

0 2 4 6 8 10−2

−1

0

1

2

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 17 / 32

Page 14: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 1 - Simple functions

Beat frequency: interference between two frequencies f1and f2

0 1 2 3 4 5

−0.2

−0.1

0

0.1

0.2

0.3

f1+f

2

t*

Function with random noise

0 2 4 6 8 10−2

−1

0

1

2

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 17 / 32

Page 15: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 3 - Irregular long-crested waves

Linear theory for the statistical description

Wave elevation composed of a large number of wave components

ζ(x , t) =N∑j=1

ζaj sin(ωj t − kjx + ε)

Relation between the discrete amplitude and the wave spectrum for ωj

1

2ζ2aj = S(ωj)∆ω

0

time

ζ(t)

Frequency

S(ω

)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 22 / 32

Page 16: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 3 - Irregular long-crested waves

Basic idea with this example is to generate time series of irregular waveswith a Pierson-Moskowitz spectrum, and generate the spectrum again withthe MATLAB function pwelch

Generate the data from the script IrregWave.m (requires functionPMspectrum.m)

Calculate the sampling frequency from the time series: writeFs=1./dt in the command prompt

Use the pwelch function to get the values of spectral density andfrequency: [P,F] = pwelch(z,[],[],[],2*pi*Fs)

Plot the estimated spectrum: plot(F,P)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 23 / 32

Page 17: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 3 - Irregular long-crested waves

Values of the parameters are T1 = 10.13 s and H1/3 = 2.52 m

0 0.5 1 1.5 2 2.5 3 3.5 40

0.5

1

1.5Plot of the Pierson−Moskowitz Spectrum

ω [rad/s]

S(ω

) [m

2 /s]

T1 = 10.13 [s] and H1/3 = 2.52 [m]

0 50 100 150 200 250 300−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

time [s]

ζ(t)

[m]

Irregular wave

0 50 100 150 200 250 300−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

time [s]

ζ(t)

[m]

Irregular wave

0 0.5 1 1.5 2 2.5 3 3.5 40

0.5

1

1.5Estimated spectrum using the simulated time series

Frequency [rad/s]

S(ω

) [m

2 s]

How does the spectral estimation depends on length of the time series?Sampling frequency?

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 24 / 32

Page 18: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 4 - Response Amplitude Operator (RAO)

Given a sea state defined by the spectrum Sζ(ω), find the responsespectrum Sη(ω)

The response amplitude for a certain frequency can be found by thetransfer function Hη(ω)

Conside the state at the frequency ωj

η0j = Hη(ωj)ζaj

1

2η2

0j︸︷︷︸=Sη(ωj )∆ω

= H2η (ωj)

1

2ζ2aj︸︷︷︸

=Sζ(ωj )∆ω

Sη(ω) = H2η (ω)Sζ(ω)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 25 / 32

Page 19: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 4 - RAO with irregular waves

Run the MATLAB script GetData.m to retrieve and plot data fromthe file test3004.mat

Open tstool application: write tstool in the commandprompt

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 26 / 32

Page 20: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 4 - RAO with irregular waves

Step1: Import the data wave, waveCarriage and heave → Import fromworkspace → Array data

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 27 / 32

Page 21: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 3 - RAO with regular waves

Step 2: Choose the variable wave and specify the time vector inanother variable (press Select Variable tab and choose time)Step3: Press next, rename the time series to FilteredWave and pressFinish

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 28 / 32

Page 22: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 4 - RAO with irregular waves

Plot the time series to see how they look (drag to the folder TimePlots); the data is already pre-processedSpectral plots can be obtained be dragging the time series to thefolder Spectral PlotsHigh and low frequency components can be removed using the plotby selecting frequency intervalsRight-click over the selected frequency intervals and choose Pass

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 29 / 32

Page 23: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 4 - RAO with irregular waves

Repeat the steps above for waveCarriage and heave (remember torename to FilteredWaveCarriage and FilteredHeave)

The variables are exported to the workspace with class timeseries

In the script RAOirreg.m the data is retrieved aszeta=FilteredWave.Data , zeta c=FilteredWaveCarriage.Data

and eta 3=FilteredHeave.Data

Sampling frequency: Fs=1/(time(2)-time(1))

Spectral density values: [WaveSpectrum,fw] =

pwelch(zeta,[],[],[],2*pi*Fs),[EncounteredWaveSpectrum,fe] =

pwelch(zeta c,[],[],[],2*pi*Fs)and [ResponseSpectrum,fr]

= pwelch(eta 3,[],[],[],2*pi*Fs)

RAO:RAO=sqrt(ResponseSpectrum./EncounteredWaveSpectrum)

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 30 / 32

Page 24: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

Example 4 - RAO with irregular waves

Plot spectral density and RAO

0 1 2 3 4 50

1

2

3

4

5

6Spectral Density plot

Frequency, [rad/s]

S(ω

)

Wave [m2s]

Encounter Wave [m2s]

Heave Response [m2s]

0 1 2 3 4 50

0.5

1

1.5

Frequency [rad/s]

RA

O [m

/m]

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 31 / 32

Page 25: TMR7 - Experimental Methods in Marine Hydrodynamics … · ... Time Series Analysis September 7, 2011 12 / 32. ... Function with random noise ... An Introduction to Random Vibrations,

References

1 O. M. Faltinsen. Sea Loads on Ships and Offshore Structures,Cambridge Ocean Technology Series, 1990.

2 C. M. Larsen & W. Lian. TMR 4180 Marine Dynamics, Departmentof Marine Technology NTNU, 2009.

3 D. E. Newland. An Introduction to Random Vibrations, Spectral andWavelet Analysis, Longman Scientific & Technical, 1993.

J. Gallardo C. (NTNU) Time Series Analysis September 7, 2011 32 / 32