Time domain modeling
Equationof motion of a WEC Frequency domain: Ok if all effects/forces are linear M+ A ω X && % ω = F% ω K + K X% ω B ω + B X% & ω ( ) H PTO PTO + others Time domain: Must be linear If non linear effects/forces are involved (and significant) Examples: PTO, control, drag effects, moorings, hydrostatic F t && & M + µ X = F t K X K t τ X τ dτ + F H rad PTO + others t = K β, t τ η O, β, τ dτ
Outline: Integration in time of the equation of motion State space approximation of the memory term in the radiation force Excitation force
Time integration of the equation of motion
Equation of motion in time domain Can depend on X (non linear mechanics) t && & PTO force Other forces (moorings, wind, Coriolis forces ) M + µ X = F K t τ X τ dτ K X + F + F + F H drag PTO others Fluid/structure interactions It is a second order ODE (Ordinary Differential Equation): X & = g t, X, X& But available time integration schemes are for first order ODE S & = f t, S How to deal with that?
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 F F F X K d X t K F M X S t f S t f S ) (,, τ τ τ µ & & & = 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: t n = n t n S = S ( n t ) Discretisation of the memory term by the trapezoidal rule (second order accuracy) t n n n n j j K( t τ ) X& τ dτ = K X& + K X& t + K X& t + O t 2 ( ) ( 2 ) j= If K and X are sampled at the same times
Discrete equation of motion S& = f t S ( n n, S ) (, ) n n n f t X& n n ( n n ) n j j = F + K X& + K X& t + K X t & ( M µ ) 2 + j= n n n n KH X + Fdrag + FPTO + F others n
The simplest time integration scheme Numerical time derivation n+ S S S& n = t From which: S S n+ = S = S n + S n+ n & n + f n + O t + O ( t) ( t) ( n n t, S ) t + O( t) Never used in practice It is called Euler plicit scheme Advantage: Simple Drawbacks: Poor accuracy (first order), unstable (divergence)
Second order time integration scheme Two steps scheme: Step : calculate the velocity k at t n Step 2: make a prediction of the state at t n+ and calculate the velocity k 2 at t n+ Advance in time using: = f ( t n S n ) ( n+ n = f t S + k t) k, k S 2, n+ ( k + k ) t Second order scheme, same as for discretisation of convolution product May be used in practice = S n + 2 2
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: n n n S& = f t, S n X& n ( n n ) n ( n n, ) n j j F K X K X t K X t f t S = + & + & + & ( M ) 2 + µ j= n n n n KH X Fdrag FPTO F + + + others 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?)
May beused in ercise 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 µ A ω Krad τ ωτ dτ ω [ ] = + [ ] sin 2 Krad t B ω ωτ dω π [ ] = cos OUTPUTS K retardation function Mu added mass Cf help FD2TD
For ercise 4 time domain modelling Make your own RK2 solver or use MATLAB ode45 Use of ode45:. 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 Start and end time of simulation Initial conditions
State space approximation of the memory term of the radiation force
Direct calculation of the memory term t n K( t τ ) X& τ dτ = K X& + K X& t + K X& t + O t 2 ( n n ) n j j ( 2 ) j= 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 t K t τ X & τ d τ = g I I& = h( I, X& ) New states variables
Prony s method Approximation using Prony s method : K N ( t) i= α i p(β t) i Compl constants calculated by Prony s method
Prony s method Force (N/m.s) 3 2 - K Prony' s approximation -2 2 4 6 8 time (s) K N ( t) i= α i p(β t) i
Prony s method Using : Let: K N ( t) i= α i p(β t) t I ( t) = α p( β ( t τ )) X& ( τ ) dτ i i i i One can show: t K t τ X& τ dτ = I I& = β I + α X& i i i i N i= i
Prony s method Let define the state vector Y X = X& I i The equation of motion can be rewritten in the form an ODE of first order ( t, ) Y& = F I F X& N t = M + F I K X + F + F + F I& i = βiii + αi X& (, I) ( µ ) i= i H drag PTO others
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 Cf help Prony
Frequency Domain Identification (FDI) State space approximation directly from frequency domain coefficients(fdi, Perez & Fossen) F rad t = µ && z K t τ z& τ dτ Approximation using a rational fraction: K s P s Q s t Fourier transform K ( jω ) = B( ω) + jω A( ω ) µ The unknowns are the compl coefficients of polynomials P and Q www.marinecontrol.org and papers by Perez & Fossen for more details
Frequency Domain Identification (FDI) Using: K s One can show: t r P s prs + p s +... + p = n Q s s + q s + + q r r n n... ( ) & = [ L ] K t τ X τ dτ p p p p I t qn qn 2 L q I& ( t) = I ( t) + X& t O 4444244443 { ( n = r + ) A R r r B R
Frequency domain identification Let define the state vector Y X = X& I The equation of motion can be rewritten in the form an ODE of first order Y& F = (, I) F t X& r+ t I = M + F p I K X + F + F + F I& = ARI + BRX& (, ) ( µ ) r+ i i H drag PTO others i=
Frequency domain identification How to compute the coefficients of the FDI? K s r P s prs + p s +... + p = n Q s q s + q s + + q r r n n... Matlab routine invfreqs: [P,Q] = invfreqs(k,w,r,n) Coefficients 2 FDI toolbox from Perez & Fossen (www.marinecontrol.org) From the physics, the approximation must follow these constraints n Discrete Transfer function q n = n = r + [P,Q]=FDIRadMod(w,A33,Mu33,B33,FDIopt,Dof) Cf help FDIRadMod & Perez, Fossen (29) Guess of orders r < n Discrete frequency vector
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 With Prony method: K N ( t) i= α i p(β t) i R ( β ) i < 2 With FDI (necessary condition) ( ωk ) ( ω ) P j R > Q j k
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
Excitation force Incident wave model Wave elevation Wave spectrum Regular Unidirectional Directional Measurement η η I I i t (, β, ) ηi O t Ae ω j O, t A e e = R S ( f ) = δ ( f ) iϕ iωt = R j j Aj = 2S ( f j ) f iϕ j iωt O, t = R Ajle e l j Random phases ( β ) A = 2 S, f f θ lj l j Directions need to be identified ηi ( O, βl, t) l S( f ω = 2π f A ) = α f 5 e B f 5 H 5 A = = 6 T 4 2 /3 B 4 4 T 4 e γ ω 2π f 2 T 2 / 2 2 σ S ( f, θ ) = S( f ) D θ D θ θ 2 = cos 2 s θ D f < T f > T σ =.7 σ =.9 Picture from D-J Doong, B-C Lee, C.C. Kao, (2)
Excitation force Incident wave model Wave elevation Wave citation force Regular i t (, β, ) ηi O t Ae ω ( i t ) O = R = R F % ( β, ω) F t A e ω Unidirectional Directional Measurement η η I I iϕ iωt = R j j j O, t A e e Aj = 2S ( f j ) f iϕ j iωt O, t = R Ajle e l j Random phases ( β ) A = 2 S, f f θ lj l j Directions need to be identified ηi ( O, βl, t) l F R F t R F t l ( t) ϕ j A e F % j = ( β, ω ) i O iω jt j j e ϕ jl A e F % l = = j ( β, ω ) i O iω jt jl l j e (, ) (,, ) K β t τ η O β τ dτ O l I l
May beused in ercise 4 : FD2TD.m PURPOSE: Calculate force impulse response function in time domain using frequency domain coefficients according to: INPUTS w frequency vector F citation force coefficients T time vector OUTPUTS K force impulse response function O ( iωt K, (,, ) ) β t = R F% O β ω e dω π Cf help FD2TD
Calc. of wave force with wave measurement Force impulse response function K O (, ) ( (,, ) iωt K ) β t = R F % O β ω e dω π Calculation of wave citation force F F = K (, ) (,, ) t β t τ η O β τ dτ See ample in FDI.m