Equation of motion of a WEC
• Frequency domain:
– Ok if all effects/forces are linear
• Time domain:
– If non linear effects/forces are involved (and significant)
– Examples: PTO, control, drag effects, moorings, hydrostatic
( )
(
)
( )
ex( ) (
H PTO) ( )
(
( )
PTO)
( )
others ω ω ω ω ω ω + = − + − + + M A X&&% F% K K X% B B X&%(
)
( )
0t( ) ( )
ext
H radt
d
PTOothers
τ
τ τ
∞+
=
−
−
−
+
+
∫
M
µ
X
&&
F
K X
K
X
&
F
Must be linear( )
= ∞ 0(
β
−τ η
) (
β τ τ
)
∫
Outline:
• Integration in time of the equation of motion
• State space approximation of the memory term in the radiation force
Time integration of the equation
of motion
Equation of motion in time domain
• It is a second order ODE (Ordinary Differential Equation):
• But available time integration schemes are for first order ODE…
How to deal with that?
(
M
+
µ
∞)
X
&&
=
F
ex−
∫
0tK t
(
−
τ
)
X
&
( )
τ τ
d
−
K X
H+
F
drag+
F
PTO+
F
others(
t
X
X
)
g
X
&
&
=
,
,
&
( )
t
S
f
S
&
=
,
Fluid/structure interactions
PTO force
Other forces (moorings, wind, Coriolis forces…)
Can depend on X (non linear mechanics)
From second order to first order
• Let define the state vector
• The equation of motion can be rewritten as an ODE of first order
( )
( ) (
)
( )
+ + + − − + + = =∫
− ∞ others PTO drag H t ex F F F X K d X t K F M X S t f S t f S 0 1 ( ) , ,τ
τ
τ
µ
& & &
=
X
X
S
&
Discretisation of continuous problem
• Time discretisation is necessary for solving the problem numerically
• Let
∆
t be a small time step• Discretisation of time:
• Discretisation of the state vector:
• Discretisation of the memory term by the trapezoidal rule (second order accuracy)
t
n
t
n=
∆
( )
n nt
S
S
=
( )
(
0 0)
1( )
2 0 11
(
)
2
n t n n n j j jK t
τ
X
τ τ
d
K X
K X
t
K
X
t
O
t
− − =−
=
+
∆ +
∑
∆ +
∆
∫
&
&
&
&
If K and X are sampled at the same times
Discrete equation of motion
(
)
(
)
(
)
(
0 0)
1 1 1 , 1 , 2 n n n n n n n n n j j n n ex j n n n nH drag PTO others
S f t S X F K X K X t K X t f t S M K X F F F
µ
− − − = ∞ = + + ∆ + ∆ = + − + + + ∑
& &The simplest time integration scheme
• Numerical time derivation
• From which:
( )
(
t
S
)
t
O
( )
t
f
S
S
t
O
t
S
S
S
n n n n n n n∆
+
∆
+
=
∆
+
∆
+
=
+ +,
1 1&
( )
t
O
t
S
S
S
n n n+
∆
∆
−
=
+1&
It is called ‘Euler explicit scheme’ Advantage: Simple
Drawbacks: Poor accuracy (first order), unstable (divergence)
Second order time integration scheme
• Two steps scheme:
– Step 1: calculate the velocity k1at tn
– Step 2: make a prediction of the state at tn+1 and calculate the
velocity k2 at tn+1
– Advance in time using:
• Second order scheme, same as for discretisation of convolution product
(
k
k
)
t
S
S
n+1=
n+
1+
2∆
2
1
(
n n)
S
t
f
k
1=
,
(
t
S
k
t
)
f
k
2=
n+1,
n+
1∆
Higher orders scheme
• There are many higher order schemes
– Runge Kutta 4 – Adams Moutons – …
• MATLAB has validated functions for time integration (ode45, ode23, …)
Summary and recommendations
• Discrete equation of motion:
• Always use a time integration scheme of order at least 2. • Always check the convergence (are the results the same
if you refine the time step?)
(
)
(
)
(
)
(
)
1 0 0 1 1 , 1 , 2 n n n n n n n n n j j n n ex j n n n nH drag PTO others
S f t S X F K X K X t K X t f t S M K X F F F
µ
− − − = ∞ = + + ∆ + ∆ = + − + + + ∑
& &May be used in exercise 4 : FD2TD.m
PURPOSE:
• Calculate radiation coefficients in time domain using frequency domain coefficients by using Ogilvie’s formulas:
INPUTS
• w frequency vector
• A added mass coefficients
• B radiation damping coefficients
• T time vector OUTPUTS • K retardation function • Mu added mass Cf help FD2TD [ ] ( ) [ ]( ) ( ) [ ]( ) ( ) ( ) 0 0 1 sin 2 cos rad rad A K d K t B d µ ω τ ωτ τ ω ω ωτ ω π ∞ ∞ ∞ = + =
∫
∫
For exercise 4 time domain modelling
• Make your own RK2 solver or use MATLAB ode45 • Use of ode45:
1. Create a function f.m
function dS=f(t,S,parameters)
2. Time integration using ode45
[T,S]= ode45(@(t,S) f(t,S,parameters),[ti tf], [IC], options)
Discrete time
Discrete
states parameters end time ofStart and simulation
Initial conditions
State space approximation of the
memory term of the radiation force
Direct calculation of the memory term
• Drawbacks:
– Can be CPU time consuming
– Discretisation time of K and t can be different. K needs to be interpolated then not very convenient
Solution: To replace the convolution product by a
function of additional state variables given by additional state equations state space approximation
( )
(
0 0)
1( )
2 0 11
(
)
2
n t n n n j j jK t
τ
X
τ τ
d
K X
K X
t
K
X
t
O
t
− − =−
=
+
∆ +
∑
∆ +
∆
∫
&
&
&
&
(
) ( )
( )
0
t
K t
−
τ
X
τ τ
d
=
g I
Prony’s method
• Approximation using Prony’s method :
( )
∑
=≈
N i i it
t
K
1)
exp(
β
α
Complex constants calculated by Prony’s methodProny’s method
( )
∑
=≈
N i i it
t
K
1)
exp(
β
α
time (s) F o rc e (N /m .s ) 0 2 4 6 8 -20000 -10000 0 10000 20000 30000 K Prony' s approximationProny’s method
• Using :
• Let:
• One can show:
( )
∑
=≈
N i i it
t
K
1)
exp(
β
α
(
) ( )
0 1 N t i i i i i iK t
X
d
I
I
I
X
τ
τ τ
β
α
=−
=
=
+
∑
∫
&
&
&
( )
0texp(
(
) ( )
)
i i iI t
=
∫
α
β
t
−
τ
X
&
τ τ
d
Prony’s method
• Let define the state vector
• The equation of motion can be rewritten in the form an ODE of first order
( )
( ) (
)
1 1 , , Nex i H drag PTO others
i t X t M F I K X F F F I I X
µ
β
α
− ∞ = = = + − − + + + = + ∑
Y F I F I & & & & iX
X
I
=
Y
&
Calculation of coefficients with Prony.m
PURPOSE:
• Identification of function K using Prony’s method
INPUTS
• T time vector
• K function to be identified OUTPUTS
• Arrays of alpha and beta coefficients
Frequency Domain Identification (FDI)
• State space approximation directly from frequency domain coefficients(FDI, Perez & Fossen)
• Approximation using a rational fraction:
( )
0t(
) ( )
radF
t
= −
µ
∞&&
z
−
∫
K t
−
τ
z
&
τ τ
d
( )
( )
(
( )
)
K j
ω
=
B
ω
+
j
ω
A
ω µ
−
∞ Fourier transform( )
P s
( )
( )
K s
Q s
≈
www.marinecontrol.org andpapers by Perez & Fossen for more details
Frequency Domain Identification (FDI)
• Using:
• One can show:
( )
( )
( )
1 1 0 1 1 0...
...
r r r r n n nP s
p s
p s
p
K s
Q s
s
q
s
q
− − − −+
+ +
≈
=
+
+ +
(
) ( )
[
]
( )
( )
( )
{
( )
1 1 0 0 1 2 01
1
0
0
0
0
1
0
0
0
0
0
0
t r r n nK t
X
d
p
p
p
p I t
q
q
q
I t
I t
X t
τ
τ τ
− − −−
=
−
−
−
=
+
= +
∫
R R B A&
L
L
&
&
O
14444244443
Frequency domain identification
• Let define the state vector• The equation of motion can be rewritten in the form an ODE of first order
( )
( ) (
)
1 1 1 1 , , rex r i i H drag PTO others
i F t X t I M
µ
F p I K X F F F + − ∞ + − = = = + − − + + + = + ∑
Y I F I A I B X & & & &X
X
=
Y
I
&
Frequency domain identification
• How to compute the coefficients of the FDI?1 Matlab routine invfreqs:
[P,Q] = invfreqs(K,w,r,n)
2 FDI toolbox from Perez & Fossen (www.marinecontrol.org)
[P,Q]=FDIRadMod(w,A33,Mu33,B33,FDIopt,Dof)
( )
( )
( )
1 1 0 1 1 0 ... ... r r r r n n n n P s p s p s p K s Q s q s q s q − − − − + + + ≈ = + + + Coefficients Discrete Transfer function Discrete frequency vector Guess of orders r < n1
1
nq
n
r
=
= +
From the physics, the approximation must follow these constraints
Issues with state-space approximation
• Passivity : the radiation force dissipates energy. For the some frequencies, it may not be the case with the
approximation divergence of numerical model 1 With Prony method:
2 With FDI (necessary condition)
( )
∑
=≈
N i i it
t
K
1)
exp(
β
α
( )
β
i0
ℜ
<
( )
( )
k 0 P j Q jω
ω
ℜ > Summary
• Convolution product can be replaced by a state space model
• Coefficients of the state space model can be derived using:
– Prony’s method in Time domain – Frequency Domain Identification
• Matlab routine invfreqs • Perez & Fossen toolbox
Excitation force
Measurement Directional Unidirectional Regular Wave spectrum Wave elevation Incident wave model ( , , )(
i t)
I O t Ae ω η β = ℜ − ( ) ( ) 2 S f ω f π δ = ( ), i j i t I j j O t A e eϕ ω η = ℜ − ∑
( ), i j i t I jl l j O t A e eϕ ω η = ℜ − ∑∑
( , , ) I l l O t η β∑
Random phasesDirections need to be identified
2 f ω = π − − = 4 212/ 2 2 5 ) ( σ γ α f e f T B e f A f S 09 . 0 1 07 . 0 1 1 1 = > = < σ σ T f T f 2 1/3 4 4 1 1 5 5 1 16 4 H A B T T = =
( )
2 j j A = S f ∆f(
)
2 , lj l j A = S β f ∆ ∆f θ( )
θ θ S f D f S( , ) = ( ) ( ) − = 2 cos2 0 θ θ θ s D DExcitation force
Measurement Directional Unidirectional Regular
Wave excitation force Wave elevation Incident wave model ( , , )
(
i t)
I O t Ae ω η β = ℜ − ( )(
( ))
, O i t ex ex F t = ℜ AF% β ω e−ω ( )(
,)
j j ex i O i t j ex j j F t A eϕ β ω e−ω = ℜ ∑
F % ( )(
,)
jl j ex i O i t jl ex l j l j F t A eϕ β ω e−ω = ℜ ∑∑
F % ( , , ) I O l t η β∑
( ) ( ) ( ) ex F t β τ η β τ τ ∞ = −∑∫
Directions need to be identified
( ), i j i t I j j O t A e eϕ ω η = ℜ −
∑
( ), i j i t I jl l j O t A e eϕ ω η = ℜ − ∑∑
Random phases( )
2 j j A = S f ∆f(
)
2 , lj l j A = S β f ∆ ∆f θMay be used in exercise 4 : FD2TDex.m
PURPOSE:
• Calculate force impulse response function in time domain using frequency domain coefficients according to:
INPUTS
• w frequency vector
• Fex excitation force coefficients
• T time vector
OUTPUTS
• Kex force impulse response function
Cf help FD2TDex
( )
1 0(
(
)
)
, , , O i t ex ex K β t F O β ω eω dω π ∞ =∫
ℜ %Calc. of wave force with wave measurement
• Force impulse response function Kex
• Calculation of wave excitation force Fex
( )
,
1
0(
(
, ,
)
)
O i t ext
exO
e
d
ωβ
β ω
ω
π
∞ −=
∫
ℜ
K
F
%
( )
0(
) (
)
, , , ex tβ
tτ η
ex Oβ τ τ
d ∞ −∞ =∫
ex − F K