tmr7 - experimental methods in marine hydrodynamics … · fast fourier transform ... 2 flow past a...

Post on 29-Apr-2018

241 Views

Category:

Documents

10 Downloads

Preview:

Click to see full reader

TRANSCRIPT

TMR7 - Experimental Methods in MarineHydrodynamics

Time Series Analysis

Jose P. Gallardo Canabes

Department of Marine TechnologyNorwegian University of Science and Technology

September 7, 2011

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

Outline of the presentation

1 Motivation

2 Background information

3 MATLAB for data analysis

4 Examples

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

Outline of the presentation

1 Motivation

2 Background information

3 MATLAB for data analysis

4 Examples

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

Outline of the presentation

1 Motivation

2 Background information

3 MATLAB for data analysis

4 Examples

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

Outline of the presentation

1 Motivation

2 Background information

3 MATLAB for data analysis

4 Examples

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

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 3 / 32

Motivation

Time series are common in science and engineering applications

Planetary motion

Periodic and predictable. . . to somedegree

Irregular waves

Random and difficult to predict

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

Motivation

Time series are common in science and engineering applications

Planetary motion

Periodic and predictable. . . to somedegree

Irregular waves

Random and difficult to predict

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

Motivation

Time series are common in science and engineering applications

Planetary motion

Periodic and predictable. . . to somedegree

Irregular waves

Random and difficult to predict

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

Motivation

Visual inspection is not enough

0

time

ζ(t)

Many tools are available for the analysis

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

Motivation

Visual inspection is not enough

0

time

ζ(t)

Many tools are available for the analysis

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

Motivation

Visual inspection is not enough

0

time

ζ(t)

Many tools are available for the analysis

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

Motivation

Visual inspection is not enough

0

time

ζ(t)

Many tools are available for the analysis

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

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 6 / 32

Fourier Series

A periodic function can be decomposed into its harmonic componentsThe function is represented as an infinite Fourier series

f (t) = a0 +∞∑k=1

ak cos(2πkt

T) + bk sin(

2πkt

T) (1)

with the coefficients a0, ak and bk defined as

a0 =1

T

∫ T

0f (t)dt

ak =2

T

∫ T

0f (t) cos(

2πkt

T)dt

bk =2

T

∫ T

0f (t) sin(

2πkt

T)dt

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

Fourier Series

A periodic function can be decomposed into its harmonic componentsThe function is represented as an infinite Fourier series

f (t) = a0 +∞∑k=1

ak cos(2πkt

T) + bk sin(

2πkt

T) (1)

with the coefficients a0, ak and bk defined as

a0 =1

T

∫ T

0f (t)dt

ak =2

T

∫ T

0f (t) cos(

2πkt

T)dt

bk =2

T

∫ T

0f (t) sin(

2πkt

T)dt

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

Fourier Integral

When T →∞ the Fourier integral is obtained

f (t) =

∫ ∞0

[A(ω) cos(ωt) + B(ω) sin(ωt)]dω (2)

with

A(ω) =1

π

∫ ∞−∞

f (t) cos(ωt)dt

B(ω) =1

π

∫ ∞−∞

f (t) sin(ωt)dt

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

Fourier Transform

A more compact form of expressing the Fourier integral is

f (t) =1√2π

∫ ∞−∞

f (ω)e iωtdω (3)

With the the Fourier transform of f (t)

f (ω) =1√2π

∫ ∞−∞

f (t)e−iωtdt (4)

The Fourier transform converts a function of time into a function offrequency

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

Fourier Transform

A more compact form of expressing the Fourier integral is

f (t) =1√2π

∫ ∞−∞

f (ω)e iωtdω (3)

With the the Fourier transform of f (t)

f (ω) =1√2π

∫ ∞−∞

f (t)e−iωtdt (4)

The Fourier transform converts a function of time into a function offrequency

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

Fourier Transform

A more compact form of expressing the Fourier integral is

f (t) =1√2π

∫ ∞−∞

f (ω)e iωtdω (3)

With the the Fourier transform of f (t)

f (ω) =1√2π

∫ ∞−∞

f (t)e−iωtdt (4)

The Fourier transform converts a function of time into a function offrequency

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

Discrete Fourier Transform (DFT)

Typically the values of f (t) are sampled at equally spaced points

The DFT of a signal f with n components will be

fn =N−1∑k=0

fke−intk , n = 0, . . . ,N − 1 (5)

Expressed in matricial form f = Ff where F is a N × N matrix

DFT requires O(N2) operations

Fast Fourier transform (FFT) lowers this requirement toO(N) log2(N) operations!

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

Discrete Fourier Transform (DFT)

Typically the values of f (t) are sampled at equally spaced points

The DFT of a signal f with n components will be

fn =N−1∑k=0

fke−intk , n = 0, . . . ,N − 1 (5)

Expressed in matricial form f = Ff where F is a N × N matrix

DFT requires O(N2) operations

Fast Fourier transform (FFT) lowers this requirement toO(N) log2(N) operations!

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

Discrete Fourier Transform (DFT)

Typically the values of f (t) are sampled at equally spaced points

The DFT of a signal f with n components will be

fn =N−1∑k=0

fke−intk , n = 0, . . . ,N − 1 (5)

Expressed in matricial form f = Ff where F is a N × N matrix

DFT requires O(N2) operations

Fast Fourier transform (FFT) lowers this requirement toO(N) log2(N) operations!

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

Discrete Fourier Transform (DFT)

Typically the values of f (t) are sampled at equally spaced points

The DFT of a signal f with n components will be

fn =N−1∑k=0

fke−intk , n = 0, . . . ,N − 1 (5)

Expressed in matricial form f = Ff where F is a N × N matrix

DFT requires O(N2) operations

Fast Fourier transform (FFT) lowers this requirement toO(N) log2(N) operations!

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

Discrete Fourier Transform (DFT)

Typically the values of f (t) are sampled at equally spaced points

The DFT of a signal f with n components will be

fn =N−1∑k=0

fke−intk , n = 0, . . . ,N − 1 (5)

Expressed in matricial form f = Ff where F is a N × N matrix

DFT requires O(N2) operations

Fast Fourier transform (FFT) lowers this requirement toO(N) log2(N) operations!

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

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 11 / 32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Example 2 - Flow past a circular cylinder

Flow past a circular cylinder at different Reynolds numbers

Unsteady, viscous and laminar or turbulent flow

Strouhal number characterizes vortex shedding frequency

U∞

Boundary layer

Shear layerWake

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

Example 2 - Flow past a circular cylinder

Flow past a curved circular cylinder at Re = 100

Unsteady, viscous laminar flow

Frequency analysis of the velocity trace in the cross-stream direction

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

Example 2 - Flow past a circular cylinder

Flow past a curved circular cylinder at Re = 100

Unsteady, viscous laminar flow

Frequency analysis of the velocity trace in the cross-stream direction

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

Example 2 - Flow past a circular cylinder

Flow past a curved circular cylinder at Re = 500

Transition to turbulence

One dominant frequency, and secondary instabilities

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

Example 2 - Flow past a circular cylinder

Flow past a curved circular cylinder at Re = 500

Transition to turbulence

One dominant frequency, and secondary instabilities

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

Example 2 - Flow past a circular cylinder

Frequency analysis of the vortex shedding

One shedding frequency, St = 0.176 at Re = 100

St = 0.225 at Re = 500

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

Example 2 - Flow past a circular cylinder

Frequency analysis of the vortex shedding

One shedding frequency, St = 0.176 at Re = 100

St = 0.225 at Re = 500

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

Example 2 - Flow past a circular cylinder

Frequency analysis of the vortex shedding

One shedding frequency, St = 0.176 at Re = 100

St = 0.225 at Re = 500

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

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

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

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

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

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

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

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

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

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

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

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

top related