You are on page 1of 111

46211 Offshore Wind Energy

Report 5: Dynamic model for simplified OC3-Hywind concept

By:
Lucas Gomes de Camargos Silveira (s1717123)
Pengfei Lu (s110987)

November 27, 2018


Report 5: Dynamic model for simplified OC3-Hywind concept

Introduction
The third report concerns a dynamic model of a simplified version of the OC3-Hywind floating wind
turbine. Details of this study can be found in the document of [1] which is available on the web. The
report consists of three parts: model formulation, dynamic analysis and adaption of pitch control.

Figure 1: Definition sketch

1 Part 1: Model formulation


Consider the floating wind turbine in figure 1. It consists of a spar buoy, a tower, a rotor and a
nacelle which are all rigidly connected. In this simplified model, 2D motion is assumed with 2 degrees
of freedom: surge and pitch. The wind turbine is moored by a simple linear spring which supplies a
horizontal mooring force at the attachment point, whenever it’s horizontal position differs from the
rest position.

The wind turbine is subject to an external wind load, acting horizontally at the hub-height and hydro-
dynamic forces from linear waves, added mass and damping. The parameters defining the model are
given below.

1
Report 5: Dynamic model for simplified OC3-Hywind concept

MF loater = 7466330 kg
zCM,F loater = −89.92 m
IF loater,CM = 4229230000 kg m2
zCM,T ower = 43.4 m
IT ower,CM = 1.217 · 108 kg m2
MN acelle = 240 · 103 kg
MRotor = 110 · 103 kg
zHub = 90 m
DSpar = 9.4 m
zBot = −113.4 m
CM = 1.0
CD = 0.60
ρW ater = 1025 kg/m3
g = 9.81 m/s2
h = 320 m
KM oor = 41180 N/m
zM oor = −70 m
A dynamic model for the surge and pitch motion of point of flotation (O) can be written as:
   
ẍ0 FM oor + F̃Hydrodynamic + fW ind
M = (1)
θ̈ τBuoy + τM oor + τ̃H ydrodynamics + τW ind
In the model formulation, the surge and pitch deflections can be assumed small. Hereby e.g. small-
angle approximations can be used for θ.

1.1 Question 1
Calculate the position of the center of mass (zG ), the total mass Mtot and the moment of inertia
around point O, I0 .

The total mass of the wind turbine is the sum of it’s components mass, eq.(??). The turbine centre
of gravity is calculated by the weighted average of the centre of gravity of its components, eq.(??).

mt = mF loater + mT ower + mN acelle + mRotor = 8.066e + 06 [kg] (2)

zCM,F loater · mF loater + zCM,T ower · mT ower + ZHub · mN acelle + zHub · mRotor
zG = (3)
mt
zG = −77.985 [m] (4)
Before calculating the wind turbine moment of inertia around the point O, it’s necessary to calculate
the moment of inertia of the components around the point O from the values around their respective
centre of mass, eq.(??).

2
IF loater = IF loater,CM + mF loater · zCM,F loater
2
IT ower = IT ower,CM + mT ower · zCM,T ower
2
(5)
IN acelle = mN acelle · zHub
2
IRotor = mRotor · zHub

2
Report 5: Dynamic model for simplified OC3-Hywind concept

The moment of inertia is then the sum of the values of the individual components, eq(??).

I0 = IF loater + IT ower + IN acelle + IRotor = 6.803e + 10 [N m2 ] (6)

1.2 Question 2
Express the local surge displacement x (z) as function of (x0 , θ)

The horizontal displacement of a point distant z from the point O its found as a function from the
horizontal displacement of point O,i.e. the surge x0 , and the pitch angle θ applying trigonometric
relations, eq.(??). For small values of pitch angles, the sinus of the angle is approximately equal to
the angle value in radians.

x(t, z) = x0 (t) + z · sin θ(t) ≈ x0 (t) + z · θ(t) (7)

1.3 Question 3
Express FM oor and τM oor as function of (x0 , θ)

The mooring is modeled as a single spring of stiffness KM oor located at zM oor . The mooring is then
a function the spring stiffness and the horizontal displacement at zM oor , eq.(??). Applying eq.(??)
in eq.(??), the mooring force can then be expressed as a function of the surge x0 and pitch angle θ.
Assuming small pitch angles, the vertical components of the mooring force can be neglected. The
vertical distance of the point of application of the mooring force can be approximated by zM oor , then
the mooring moment around the point O can be expressed by eq.(??).

FM oor (t) = −KM oor · xM oor = −KM oor · (x0 + zM oor · θ) (8)

τM oor (t) = FM oor · zM oor = −KM oor · zM oor · (x0 + zM oor · θ) (9)

1.4 Question 4
Express the restoring moment from gravity and hydrostatic forces τrestore as function of (x0 , θ).

The buoyancy force is equal to the weight of the water volume displaced by the wind turbine, eq.(??).

FB = ρw · g · V (10)
The restoring moment τrestore is equal to the buoyancy force multiplied by the moment arm

τrestore = FB · GZx (11)


where the moment arm GZx can be found from geometric relations between the distances in relation
to the metacentre:

GZx = GMx · sinθ ≈ GMx · θ (12)


GMx = KB + BMx − KG (13)
zBot
KB = (14)
2
DSpar 4
 
Ix π
BMx = = (15)
V 4·V 2
KG = |zBot − zg | (16)

3
Report 5: Dynamic model for simplified OC3-Hywind concept

Thus, the restoring moment can be expressed as eq.(??).

zBot πDSpar 4
 
τrestore = ρw · g · V · + − |zBot − zg | · θ (17)
2 64V
where the volume of displaced water is given by eq.(??).
 2
Dspar
V = Aspar · |zBot | = π · · |zBot | (18)
2

1.5 Question 5
Express the integrated hydrodynamic force and moment F̃Hydrodynamic , M̃Hydrodynamic in terms of
(x0 ; θ) and their time derivatives, given that the horizontal force for a slice of the spar buoy of height
dz is

dF̃Hydrodynamic = ρw Cm A(u̇(z) − ẍ(z))dz + ρw Au̇(z)dz+


1 (19)
+ ρw CD D(u(z) − ẋ(z)) · |u(z) − ẋ(z)|dz
2
Here A, D are the cross-sectional area and diameter of the spar buoy at the up-right position.

Differentiating eq.(??) twice in time, introducing it in eq.(??) and re-arranging the terms, the former
can be written in as in eq.(??). Integrating eq.(??) from zBot to z = 0, the hydrodynamic force can
be expressed by eq.(??).

d2 x d2 x0 d2 θ
= + z (20)
dt2 dt2 dt2

dF̃Hydrodynamic = −ρw Cm Aẍ0 dz − ρw Cm Aθ̈0 zdz+


(21)
 
1
+ ρw (Cm + 1) Au̇ + ρw CD D (u − ẋ) |u − ẋ| dz
2

1 2
F̃Hydrodynamic = ρw Cm AzBot ẍ0 + ρw Cm AzBot θ̈+
2
Z 0   (22)
1
ρw (Cm + 1) Au̇ + ρw CD D (u − ẋ) |u − ẋ| dz
zBot 2

In a similarly fashion, moment from the hydrodynamic forces can be obtained by the integration in
eq.(??).
Z 0
τ̃Hydrodynamic = FHydrodynamic zdz (23)
zB ot

1 2 1 3
τ̃Hydrodynamic = ρw Cm AzBot ẍ0 + ρw Cm AzBot θ̈+
2 3
Z 0   (24)
1
ρw (Cm + 1) Au̇ + ρw CD D (u − ẋ) |u − ẋ| zdz
zBot 2

4
Report 5: Dynamic model for simplified OC3-Hywind concept

1.6 Question 6
Re-cast the model to the form
          
M11 M12 A11 A12 ẍ0 C C12 x0 F + FW ind
+ + 11 = Hydrodynamic (25)
M21 M22 A21 A22 θ̈ C21 C22 θ τHydrodynamic + τW ind
Give analytical expressions and numerical values for all the elements in M , A and C. Further give
analytical expressions for all the hydrodynamic forcing terms at the right hand side. Hint:The elements
of M can be found from the lecture slides. The elements of A and C can be identified from the answer
to question (3), (4) and (5).

According to the lecture slides:

   
mt mt · zg 8.07e6 −6.29e8
M= =
mt · zg I0 −6.29e8 6.80e10

where, I0 is the moment of inertia around point O.

Transpose eq.(??) to eq.(??):


     
ẍ0 FM oor F̃Hydrodynamic + FW ind
M − = (26)
θ̈ τBuoy + τM oor τ̃Hydrodynamics + τW ind
According to the comparison of eq.(??) and eq.(??),
    
A11 A12 ẍ0 FHydrodynamic − F̃Hydrodynamic
= (27)
A21 A22 θ̈ τHydrodynamic − τ̃Hydrodynamic
where, FHydrodynamic − F̃Hydrodynamic and τHydrodynamic − τ̃Hydrodynamic can be found as the first terms
in eqs. (??) and (??).
1 2
FHydrodynamic − F̃Hydrodynamic = −ρw Cm AzBot ẍ0 − ρw Cm AzBot θ̈ (28)
2
1 2 1 3
τHydrodynamic − τ̃Hydrodynamic = − ρw Cm AzBot ẍ0 − ρw Cm AzBot θ̈ (29)
2 3
Thus,
1 2
A11 ẍ0 + A12 θ̈ = −ρw Cm AzBot ẍ0 − ρw Cm AzBot θ̈ (30)
2
1 2 1 3
A21 ẍ0 + A22 θ̈ = − ρw Cm AzBot ẍ0 − ρw Cm AzBot θ̈ (31)
2 3

−ρw Cm AzBot − 12 ρw CM AzBot 2


   
8.07e6 −4.57e8
A= = (32)
− 12 ρw CM AzBot
2 − 31 ρw Cm AzBot
3 −4.57e8 3.46e10
Also, by comparison of eq.(??) and eq.(??):
    
C11 C12 x0 FM oor
=− (33)
C21 C22 θ τBuoy + τM oor

Thus,
C11 · x0 + C12 · θ = −(−KM oor · (x0 + zM oor · θ)) (34)
Similarly,

5
Report 5: Dynamic model for simplified OC3-Hywind concept

C21 · x0 + C22 · θ = −(τBuoy − KM oor · zM oor · (x0 + zM oor · θ)) (35)


where,
τBuoy = τrestore (36)
Thus,
C11 = KM oor (37)

C12 = KM oor · zM oor (38)

C21 = KM oor · zM oor (39)

zBot πDSpar 4
 
C21 = KM oor · zM oor + τBouy = KM oor · zM oor + ρw · g · V · + − |zBot − zg | · θ (40)
2 64V

The numerical values of C:

 
4.12e4 −2.88e6
C=
−2.88e6 1.89e9

The hydrodynamic forcing terms are the second terms in eqs. (??) and (??):
Z 0  
1
FHydrodynamic = ρw (Cm + 1) Au̇ + ρw CD D (u − ẋ) |u − ẋ| dz (41)
zBot 2
Z 0  
1
τHydrodynamic = ρw (Cm + 1) Au̇ + ρw CD D (u − ẋ) |u − ẋ| zdz (42)
zBot 2

1.7 Question 7
With basis in the homogeneous version of (3), estimate the natural frequencies for surge and pitch.

According to eq.(??), the natural can be estimated by setting F equals to 0.


   
ẍ0 x
M+A +C 0 =0 (43)
θ̈ θ
Assume a harmonic solution:  
ẍ0
= Xeiωt (44)
θ̈
Thus,

−ω 2 (M + A)X + CX = 0 (45)
Each side of the equation multiplied by the inverse matrix (M + A)−1 :

−ω 2 X + (M + A)−1 CX = 0 (46)

(M + A)−1 CX = ω 2 X (47)
The eigenvalue ω 2 thus can be computed based on (M + A)−1 C, and the natural frequency can be
obtained subsequently. The resutls are shown in Tab.??.

6
Report 5: Dynamic model for simplified OC3-Hywind concept

ω
f= (48)

Table 1: Natual frequencies for surge and pitch

fsurge [Hz] fpitch [Hz]


0.008 0.0381

2 Part 2: Dynamic analysis


The second part concerns the numerical implementation of the model and analysis of the results. The
test-runs follows selected load cases in [1].

General hint: When calculating time series with stochastic forcing, a length of 600 s additional to the
initial transient behaviour should be considered. The analysis should concern this part of the signal
only.

The cut-off frequency for the spectra can be taken as fhighcut = 0.5Hz. The frequency resolution
df = 1/TDur must be used where TDur is the duration of the simulation. It is recommended to specify
the times for the ode solver by choosing ‘tspan = [0 : dt : T dur − t]’ with dt = 0.1s.

2.1 Question 8
Re-write (3) to a first-order system by introducing the state vector
   
q1 x0
q2   θ 
q= q3  = ẋ0 
   (49)
q4 θ̇
The first-order system must have the form:

dq 
= f t, q (50)
dt

Express f t, q in terms of the quantities in (3).

The first two terms of f (t, q) can be determined directly.

dq
(1) = ẋ0 = q3 (51)
dt
dq
(2) = θ̇ = q4 (52)
dt
For the last two terms,
dq
(3) = ẍ0 (53)
dt
dq
(4) = θ̈ (54)
dt
Express x¨0 and θ̈ in terms of q, since
   
ẍ0 x
(M + A) +C 0 =F (55)
θ̈ θ

7
Report 5: Dynamic model for simplified OC3-Hywind concept

Thus,
      
ẍ0 x0 q
−1
= (M + A) F − (M + A) C −1
= (M + A) −1
F−C 1 (56)
θ̈ θ q2
 
q3
 q4 
f (t, q) =     (57)
q
(M + A)−1 F − C 1
 
q2

2.2 Question 9
Write a matlab program that solves (??) using the Matlab ode4 or ode45 solver. Initially, the hy-
drodynamic forcing and wind forcing can be left out. Introduce a linear damping term B11 ẋ0 with
B11 = 105 N/(m/s) into the left-hand side of the surge equation in (3) and include this in the Matlab
program.

Eq.(??) was rewritten as eq.(??) to account for the damping term, where the B is given by eq.(??).
A Matlab program, attached in the appendix, was written using the Matlab Runge-Kutta code ode4
to integrate the differential equation eq.(??).

             
M11 M12 A11 A12 ẍ0 B11 B12 ẋ0 C C12 x0 F + FW ind
+ + + 11 = Hydrodynamic (58)
M21 M22 A21 A22 θ̈ B21 B22 θ̇ C21 C22 θ τHydrodynamic + τW ind

 5 
10 0 N
B= (59)
0 0 m/s

2.3 Question 10
Solve the equations of motion for two decay tests in surge and pitch, respectively: First solve with
an initial condition of q = [1 0 0 0]T for a time period of 600 s. Next solve for the initial condition
q = [0 0.1 0 0]T . Present time series of surge and pitch. Demonstrate by analysis of the results that
the numerical model has the same natural frequencies as found in question 7. Are the surge and pitch
motions coupled?

The code written in question 9, attached in appendix, was used to integrate the differential equa-
tion (??) for the two initial conditions defined in the text: in the 1st case a surge displacement of
1 meter is applied in the t = 0, and 2sd an pitch angular displacement of 0.1 radians is applied at t = 0.

For the 1st initial conditions, the surge and pitch time series are show in fig.(??) and (??) respectively.
Their response in the frequency domain, i.e. their power spectrum densities, are shown in figs.(??)
and (??). It can be seen in fig.(??) that the surge PSD shows a peak at the first eigenfrequency,
table (??). In fig.(??) it can be seen that the pitch PSD shows a large peak corresponding to the first
eigenfrequency and a small peak in the second eigenfrequency.

8
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) x0 time series (b) x0 PSD

Figure 2: Surge time series and power spectrum density for initial condition 1, x0 (0) = 1

(a) θ time series (b) θ PSD

Figure 3: Pitch time series and power spectrum density for initial condition 1, x0 (0) = 1

For the 2nd initial conditions, the surge and pitch time series are show in fig.(??) and (??) respectively.
Their PSD are shown in figs.(??) and (??). It can be seen in fig.(??) that the surge PSD shows a
large peak corresponding to the first eigenfrequency and a small peak in the second eigenfrequency.
In fig.(??) it can be seen that the pitch PSD shows a peak in the first eigenfrequency.

9
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) x0 time series (b) x0 PSD

Figure 4: Surge time series and power spectrum density for initial condition 2, θ(0) = 0.1

(a) θ time series (b) θ PSD

Figure 5: Pitch time series and power spectrum density for initial condition 2, θ(0) = 0.1

Both in figs.(??), (??), (??) and (??) shows the damping effect of B11 , i.e. the energy present in the
system is being reduced with time.

Figures (??) and (??) show that an initial surge condition results in a pitch oscillation and vice versa,
demonstrating the coupling between the surge and pitch motions.

2.4 Question 11
Include the hydrodynamic forcing terms. For simplicity, the hydrodynamic forcing is only computed up
to the still water level. No Wheeler stretching is therefore needed. Repeat the decay tests of question
10 and compare the time series. Discuss the results.

The Matlab code developed for question 10 was modified to introduce the second terms of eqs. (??)
and (??). The code was applied with the same initial conditions as in question 10: q 0 = [1 0 0 0]T for
the 1st case and q 0 = [0 0.1 0 0]T for the 2sd case.

10
Report 5: Dynamic model for simplified OC3-Hywind concept

For the 1st initial conditions, the surge and pitch, with and without the hydrodynamic components,
are show in fig.(??) and (??) respectively and Their PSD are shown in figs.(??) and (??) respectively.
For the 2nd initial conditions, the surge and pitch are show in fig.(??) and (??) respectively and Their
PSD are shown in figs.(??) and (??) respectively.

From figs. (??), (??), (??), (??), it is observed a reduction in the amplitude of surge and pitch when
the hydrodynamic forces are taken into account. In the 1st scenario, the difference is relative small
while the reduction in the surge and pitch amplitudes are more important in the 2nd scenario.

This reduction of surge and pitch amplitudes after the introduction of the hydrodynamic components
are consistent with the proportionality with ẋ|ẋ| of last term in eqs.(??) and (??), thus acting in the
sense of damping further the amplitude of the surge and pitch oscillations.

(a) x0 time series (b) x0 PSD

Figure 6: Surge time series and power spectrum density for initial condition 1, x0 (0) = 1

(a) θ time series (b) θ PSD

Figure 7: Pitch time series and power spectrum density for initial condition 1, x0 (0) = 1

11
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) x0 time series (b) x0 PSD

Figure 8: Surge time series and power spectrum density for initial condition 2, θ(0) = 0.1

(a) θ time series (b) θ PSD

Figure 9: Pitch time series and power spectrum density for initial condition 2, θ(0) = 0.1

2.5 Question 12
Compute the motion for a regular wave of H = 6 m and T = 10 s. The wave kinematics for the wave
forcing can be computed at the position of the un-deflected spar buoy. Present time series for surge
and pitch and discuss their behaviour. Note that the initial condition should be changed from the one
associated with the decay tests.

Fig.(??) and fig.(??) illustrate the surge and pitch varying with time for the linear wave only con-
dition, where the initial condition was set as q = [0 0 0 0]T . In the beginning, it is the transient
motion, where the fluctuations of both surge and pitch are relatively large. For surge motion, it can
be observed that the fluctuation consists of mainly two parts: one with large period and one with
small period, and the fluctuation with large period tends to be damped, whereas the fluctuation with
a smaller period tends to be at a certain amplitude. For the pitch motion, the fluctuation damps to
a stable oscillation after certain time, and only one obvious period can be observed.

Fig.?? and Fig.?? show the PSDs for surge and pitch, where the natural frequencies are denoted in
red and green lines, respectively. By comparison of fig.(??), fig.(??) and fig.(??), fig.(??), it is likely

12
Report 5: Dynamic model for simplified OC3-Hywind concept

that for the surge motion, the frequency of the large period fluctuation is close to the frequency of the
surge natural frequency. For both the surge and pitch motions, the frequencies of the small period
fluctuations are most likely the frequency of the wave, which is 0.1 Hz.

(a) x0 time series (b) x0 PSD

Figure 10: Surge x0 time series and power spectrum density, for linear wave only condition

(a) θ time series (b) θ PSD

Figure 11: Pitch θ time series and power spectrum density, for linear wave only condition

2.6 Question 13
Include wind forcing into the model. The wind force is determined in the following way — here based
solely on Vrel .
1
Fwind = ρair ARotor CT Vrel |Vrel | (60)
2

Vrel = Vhub − ẋhub (61)

13
Report 5: Dynamic model for simplified OC3-Hywind concept

(
CT = h CT 0 i Vrel ≤ VRated
b
CT 0 · exp −a (Vrel − VRated ) Vrel > VRated
CT 0 = 0.75
a = 0.25
b = 0.86
VRated = 11.4 m/s
ρair = 1.29 kg/m3
DRotor = 126 m

Reproduce the results from question 12 with addition of a steady wind of 8 m/s at the hub height.
Compare the results to those from question 12. How does the steady wind affect the amplitude of the
wave-induced motions?

Equations (??) and (??), corresponding to the last terms of eq.(??), were introduced in the code. The
pitch time series and PSD are show in figs. (??) and (??) respectively together with the curves with
the curves obtained in question 12, where no wind forcing was present. The surge time series and
PSD are show in figs. (??) and (??) respectively.

τW ind = FW ind · zHub (62)

(a) x0 time series (b) x0 PSD

Figure 12: Surge time series and power spectrum density with and without steady wind

14
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) θ time series (b) θ PSD

Figure 13: Pitch time series and power spectrum density with and without steady wind

It’s observable from figs. (??) and (??) that a constant wind forcing has an impact on the maximum
values of surge and pitch, dislocating up its curves. However the amplitudes of oscillation after the
transient period remain unchanged both for the surge and the pitch.s

2.7 Question 14
Repeat the calculations from question 13, but replace the wave forcing by irregular waves (JONSWAP,Hs
= 6 m, Tp = 10 s, γ = 3.3). Present the results as time series for surge and pitch as well as power
spectra. Analyze the power spectra: which motions are induced by the wind and which are induced
by the waves? What causes the peaks observed? Remember to leave out the initial transient for the
analysis.

Fig.?? and Fig.?? illustrate the surge and pitch motion of time series for the irregular wave and steady
wind condition, while Fig.?? and Fig.?? are the PSD, i.e the power spectrum density, for surge and
pitch, where the natural frequencies are denoted in red and green lines, respectively. When computing
the PSDs, the initial transient, i.e. the first 600s was left out.

(a) x0 time series (b) x0 PSD

Figure 14: Surge x0 time series and power spectrum density, for irregular wave and steady wind
condition

15
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) θ time series (b) θ PSD

Figure 15: Pitch θ time series and power spectrum density, for irregular wave and steady wind condition

Fig.?? and Fig.?? also show the Jonswap spectrum. Compared with Fig.?? and Fig.??, it can be
observed that the PSDs for both surge and pitch peak at the frequency at which the wave spectral
density also attains the peak, i.e. around 0.1 Hz. Thus, both the surge and pitch motions have
harmonics excited by the wave loads. Besides, one small peak can be observed at the surge natural
frequency, excited by the wave.

On the other hand, the PSD of the pitch shows no important peaks in the natural frequencies with
comparison to the harmonics with frequencies close to wave excitation, leading to the conclusion that
on this scenario the surge is mostly induced by the wave loads.

2.8 Question 15
Extend the wind forcing to include a Kaimal wind spectrum. The following formulation of the spectral
density function for the fluctuating part of the wind speed can be used.

4I 2 V10min l
SW ind =  5 (63)
1 + 6 V10f l
3

min

Compute the motion of the wind turbine subject to irregular waves (JONSWAP, Hs = 6 m,Tp = 10
s,γ = 3.3) and a Kaimal wind climate of V 10min = 8 m/s, I = 0.14; l = 340.2 m. Present the
results as time series for surge and pitch as well as power spectra. Analyze the power spectra: which
motions are induced by the wind and which are induced by the waves? What causes the peaks observed?

The surge and pitch motion of time series for the irregular and unsteady wind condition are illustrated
as in Fig.?? and Fig.??, while Fig.?? and Fig.?? are the PSDs, i.e the power spectrum density, for
surge and pitch, respectively. Again, the initial transient, i.e. the first 600s was left out when com-
puting the PSD. Fig.?? and Fig.?? illustrate the comparisons between the PSDs and the Jonswap,
Kaimal spectrums.

16
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) x0 time series (b) x0 PSD

Figure 16: Surge x0 time series and power spectrum density, for irregular wave and steady wind
condition

(a) θ time series (b) θ PSD

Figure 17: Pitch θ time series and power spectrum density, for irregular wave and steady wind condition

17
Report 5: Dynamic model for simplified OC3-Hywind concept

Figure 18: Comparison of PSD for surge and Kaimal spectrum, Jonswap spectrum for irregular wave,
unsteady wind

18
Report 5: Dynamic model for simplified OC3-Hywind concept

Figure 19: Comparison of PSD for pitch and Kaimal spectrum, Jonswap spectrum for irregular wave,
unsteady wind

The surge PSD as shown in Fig. ?? illustrates that most of the energy is concentrated in the harmonics
of frequencies of the wind excitation, where the first peak is induced by the wind, and the second is
close to the surge natural frequency and also exicted by the wind.

On the other way, by comparison of the pitch PSD and the Jonswap, Kaimal spectrums, it can be
observed that the pitch PSD curve on Fig. ?? has peaks on the frequencies both of the wave excitation
and the wind excitation, suggesting the both wind and wave excitation have important contributions.
The first peak is induced by the wind, the second peak is close to the pitch natural frequency and
excited by the wind, and the third is induced by the wave.

3 Part 3: Adaption of pitch control for dynamic stability


3.1 Question 16
Consider a load case of steady wind with no oscillatory components and no waves. Compute the mo-
tion for 900 s for (a) V10 min = 10 m/s and (b) V10 min = 16 m/s. Explain why the floater pitch motion
is different for the two cases.

The code developed for question 15 was modified to consider no waves, i.e. u = 0 m/s, and two
scenarios of constant wind VW ind = 10 m/s and VW ind = 16 m/s, bellow and greater the rated value

19
Report 5: Dynamic model for simplified OC3-Hywind concept

respectively.

For the 1st scenario, the surge time series and PSD is shown in figs. (??) and (??) and the pitch
time series and PSD are shown in figs. (??) and (??). For the 2nd scenario, the surge time series and
PSD is shown in figs. (??) and (??) and the pitch time series and PSD are shown in figs. (??) and (??).

(a) x0 time series (b) x0 PSD

Figure 20: Surge time series and power spectrum density for a constant wind speed of 10 m/s

(a) θ time series (b) θ PSD

Figure 21: Pitch time series and power spectrum density for a constant wind speed of 10 m/s

20
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) x0 time series (b) x0 PSD

Figure 22: Surge time series and power spectrum density for a constant wind speed of 16 m/s

(a) θ time series (b) θ PSD

Figure 23: Pitch time series and power spectrum density for a constant wind speed of 16 m/s

In the 1st scenario, its observed one attenuation of the surge and pitch amplitudes with the time
while, in the 2nd scenario, both amplitudes tend to converge to a finite value different from zero. This
behaviour may be explained from shape of the wind trust, fig.(??). Below the rated value, the curve
slope is positive and the wind force and moment increase with the relative velocity Vrel = Vhub − ẋhub
in the direction to attenuate ẋhub . The opposite behaviour is observed at a wind velocity greater the
VRated where the wind force and moment decrease with the Vrel .

21
Report 5: Dynamic model for simplified OC3-Hywind concept

Figure 24: Wind Force

3.2 Question 17
For a real wind turbine the adjustment of CT to Vrel happens through dynamic control of the blade
pitch. As this involves mechanical motion, the adjustment is associated with a time lag. In the present
simplified model, the process can be represented by the following differential equation for CT

dCT
= −γ (CT − CT (Vrel )) (64)
dt
where γ is a constant.

Include CT as a fifth element of the state vector q and include (??) in the dynamic model. Demonstrate
that for gamma = 1.0, the new model gives similar results as in question 16(b).

The code implemented for the 2nd scenario of question 16 was modified to include the initial value
of CT in eq.(??) and integrate it in the Runge-Kutta code using the differential equation (??). The
surge time series and PSD are shown in figs. (??) and (??) and the pitch time series and PSD are
shown in figs. (??) and (??).

(a) x0 time series (b) x0 PSD

Figure 25: Surge time series and power spectrum density for a constant wind speed of 16 m/s

22
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) θ time series (b) θ PSD

Figure 26: Pitch time series and power spectrum density for a constant wind speed of 16 m/s

Although the amplitude oscillation values for the surge and the pitch tend to converge to lower values
as compared to the results obtained in the 2nd scenario of question 16, the motion is not attenuated
towards zero. From eq.(??), it may be reasoned that dCT /dt is too large and the trust coefficient is
varying too fast.

3.3 Question 18
Experiment with and suggest a value that reduces the floater pitch response of question 16(b). What
would this represent in a physical wind turbine?

Firstly, γ = 5.0 was set, and the corresponding surge and pitch series are shown in Fig.?? and Fig.??,
of which the oscillation is slightly larger than that of the time series when γ = 1.0, for both surge and
pitch. Secondly, a smaller γ, i.e. γ = 0.5 was set, as shown in Fig.?? and Fig.??, where the oscillation
of both surge and pitch are smaller than the scenario γ = 1.0, and tend to be damped. Thus, it can
be expected that with smaller γ, the surge and pitch motions are more likely to become steady.

(a) x0 time series (b) θ time series

Figure 27: Surge x0 and pitch θ time series, at γ = 5.0

23
Report 5: Dynamic model for simplified OC3-Hywind concept

(a) x0 time series (b) θ time series

Figure 28: Surge x0 and pitch θ time series, at γ = 0.5

Thus, at last, γ = 0.05 was set, and the results are illustrated in Fig.?? and Fig.??. It can be observed
that both of the surge and pitch are approximately steady after certain period, especially for the pitch.
Hence, γ = 0.05 can be used as a possible value which is able to reduce the floater pitch response of
Question 16(b).

According to fig.(??), it can be found that the continuous fluctuation of pitch motion is due to the
difference between the real thrust and the thrust required to be steady. Since it is obvious that CT
decay is slower when γ is smaller, thus one possible explanation is that a slower variation on CT will
reduce the undesired increment of trust in the direction of motion caused by the negative slope of the
CT curve above the rated power. In the real cases, smaller γ means slower pitch control.

(a) x0 time series (b) θ time series

Figure 29: Surge x0 and pitch θ time series, at γ = 0.05

24
APPENDIX
Matlab codes and functions
1 % Part 1
2

3 clear all ;
4 close all ;
5 clc ;
6

7 % Problem data
8 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
9 z CM Floater = −89.92; % [m]
10 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
11 m Tower = 2 4 9 7 1 8 ; % [ kg ]
12 z CM Tower = 4 3 . 4 ; % [m]
13 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
14 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
15 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
16 z Hub = 9 0 ; % [m]
17 D Spar = 9 . 4 ; % [m]
18 z Bot = −113.4; % [m]
19 C M = 1.0; % []
20 C D = 0.60;
21 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
22 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
23 h = 3 2 0 ; % [m]
24 K Moor = 4 1 1 8 0 ; % [N/m]
25 z Moor = −70; % [m]
26

27

28 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

29 % Q ue s ti on 1
30 % Mass and moment o f i n e r t i a
31

32 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


33

34 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
35

36 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
37 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
38 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
39 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
40

41 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


42

43 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

44 % Q ue s ti on 4
45 % Boyance f o r c e and moment
46
Report 5: Dynamic model for simplified OC3-Hywind concept

47 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
48 V = A Spar ∗ abs ( z B o t ) ;
49 F B = rho w ∗ g∗V;
50

51 % GM x = KB + BM x − KG
52 KB = abs ( z B o t ) / 2 ;
53 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
54 BM x = I x /V;
55 KG = abs ( z B o t − z g ) ;
56 GM x = KB + BM x − KG;
57 M x = F B ∗ GM x ;
58

59 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

60 % Q ue s ti on 6
61 % Matrix f o r m u l a t i o n
62

63 M( 1 , 1 ) = m t;
64 M( 1 , 2 ) = m t∗ z g ;
65 M( 2 , 1 ) = m t∗ z g ;
66 M( 2 , 2 ) = I t;
67

68 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
69 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
70 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
71 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
72

73 C = z e r o s ( s i z e (A) ) ;
74 C( 1 , 1 ) = K Moor ;
75 C( 1 , 2 ) = K Moor ∗ z Moor ;
76 C( 2 , 1 ) = K Moor ∗ z Moor ;
77 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
78

79 B = z e r o s ( s i z e (A) ) ;
80 B( 1 , 1 ) = 1 0 ˆ 5 ;
81

82 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

83 % Natural f r e q u e n c i e s
84

85 D = ( i n v (M+A) ) ∗C ;
86

87 omega2 = e i g s (D) ;
88 omega = s q r t ( omega2 ) ;
89 f r e q u e n c y = omega / ( 2 ∗ p i ) ;
90

91 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

2
Report 5: Dynamic model for simplified OC3-Hywind concept

92 % e x p o r t i n g a n sw e rs t o . t e x
93

94 f i l e I D = fopen ( ’ v a l p a r t 1 . t e x ’ , ’w ’ ) ;
95 fprintf ( fileID , ’ \\newcommand{\\ valmt }{%0.3 e }\n ’ , m t ) ;
96 fprintf ( fileID , ’ \\newcommand{\\ v a l z g }{%0.3 f }\n ’ , z g ) ;
97 fprintf ( fileID , ’ \\newcommand{\\ v a l I t }{%0.3 e }\n ’ , I t ) ;
98 fclose ( fileID ) ;
99

100 table name = ’ t a b n a t u r a l f r e q u e n c i e s ’ ;


101 table V = [ ” Frequency [ Hz ] ” ] ;
102 table C = [ ” $ f {1} $ ” ; ” $ f {2} $ ” ] ;
103 table f o r m a t = ’ %0.4 f ’ ;
104 func l a t e x t a b l e ( table name , t a b l e f o r m a t , f r e q u e n c y , t a b l e V , t a b l e C ) ;

3
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 10 a
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 H = 6 ; % [m]
33 T = 10; % [ s ]
34

35 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

36 % Mass and moment o f i n e r t i a


37

38 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


39

40 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
41

42 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
43 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
44 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
45 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
46

47 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


48

4
Report 5: Dynamic model for simplified OC3-Hywind concept

49 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

50 % Boyance f o r c e and moment


51

52 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
53 V = A Spar ∗ abs ( z B o t ) ;
54 F B = rho w ∗ g∗V;
55

56 % GM x = KB + BM x − KG
57 KB = abs ( z B o t ) / 2 ;
58 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
59 BM x = I x /V;
60 KG = abs ( z B o t − z g ) ;
61 GM x = KB + BM x − KG;
62 M x = F B ∗ GM x ;
63

64 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

65 % Matrix f o r m u l a t i o n
66

67 M( 1 , 1 ) = m t;
68 M( 1 , 2 ) = m t∗ z g ;
69 M( 2 , 1 ) = m t∗ z g ;
70 M( 2 , 2 ) = I t;
71

72 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
73 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
74 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
76

77 C = z e r o s ( s i z e (A) ) ;
78 C( 1 , 1 ) = K Moor ;
79 C( 1 , 2 ) = K Moor ∗ z Moor ;
80 C( 2 , 1 ) = K Moor ∗ z Moor ;
81 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
82

83 B = z e r o s ( s i z e (A) ) ;
84 B( 1 , 1 ) = 1 0 ˆ 5 ;
85

86 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

87 % Natural f r e q u e n c i e s
88

89 D = ( i n v (M+A) ) ∗C ;
90

91 omega2 = e i g s (D) ;
92 omega = s q r t ( omega2 ) ;
93 f r e q u e n c y = omega / ( 2 ∗ p i ) ;

5
Report 5: Dynamic model for simplified OC3-Hywind concept

94

95 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % time and f r e q u e n c y s e r i e s
97

98 t max = 1 0 ∗ 6 0 ; % P e r i o d [ s ]
99 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
100

101 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


102 d e l t a f = 1/ t max ;
103

104 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
105 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
106

107 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

108 % wave c a l c u l a t i o n
109

110 % depht p r o f i l e
111 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
112

113 % water motion


114 [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
115 eta vec = zeros ( size ( eta vec ) ) ;
116 u mat = z e r o s ( s i z e ( u mat ) ) ;
117 dudt mat = z e r o s ( s i z e ( dudt mat ) ) ;
118

119 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

120 % Wind c a l c u l a t i o n
121

122 % V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
123 V vec = z e r o s ( s i z e ( t v e c ) ) ;
124

125 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

126 % Numerical i n t e g r a t i o n
127

128 % time v e c t o r
129 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
130

131 % I n i t i a l conditions
132 q 0 = [1;0;0;0];
133

134 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


135 q = ode4 (@( t , q ) f u n c d q d t 1 0 ( t , q ) , t s p a n , q 0 ) ;
136

6
Report 5: Dynamic model for simplified OC3-Hywind concept

137 x = q(: ,1) ;


138 theta = q ( : , 2 ) ;
139

140 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

141 % PSD
142

143 d f f f t = 1/ t s p a n ( end ) ;
144 f span = [ 1 : length ( t span ) ] ’∗ d f f f t ;
145 nTrim=round ( l e n g t h ( t s p a n ) / 2 ) ;
146

147 X = f f t (x) / length ( t span ) ;


148 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
149 PSD X(1) = 0;
150 PSD X( nTrim : end ) =0;
151

152 Theta = f f t ( t h e t a ) / l e n g t h ( t s p a n ) ;
153 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
154 PSD theta ( 1 ) = 0 ;
155 PSD theta ( nTrim : end ) =0;
156

157 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

158 % Generating f i g u r e s
159

160 figure ;
161 plot ( t span , x ) ;
162 x l a b e l ( ’ time [ s ] ’ ) ;
163 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
164 s a v e a s ( g c f , ’ f i g q 1 0 a 1 ’ , ’ png ’ ) ;
165

166 figure ;
167 p l o t ( f s p a n , PSD X) ;
168 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
169 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
170 y l a b e l ( ’PSD( x 0 ) ’ )
171 s a v e a s ( g c f , ’ f i g q 1 0 a 2 ’ , ’ png ’ ) ;
172

173 figure ;
174 plot ( t span , theta ) ;
175 x l a b e l ( ’ time [ s ] ’ ) ;
176 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
177 s a v e a s ( g c f , ’ f i g q 1 0 a 3 ’ , ’ png ’ ) ;
178

179 figure ;
180 p l o t ( f s p a n , PSD theta ) ;
181 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
182 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
183 y l a b e l ( ’PSD( \ t h e t a ) ’ )

7
Report 5: Dynamic model for simplified OC3-Hywind concept

184 s a v e a s ( g c f , ’ f i g q 1 0 a 4 ’ , ’ png ’ ) ;
185 hold o f f
186

187 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

188 % Saving v a r i a b l e s t o p l o t on q u e s t i o n 11
189

190 x 10a = x ;
191 theta 10a = theta ;
192 PSD X 10a = PSD X ;
193 PSD theta 10a = PSD theta ;
194

195 s a v e q 1 0 a . mat x 1 0 a t h e t a 1 0 a PSD X 10a PSD theta 10a

8
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 10b
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 H = 6 ; % [m]
33 T = 10; % [ s ]
34

35 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

36 % Mass and moment o f i n e r t i a


37

38 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


39

40 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
41

42 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
43 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
44 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
45 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
46

47 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


48

9
Report 5: Dynamic model for simplified OC3-Hywind concept

49 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

50 % Boyance f o r c e and moment


51

52 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
53 V = A Spar ∗ abs ( z B o t ) ;
54 F B = rho w ∗ g∗V;
55

56 % GM x = KB + BM x − KG
57 KB = abs ( z B o t ) / 2 ;
58 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
59 BM x = I x /V;
60 KG = abs ( z B o t − z g ) ;
61 GM x = KB + BM x − KG;
62 M x = F B ∗ GM x ;
63

64 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

65 % Matrix f o r m u l a t i o n
66

67 M( 1 , 1 ) = m t;
68 M( 1 , 2 ) = m t∗ z g ;
69 M( 2 , 1 ) = m t∗ z g ;
70 M( 2 , 2 ) = I t;
71

72 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
73 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
74 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
76

77 C = z e r o s ( s i z e (A) ) ;
78 C( 1 , 1 ) = K Moor ;
79 C( 1 , 2 ) = K Moor ∗ z Moor ;
80 C( 2 , 1 ) = K Moor ∗ z Moor ;
81 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
82

83 B = z e r o s ( s i z e (A) ) ;
84 B( 1 , 1 ) = 1 0 ˆ 5 ;
85

86 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

87 % Natural f r e q u e n c i e s
88

89 D = ( i n v (M+A) ) ∗C ;
90

91 omega2 = e i g s (D) ;
92 omega = s q r t ( omega2 ) ;
93 f r e q u e n c y = omega / ( 2 ∗ p i ) ;

10
Report 5: Dynamic model for simplified OC3-Hywind concept

94

95 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % time and f r e q u e n c y s e r i e s
97

98 t max = 1 0 ∗ 6 0 ; % P e r i o d [ s ]
99 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
100

101 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


102 d e l t a f = 1/ t max ;
103

104 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
105 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
106

107 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

108 % wave c a l c u l a t i o n
109

110 % depht p r o f i l e
111 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
112

113 % water motion


114 [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
115 eta vec = zeros ( size ( eta vec ) ) ;
116 u mat = z e r o s ( s i z e ( u mat ) ) ;
117 dudt mat = z e r o s ( s i z e ( dudt mat ) ) ;
118

119 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

120 % Wind c a l c u l a t i o n
121

122 % V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
123 V vec = z e r o s ( s i z e ( t v e c ) ) ;
124

125 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

126 % Numerical i n t e g r a t i o n
127

128 % time v e c t o r
129 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
130

131 % I n i t i a l conditions
132 q 0 = [0;0.1;0;0];
133

134 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


135 q = ode4 (@( t , q ) f u n c d q d t 1 0 ( t , q ) , t s p a n , q 0 ) ;
136

11
Report 5: Dynamic model for simplified OC3-Hywind concept

137 x = q(: ,1) ;


138 theta = q ( : , 2 ) ;
139

140 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

141 % PSD
142

143 d f f f t = 1/ t s p a n ( end ) ;
144 f span = [ 1 : length ( t span ) ] ’∗ d f f f t ;
145 nTrim=round ( l e n g t h ( t s p a n ) / 2 ) ;
146

147 X = f f t (x) / length ( t span ) ;


148 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
149 PSD X(1) = 0;
150 PSD X( nTrim : end ) =0;
151

152 Theta = f f t ( t h e t a ) / l e n g t h ( t s p a n ) ;
153 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
154 PSD theta ( 1 ) = 0 ;
155 PSD theta ( nTrim : end ) =0;
156

157 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

158 % Generating f i g u r e s
159

160 figure ;
161 plot ( t span , x ) ;
162 x l a b e l ( ’ time [ s ] ’ ) ;
163 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
164 s a v e a s ( g c f , ’ f i g q 1 0 b 1 ’ , ’ png ’ ) ;
165

166 figure ;
167 p l o t ( f s p a n , PSD X) ;
168 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
169 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
170 y l a b e l ( ’PSD( x 0 ) ’ )
171 s a v e a s ( g c f , ’ f i g q 1 0 b 2 ’ , ’ png ’ ) ;
172

173 figure ;
174 plot ( t span , theta ) ;
175 x l a b e l ( ’ time [ s ] ’ ) ;
176 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
177 s a v e a s ( g c f , ’ f i g q 1 0 b 3 ’ , ’ png ’ ) ;
178

179 figure ;
180 p l o t ( f s p a n , PSD theta ) ;
181 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
182 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
183 y l a b e l ( ’PSD( \ t h e t a ) ’ )

12
Report 5: Dynamic model for simplified OC3-Hywind concept

184 s a v e a s ( g c f , ’ f i g q 1 0 b 4 ’ , ’ png ’ ) ;
185

186 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

187 % Saving v a r i a b l e s t o p l o t on q u e s t i o n 11
188

189 x 10b = x ;
190 theta 10b = theta ;
191 PSD X 10b = PSD X ;
192 PSD theta 10b = PSD theta ;
193

194 s a v e q 10b . mat x 10b t h e t a 1 0 b PSD X 10b PSD theta 10b

13
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 11 a
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 H = 6 ; % [m]
33 T = 10; % [ s ]
34

35 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

36 % Mass and moment o f i n e r t i a


37

38 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


39

40 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
41

42 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
43 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
44 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
45 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
46

47 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


48

14
Report 5: Dynamic model for simplified OC3-Hywind concept

49 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

50 % Boyance f o r c e and moment


51

52 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
53 V = A Spar ∗ abs ( z B o t ) ;
54 F B = rho w ∗ g∗V;
55

56 % GM x = KB + BM x − KG
57 KB = abs ( z B o t ) / 2 ;
58 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
59 BM x = I x /V;
60 KG = abs ( z B o t − z g ) ;
61 GM x = KB + BM x − KG;
62 M x = F B ∗ GM x ;
63

64 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

65 % Matrix f o r m u l a t i o n
66

67 M( 1 , 1 ) = m t;
68 M( 1 , 2 ) = m t∗ z g ;
69 M( 2 , 1 ) = m t∗ z g ;
70 M( 2 , 2 ) = I t;
71

72 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
73 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
74 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
76

77 C = z e r o s ( s i z e (A) ) ;
78 C( 1 , 1 ) = K Moor ;
79 C( 1 , 2 ) = K Moor ∗ z Moor ;
80 C( 2 , 1 ) = K Moor ∗ z Moor ;
81 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
82

83 B = z e r o s ( s i z e (A) ) ;
84 B( 1 , 1 ) = 1 0 ˆ 5 ;
85

86 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

87 % Natural f r e q u e n c i e s
88

89 D = ( i n v (M+A) ) ∗C ;
90

91 omega2 = e i g s (D) ;
92 omega = s q r t ( omega2 ) ;
93 f r e q u e n c y = omega / ( 2 ∗ p i ) ;

15
Report 5: Dynamic model for simplified OC3-Hywind concept

94

95 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % time and f r e q u e n c y s e r i e s
97

98 t max = 1 0 ∗ 6 0 ; % P e r i o d [ s ]
99 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
100

101 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


102 d e l t a f = 1/ t max ;
103

104 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
105 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
106

107 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

108 % wave c a l c u l a t i o n
109

110 % depht p r o f i l e
111 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
112

113 % water motion


114 [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
115 eta vec = zeros ( size ( eta vec ) ) ;
116 u mat = z e r o s ( s i z e ( u mat ) ) ;
117 dudt mat = z e r o s ( s i z e ( dudt mat ) ) ;
118

119 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

120 % Wind c a l c u l a t i o n
121

122 % V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
123 V vec = z e r o s ( s i z e ( t v e c ) ) ;
124

125 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

126 % Numerical i n t e g r a t i o n
127

128 % time v e c t o r
129 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
130

131 % I n i t i a l conditions
132 q 0 = [1;0;0;0];
133

134 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


135 q = ode4 (@( t , q ) f u n c d q d t 1 1 ( t , q ) , t s p a n , q 0 ) ;
136

16
Report 5: Dynamic model for simplified OC3-Hywind concept

137 x = q(: ,1) ;


138 theta = q ( : , 2 ) ;
139

140 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

141 % PSD
142

143 d f f f t = 1/ t s p a n ( end ) ;
144 f span = [ 1 : length ( t span ) ] ’∗ d f f f t ;
145 nTrim=round ( l e n g t h ( t s p a n ) / 2 ) ;
146

147 X = f f t (x) / length ( t span ) ;


148 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
149 PSD X(1) = 0;
150 PSD X( nTrim : end ) =0;
151

152 Theta = f f t ( t h e t a ) / l e n g t h ( t s p a n ) ;
153 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
154 PSD theta ( 1 ) = 0 ;
155 PSD theta ( nTrim : end ) =0;
156

157 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

158 % Generating f i g u r e s
159

160 l o a d q 1 0 a . mat ;
161

162 figure ;
163 h o l d on ;
164 plot ( t span , x , ’ r ’ ) ;
165 p l o t ( t s p a n , x 10a , ’ b ’ ) ;
166 x l a b e l ( ’ time [ s ] ’ ) ;
167 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
168 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
169 s a v e a s ( g c f , ’ f i g q 1 1 a 1 ’ , ’ png ’ ) ;
170 hold o f f ;
171

172 figure ;
173 h o l d on ;
174 p l o t ( f s p a n , PSD X , ’ r ’ ) ;
175 p l o t ( f s p a n , PSD X 10a , ’ b ’ ) ;
176 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
177 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
178 y l a b e l ( ’PSD( x 0 ) ’ )
179 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
180 s a v e a s ( g c f , ’ f i g q 1 1 a 2 ’ , ’ png ’ ) ;
181 hold o f f ;
182

183 figure ;

17
Report 5: Dynamic model for simplified OC3-Hywind concept

184 h o l d on ;
185 p l o t ( t span , theta , ’ r ’ ) ;
186 plot ( t span , theta 10a , ’b ’ ) ;
187 x l a b e l ( ’ time [ s ] ’ ) ;
188 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
189 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
190 s a v e a s ( g c f , ’ f i g q 1 1 a 3 ’ , ’ png ’ ) ;
191 hold o f f
192

193 figure ;
194 h o l d on ;
195 p l o t ( f s p a n , PSD theta , ’ r ’ ) ;
196 p l o t ( f s p a n , PSD theta 10a , ’ b ’ ) ;
197 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
198 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
199 y l a b e l ( ’PSD( \ t h e t a ) ’ )
200 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
201 s a v e a s ( g c f , ’ f i g q 1 1 a 4 ’ , ’ png ’ ) ;
202 hold o f f ;

18
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 11b
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 H = 6 ; % [m]
33 T = 10; % [ s ]
34

35 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

36 % Mass and moment o f i n e r t i a


37

38 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


39

40 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
41

42 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
43 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
44 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
45 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
46

47 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


48

19
Report 5: Dynamic model for simplified OC3-Hywind concept

49 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

50 % Boyance f o r c e and moment


51

52 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
53 V = A Spar ∗ abs ( z B o t ) ;
54 F B = rho w ∗ g∗V;
55

56 % GM x = KB + BM x − KG
57 KB = abs ( z B o t ) / 2 ;
58 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
59 BM x = I x /V;
60 KG = abs ( z B o t − z g ) ;
61 GM x = KB + BM x − KG;
62 M x = F B ∗ GM x ;
63

64 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

65 % Matrix f o r m u l a t i o n
66

67 M( 1 , 1 ) = m t;
68 M( 1 , 2 ) = m t∗ z g ;
69 M( 2 , 1 ) = m t∗ z g ;
70 M( 2 , 2 ) = I t;
71

72 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
73 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
74 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
76

77 C = z e r o s ( s i z e (A) ) ;
78 C( 1 , 1 ) = K Moor ;
79 C( 1 , 2 ) = K Moor ∗ z Moor ;
80 C( 2 , 1 ) = K Moor ∗ z Moor ;
81 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
82

83 B = z e r o s ( s i z e (A) ) ;
84 B( 1 , 1 ) = 1 0 ˆ 5 ;
85

86 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

87 % Natural f r e q u e n c i e s
88

89 D = ( i n v (M+A) ) ∗C ;
90

91 omega2 = e i g s (D) ;
92 omega = s q r t ( omega2 ) ;
93 f r e q u e n c y = omega / ( 2 ∗ p i ) ;

20
Report 5: Dynamic model for simplified OC3-Hywind concept

94

95 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % time and f r e q u e n c y s e r i e s
97

98 t max = 1 0 ∗ 6 0 ; % P e r i o d [ s ]
99 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
100

101 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


102 d e l t a f = 1/ t max ;
103

104 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
105 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
106

107 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

108 % wave c a l c u l a t i o n
109

110 % depht p r o f i l e
111 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
112

113 % water motion


114 [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
115 eta vec = zeros ( size ( eta vec ) ) ;
116 u mat = z e r o s ( s i z e ( u mat ) ) ;
117 dudt mat = z e r o s ( s i z e ( dudt mat ) ) ;
118

119 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

120 % Wind c a l c u l a t i o n
121

122 % V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
123 V vec = z e r o s ( s i z e ( t v e c ) ) ;
124

125 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

126 % Numerical i n t e g r a t i o n
127

128 % time v e c t o r
129 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
130

131 % I n i t i a l conditions
132 q 0 = [0;0.1;0;0];
133

134 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


135 q = ode4 (@( t , q ) f u n c d q d t 1 1 ( t , q ) , t s p a n , q 0 ) ;
136

21
Report 5: Dynamic model for simplified OC3-Hywind concept

137 x = q(: ,1) ;


138 theta = q ( : , 2 ) ;
139

140 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

141 % PSD
142

143 d f f f t = 1/ t s p a n ( end ) ;
144 f span = [ 1 : length ( t span ) ] ’∗ d f f f t ;
145 nTrim=round ( l e n g t h ( t s p a n ) / 2 ) ;
146

147 X = f f t (x) / length ( t span ) ;


148 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
149 PSD X(1) = 0;
150 PSD X( nTrim : end ) =0;
151

152 Theta = f f t ( t h e t a ) / l e n g t h ( t s p a n ) ;
153 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
154 PSD theta ( 1 ) = 0 ;
155 PSD theta ( nTrim : end ) =0;
156

157 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

158 % Generating f i g u r e s
159

160 l o a d q 10b . mat ;


161

162 figure ;
163 h o l d on ;
164 plot ( t span , x , ’ r ’ ) ;
165 p l o t ( t s p a n , x 10b , ’ b ’ ) ;
166 x l a b e l ( ’ time [ s ] ’ ) ;
167 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
168 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
169 s a v e a s ( g c f , ’ f i g q 1 1 b 1 ’ , ’ png ’ ) ;
170 hold o f f ;
171

172 figure ;
173 h o l d on ;
174 p l o t ( f s p a n , PSD X , ’ r ’ ) ;
175 p l o t ( f s p a n , PSD X 10b , ’ b ’ ) ;
176 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
177 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
178 y l a b e l ( ’PSD( x 0 ) ’ )
179 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
180 s a v e a s ( g c f , ’ f i g q 1 1 b 2 ’ , ’ png ’ ) ;
181 hold o f f ;
182

183 figure ;

22
Report 5: Dynamic model for simplified OC3-Hywind concept

184 h o l d on ;
185 p l o t ( t span , theta , ’ r ’ ) ;
186 plot ( t span , theta 10b , ’b ’ ) ;
187 x l a b e l ( ’ time [ s ] ’ ) ;
188 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
189 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
190 s a v e a s ( g c f , ’ f i g q 1 1 b 3 ’ , ’ png ’ ) ;
191 hold o f f
192

193 figure ;
194 h o l d on ;
195 p l o t ( f s p a n , PSD theta , ’ r ’ ) ;
196 p l o t ( f s p a n , PSD theta 10b , ’ b ’ ) ;
197 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
198 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
199 y l a b e l ( ’PSD( \ t h e t a ) ’ )
200 l e g e n d ( ’ with hidrodynamic f o r c e s ’ , ’ with no s h i d r o d y n a m i c f o r c e s ’ )
201 s a v e a s ( g c f , ’ f i g q 1 1 b 4 ’ , ’ png ’ ) ;
202 hold o f f ;

23
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 12
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 H = 6 ; % [m]
33 T = 10; % [ s ]
34

35 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

36 % Mass and moment o f i n e r t i a


37

38 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


39

40 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
41

42 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
43 I Tower = I Tower CM + ( z CM Tower ˆ 2 ) ∗m Tower ;
44 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
45 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
46

47 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


48

24
Report 5: Dynamic model for simplified OC3-Hywind concept

49 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

50 % Boyance f o r c e and moment


51

52 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
53 V = A Spar ∗ abs ( z B o t ) ;
54 F B = rho w ∗ g∗V;
55

56 % GM x = KB + BM x − KG
57 KB = abs ( z B o t ) / 2 ;
58 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
59 BM x = I x /V;
60 KG = abs ( z B o t − z g ) ;
61 GM x = KB + BM x − KG;
62 M x = F B ∗ GM x ;
63

64 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

65 % Matrix f o r m u l a t i o n
66

67 M( 1 , 1 ) = m t;
68 M( 1 , 2 ) = m t∗ z g ;
69 M( 2 , 1 ) = m t∗ z g ;
70 M( 2 , 2 ) = I t;
71

72 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
73 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
74 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
76

77 C = z e r o s ( s i z e (A) ) ;
78 C( 1 , 1 ) = K Moor ;
79 C( 1 , 2 ) = K Moor ∗ z Moor ;
80 C( 2 , 1 ) = K Moor ∗ z Moor ;
81 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
82

83 B = z e r o s ( s i z e (A) ) ;
84 B( 1 , 1 ) = 1 0 ˆ 5 ;
85

86 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

87 % Natural f r e q u e n c i e s
88

89 D = ( i n v (M+A) ) ∗C ;
90

91 omega2 = e i g s (D) ;
92 omega = s q r t ( omega2 ) ;
93 f r e q u e n c y = omega / ( 2 ∗ p i ) ;

25
Report 5: Dynamic model for simplified OC3-Hywind concept

94

95 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % time and f r e q u e n c y s e r i e s
97

98 t max = 1 0 ∗ 6 0 ; % P e r i o d [ s ]
99 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
100

101 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


102 d e l t a f = 1/ t max ;
103

104 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
105 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
106

107 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

108 % wave c a l c u l a t i o n
109

110 % depht p r o f i l e
111 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
112

113 % water motion


114 [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
115 % u mat = z e r o s ( s i z e ( u mat ) ) ;
116 % dudt mat = z e r o s ( s i z e ( dudt mat ) ) ;
117

118 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

119 % Wind c a l c u l a t i o n
120

121 % V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
122 V vec = z e r o s ( s i z e ( t v e c ) ) ;
123

124 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

125 % Numerical i n t e g r a t i o n
126

127 % time v e c t o r
128 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
129

130 % I n i t i a l conditions
131 q 0 = [0;0;0;0];
132

133 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


134 q = ode4 (@( t , q ) f u n c d q d t 1 2 ( t , q ) , t s p a n , q 0 ) ;
135

136 x = q(: ,1) ;

26
Report 5: Dynamic model for simplified OC3-Hywind concept

137 theta = q ( : , 2 ) ;
138

139 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

140 % PSD
141

142 d f f f t = 1/ t s p a n ( end ) ;
143 f span = [ 1 : length ( t span ) ] ’∗ d f f f t ;
144 nTrim=round ( l e n g t h ( t s p a n ) / 2 ) ;
145

146 X = f f t (x) / length ( t span ) ;


147 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
148 PSD X(1) = 0;
149 PSD X( nTrim : end ) =0;
150

151 Theta = f f t ( t h e t a ) / l e n g t h ( t s p a n ) ;
152 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
153 PSD theta ( 1 ) = 0 ;
154 PSD theta ( nTrim : end ) =0;
155

156 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

157 % Generating f i g u r e s
158

159 figure ;
160 plot ( t span , x ) ;
161 x l a b e l ( ’ time [ s ] ’ ) ;
162 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
163 s a v e a s ( g c f , ’ f i g q 1 2 1 ’ , ’ png ’ ) ;
164

165 figure ;
166 p l o t ( f s p a n , PSD X) ;
167 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
168 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
169 y l a b e l ( ’PSD( x 0 ) ’ )
170 s a v e a s ( g c f , ’ f i g q 1 2 2 ’ , ’ png ’ ) ;
171

172 figure ;
173 plot ( t span , theta ) ;
174 x l a b e l ( ’ time [ s ] ’ ) ;
175 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
176 s a v e a s ( g c f , ’ f i g q 1 2 3 ’ , ’ png ’ ) ;
177

178 figure ;
179 p l o t ( f s p a n , PSD theta ) ;
180 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
181 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
182 y l a b e l ( ’PSD( \ t h e t a ) ’ )
183 s a v e a s ( g c f , ’ f i g q 1 2 4 ’ , ’ png ’ ) ;

27
Report 5: Dynamic model for simplified OC3-Hywind concept

184

185 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

186 % Saving v a r i a b l e s t o p l o t on q u e s t i o n 13
187

188 x 12 = x ;
189 theta 12 = theta ;
190 PSD X 12 = PSD X ;
191 PSD theta 12 = PSD theta ;
192

193 s a v e q 1 2 . mat x 1 2 t h e t a 1 2 PSD X 12 PSD theta 12

28
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 13
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 H = 6 ; % [m]
33 T = 10; % [ s ]
34

35 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

36 % Mass and moment o f i n e r t i a


37

38 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


39

40 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
41

42 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
43 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
44 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
45 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
46

47 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


48

29
Report 5: Dynamic model for simplified OC3-Hywind concept

49 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

50 % Boyance f o r c e and moment


51

52 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
53 V = A Spar ∗ abs ( z B o t ) ;
54 F B = rho w ∗ g∗V;
55

56 % GM x = KB + BM x − KG
57 KB = abs ( z B o t ) / 2 ;
58 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
59 BM x = I x /V;
60 KG = abs ( z B o t − z g ) ;
61 GM x = KB + BM x − KG;
62 M x = F B ∗ GM x ;
63

64 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

65 % Matrix f o r m u l a t i o n
66

67 M( 1 , 1 ) = m t;
68 M( 1 , 2 ) = m t∗ z g ;
69 M( 2 , 1 ) = m t∗ z g ;
70 M( 2 , 2 ) = I t;
71

72 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
73 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
74 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
76

77 C = z e r o s ( s i z e (A) ) ;
78 C( 1 , 1 ) = K Moor ;
79 C( 1 , 2 ) = K Moor ∗ z Moor ;
80 C( 2 , 1 ) = K Moor ∗ z Moor ;
81 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
82

83 B = z e r o s ( s i z e (A) ) ;
84 B( 1 , 1 ) = 1 0 ˆ 5 ;
85

86 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

87 % Natural f r e q u e n c i e s
88

89 D = ( i n v (M+A) ) ∗C ;
90

91 omega2 = e i g s (D) ;
92 omega = s q r t ( omega2 ) ;
93 f r e q u e n c y = omega / ( 2 ∗ p i ) ;

30
Report 5: Dynamic model for simplified OC3-Hywind concept

94

95 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % time and f r e q u e n c y s e r i e s
97

98 t max = 1 0 ∗ 6 0 ; % P e r i o d [ s ]
99 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
100

101 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


102 d e l t a f = 1/ t max ;
103

104 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
105 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
106

107 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

108 % wave c a l c u l a t i o n
109

110 % depht p r o f i l e
111 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
112

113 % water motion


114 [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
115

116 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

117 % Wind c a l c u l a t i o n
118

119 V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
120

121 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

122 % Numerical i n t e g r a t i o n
123

124 % time v e c t o r
125 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
126

127 % I n i t i a l conditions
128 q 0 = [0;0;0;0];
129

130 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


131 q = ode4 (@( t , q ) f u n c d q d t ( t , q ) , t s p a n , q 0 ) ;
132

133 x = q(: ,1) ;


134 theta = q ( : , 2 ) ;
135

136 %

31
Report 5: Dynamic model for simplified OC3-Hywind concept

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

137 % PSD
138

139 d f f f t = 1/ t s p a n ( end ) ;
140 f span = [ 1 : length ( t span ) ] ’∗ d f f f t ;
141 nTrim=round ( l e n g t h ( t s p a n ) / 2 ) ;
142

143 X = f f t (x) / length ( t span ) ;


144 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
145 PSD X(1) = 0;
146 PSD X( nTrim : end ) =0;
147

148 Theta = f f t ( t h e t a ) / l e n g t h ( t s p a n ) ;
149 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
150 PSD theta ( 1 ) = 0 ;
151 PSD theta ( nTrim : end ) =0;
152

153 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

154 % Generating f i g u r e s
155

156 l o a d q 1 2 . mat ;
157

158 figure ;
159 h o l d on ;
160 p l o t ( t s p a n , x 12 , ’ b ’ ) ;
161 plot ( t span , x , ’ r ’ ) ;
162 x l a b e l ( ’ time [ s ] ’ ) ;
163 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
164 l e g e n d ( ’ with no wind ’ , ’ with s t e a d y wind ’ )
165 s a v e a s ( g c f , ’ f i g q 1 3 1 ’ , ’ png ’ ) ;
166 hold o f f ;
167

168 figure ;
169 h o l d on ;
170 p l o t ( f s p a n , PSD X 12 , ’ b ’ ) ;
171 p l o t ( f s p a n , PSD X , ’ r ’ ) ;
172 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
173 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
174 y l a b e l ( ’PSD( x 0 ) ’ )
175 l e g e n d ( ’ with no wind ’ , ’ with s t e a d y wind ’ )
176 s a v e a s ( g c f , ’ f i g q 1 3 2 ’ , ’ png ’ ) ;
177 hold o f f ;
178

179 figure ;
180 h o l d on ;
181 plot ( t span , theta 12 , ’b ’ ) ;
182 p l o t ( t span , theta , ’ r ’ ) ;
183 x l a b e l ( ’ time [ s ] ’ ) ;

32
Report 5: Dynamic model for simplified OC3-Hywind concept

184 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
185 l e g e n d ( ’ with no wind ’ , ’ with s t e a d y wind ’ )
186 s a v e a s ( g c f , ’ f i g q 1 3 3 ’ , ’ png ’ ) ;
187 hold o f f
188

189 figure ;
190 h o l d on ;
191 p l o t ( f s p a n , PSD theta 12 , ’ b ’ ) ;
192 p l o t ( f s p a n , PSD theta , ’ r ’ ) ;
193 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
194 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
195 y l a b e l ( ’PSD( \ t h e t a ) ’ )
196 l e g e n d ( ’ with no wind ’ , ’ with s t e a d y wind ’ )
197 s a v e a s ( g c f , ’ f i g q 1 3 4 ’ , ’ png ’ ) ;
198 hold o f f ;

33
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 14
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 Hs = 6 ; % [m]
33 Tp = 1 0 ; % [ s ]
34 gamma = 3 . 3 ;
35

36 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

37 % Mass and moment o f i n e r t i a


38

39 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


40

41 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗


m Rotor ) / m t ;
42

43 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
44 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
45 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
46 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
47

48 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;

34
Report 5: Dynamic model for simplified OC3-Hywind concept

49

50 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

51 % Boyance f o r c e and moment


52

53 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
54 V = A Spar ∗ abs ( z B o t ) ;
55 F B = rho w ∗ g∗V;
56

57 % GM x = KB + BM x − KG
58 KB = abs ( z B o t ) / 2 ;
59 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
60 BM x = I x /V;
61 KG = abs ( z B o t − z g ) ;
62 GM x = KB + BM x − KG;
63 M x = F B ∗ GM x ;
64

65 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

66 % Matrix f o r m u l a t i o n
67

68 M( 1 , 1 ) = m t;
69 M( 1 , 2 ) = m t∗ z g ;
70 M( 2 , 1 ) = m t∗ z g ;
71 M( 2 , 2 ) = I t;
72

73 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
74 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
75 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
76 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
77

78 C = z e r o s ( s i z e (A) ) ;
79 C( 1 , 1 ) = K Moor ;
80 C( 1 , 2 ) = K Moor ∗ z Moor ;
81 C( 2 , 1 ) = K Moor ∗ z Moor ;
82 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
83

84 B = z e r o s ( s i z e (A) ) ;
85 B( 1 , 1 ) = 1 0 ˆ 5 ;
86

87 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

88 % Natural f r e q u e n c i e s
89

90 D = ( i n v (M+A) ) ∗C ;
91

92 omega2 = e i g s (D) ;
93 omega = s q r t ( omega2 ) ;

35
Report 5: Dynamic model for simplified OC3-Hywind concept

94 f r e q u e n c y = omega / ( 2 ∗ p i ) ;
95

96 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

97 % time and f r e q u e n c y s e r i e s
98

99 t max = 10∗60+600; % P e r i o d [ s ]
100 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
101

102 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


103 d e l t a f = 1/ t max ;
104

105 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
106 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
107

108 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

109 % wave c a l c u l a t i o n
110

111 % G e n e r a t i n g t h e wave s p e c t r a
112 S wave = func JONSWAP( Hs , Tp , gamma , f v e c ) ;
113

114 % random numbers


115 rng ( 1 )
116 e p s i l o n w a v e = ( 2 . ∗ p i ) . ∗ rand ( s i z e ( f v e c ) ) ;
117

118 % depht p r o f i l e
119 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
120

121 % water motion


122 % [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
123 [ e t a v e c , u mat , dudt mat ] = f u n c l i n e a r w a v e s ( g , h , f v e c , S wave , t v e c , . . .
124 z vec , epsilon wave ) ;
125

126 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

127 % Wind c a l c u l a t i o n
128

129 V vec = 8∗ o n e s ( s i z e ( t v e c ) ) ;
130

131 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

132 % Numerical i n t e g r a t i o n
133

134 % time v e c t o r
135 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
136

36
Report 5: Dynamic model for simplified OC3-Hywind concept

137 % I n i t i a l conditions
138 q 0 = [0;0;0;0];
139

140 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


141 q = ode4 (@( t , q ) f u n c d q d t ( t , q ) , t s p a n , q 0 ) ;
142

143 x = q(: ,1) ;


144 theta = q ( : , 2 ) ;
145

146 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

147 % PSD
148

149 % c u t t i n g t h e time s e r i e s
150 i t = round ( l e n g t h ( t s p a n ) / 2 ) +1;
151

152 t s p a n c u t = t s p a n ( i t : end )−t s p a n ( i t ) ;


153 x c u t = x ( i t : end ) ;
154 t h e t a c u t = t h e t a ( i t : end ) ;
155

156 d f f f t = 1/ t s p a n c u t ( end ) ;
157 f span = [ 1 : length ( t span cut ) ] ’∗ d f f f t ;
158 nTrim=round ( l e n g t h ( t s p a n c u t ) / 2 ) ;
159

160 X = f f t ( x cut ) / length ( t span cut ) ;


161 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
162 PSD X(1) = 0;
163 PSD X( nTrim : end ) =0;
164

165 Theta = f f t ( t h e t a c u t ) / l e n g t h ( t s p a n c u t ) ;
166 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
167 PSD theta ( 1 ) = 0 ;
168 PSD theta ( nTrim : end ) =0;
169

170 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

171 % Generating f i g u r e s
172

173 figure ;
174 plot ( t span , x ) ;
175 x l a b e l ( ’ time [ s ] ’ ) ;
176 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
177 s a v e a s ( g c f , ’ f i g q 1 4 1 ’ , ’ png ’ ) ;
178

179 figure ;
180 p l o t ( f s p a n , PSD X) ;
181 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
182 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
183 y l a b e l ( ’PSD( x 0 ) ’ )

37
Report 5: Dynamic model for simplified OC3-Hywind concept

184 s a v e a s ( g c f , ’ f i g q 1 4 2 ’ , ’ png ’ ) ;
185

186 figure ;
187 plot ( t span , theta ) ;
188 x l a b e l ( ’ time [ s ] ’ ) ;
189 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
190 s a v e a s ( g c f , ’ f i g q 1 4 3 ’ , ’ png ’ ) ;
191

192 figure ;
193 p l o t ( f s p a n , PSD theta ) ;
194 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
195 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
196 y l a b e l ( ’PSD( \ t h e t a ) ’ )
197 s a v e a s ( g c f , ’ f i g q 1 4 4 ’ , ’ png ’ ) ;

38
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 15
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 Hs = 6 ; % [m]
33 Tp = 1 0 ; % [ s ]
34 gamma = 3 . 3 ;
35

36 % Problem data − wind


37 D r o t o r = 1 2 6 . 0 ; % Rotor d i a m e t e r
38 r h o a i r = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
39 V 10 = 8 . 0 ; % [m/ s ] wind mean v e l o c i t y
40 V r a t e d = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
41 I = 0.14; % [ ] turbulence i n t e s i s t y factor
42 l = 3 4 0 . 2 ; % [m] c h a r a c t e r i s t i c l e n g t h
43

44 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

45 % Mass and moment o f i n e r t i a


46

47 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


48

49 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗

39
Report 5: Dynamic model for simplified OC3-Hywind concept

m Rotor ) / m t ;
50

51 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
52 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
53 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
54 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
55

56 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


57

58 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

59 % Boyance f o r c e and moment


60

61 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
62 V = A Spar ∗ abs ( z B o t ) ;
63 F B = rho w ∗ g∗V;
64

65 % GM x = KB + BM x − KG
66 KB = abs ( z B o t ) / 2 ;
67 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
68 BM x = I x /V;
69 KG = abs ( z B o t − z g ) ;
70 GM x = KB + BM x − KG;
71 M x = F B ∗ GM x ;
72

73 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

74 % Matrix f o r m u l a t i o n
75

76 M( 1 , 1 ) = m t;
77 M( 1 , 2 ) = m t∗ z g ;
78 M( 2 , 1 ) = m t∗ z g ;
79 M( 2 , 2 ) = I t;
80

81 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
82 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
83 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
84 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
85

86 C = z e r o s ( s i z e (A) ) ;
87 C( 1 , 1 ) = K Moor ;
88 C( 1 , 2 ) = K Moor ∗ z Moor ;
89 C( 2 , 1 ) = K Moor ∗ z Moor ;
90 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
91

92 B = z e r o s ( s i z e (A) ) ;
93 B( 1 , 1 ) = 1 0 ˆ 5 ;
94

95 %

40
Report 5: Dynamic model for simplified OC3-Hywind concept

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % Natural f r e q u e n c i e s
97

98 D = ( i n v (M+A) ) ∗C ;
99

100 omega2 = e i g s (D) ;


101 omega = s q r t ( omega2 ) ;
102 f r e q u e n c y = omega / ( 2 ∗ p i ) ;
103

104 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

105 % time and f r e q u e n c y s e r i e s


106

107 t max = 10∗60+600; % P e r i o d [ s ]


108 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
109

110 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


111 d e l t a f = 1/ t max ;
112

113 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
114 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
115

116 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

117 % wave c a l c u l a t i o n
118

119 % G e n e r a t i n g t h e wave s p e c t r a
120 S wave = func JONSWAP( Hs , Tp , gamma , f v e c ) ;
121

122 % random numbers


123 rng ( 1 ) ;
124 e p s i l o n w a v e = ( 2 . ∗ p i ) . ∗ rand ( s i z e ( f v e c ) ) ;
125

126 % depht p r o f i l e
127 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
128

129 % water motion


130 % [ e t a v e c , u mat , dudt mat ] = f u n c r e g u l a r w a v e ( z v e c , T, H, t v e c ) ;
131 [ e t a v e c , u mat , dudt mat ] = f u n c l i n e a r w a v e s ( g , h , f v e c , S wave , t v e c , . . .
132 z vec , epsilon wave ) ;
133

134 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

135 % Wind c a l c u l a t i o n
136

137 S wind= f u n c K a i m a l ( I , V 10 , l , f v e c ) ;
138

41
Report 5: Dynamic model for simplified OC3-Hywind concept

139 rng ( 2 ) ;
140 e p s i l o n w i n d = ( 2 . ∗ p i ) . ∗ rand ( s i z e ( f v e c ) ) ;
141

142 V vec = V 10 + func TS ( S wind , f v e c , t v e c , e p s i l o n w i n d ) ;


143

144 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

145 % Numerical i n t e g r a t i o n
146

147 % time v e c t o r
148 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]
149

150 % I n i t i a l conditions
151 q 0 = [0;0;0;0];
152

153 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


154 q = ode4 (@( t , q ) f u n c d q d t ( t , q ) , t s p a n , q 0 ) ;
155

156 x = q(: ,1) ;


157 theta = q ( : , 2 ) ;
158

159 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

160 % PSD
161

162 % c u t t i n g t h e time s e r i e s
163 i t = round ( l e n g t h ( t s p a n ) / 2 ) +1;
164

165 t s p a n c u t = t s p a n ( i t : end )−t s p a n ( i t ) ;


166 x c u t = x ( i t : end ) ;
167 t h e t a c u t = t h e t a ( i t : end ) ;
168

169 d f f f t = 1/ t s p a n c u t ( end ) ;
170 f span = [ 1 : length ( t span cut ) ] ’∗ d f f f t ;
171 nTrim=round ( l e n g t h ( t s p a n c u t ) / 2 ) ;
172

173 X = f f t ( x cut ) / length ( t span cut ) ;


174 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
175 PSD X(1) = 0;
176 PSD X( nTrim : end ) =0;
177

178 Theta = f f t ( t h e t a c u t ) / l e n g t h ( t s p a n c u t ) ;
179 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
180 PSD theta ( 1 ) = 0 ;
181 PSD theta ( nTrim : end ) =0;
182

183 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

42
Report 5: Dynamic model for simplified OC3-Hywind concept

184 % Generating f i g u r e s
185

186 figure ;
187 plot ( t span , x ) ;
188 x l a b e l ( ’ time [ s ] ’ ) ;
189 y l a b e l ( ’ s u r g e x 0 [m] ’ ) ;
190 s a v e a s ( g c f , ’ f i g q 1 5 1 ’ , ’ png ’ ) ;
191

192 figure ;
193 p l o t ( f s p a n , PSD X) ;
194 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
195 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
196 y l a b e l ( ’PSD( x 0 ) ’ )
197 s a v e a s ( g c f , ’ f i g q 1 5 2 ’ , ’ png ’ ) ;
198

199 figure ;
200 plot ( t span , theta ) ;
201 x l a b e l ( ’ time [ s ] ’ ) ;
202 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ ) ;
203 s a v e a s ( g c f , ’ f i g q 1 5 3 ’ , ’ png ’ ) ;
204

205 figure ;
206 p l o t ( f s p a n , PSD theta ) ;
207 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
208 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ )
209 y l a b e l ( ’PSD( \ t h e t a ) ’ )
210 s a v e a s ( g c f , ’ f i g q 1 5 4 ’ , ’ png ’ ) ;

43
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 16 a
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 % Hs = 6 ; % [m]
33 % Tp = 1 0 ; % [ s ]
34 % gamma = 3 . 3 ;
35

36 % Problem data − wind


37 D r o t o r = 1 2 6 . 0 ; % Rotor d i a m e t e r
38 r h o a i r = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
39 V 10 = 1 0 . 0 ; % [m/ s ] wind mean v e l o c i t y
40 V r a t e d = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
41 % I = 0.14; % [ ] turbulence i n t e s i s t y factor
42 % l = 3 4 0 . 2 ; % [m] c h a r a c t e r i s t i c l e n g t h
43

44 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

45 % Mass and moment o f i n e r t i a


46

47 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


48

49 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗

44
Report 5: Dynamic model for simplified OC3-Hywind concept

m Rotor ) / m t ;
50

51 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
52 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
53 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
54 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
55

56 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


57

58 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

59 % Boyance f o r c e and moment


60

61 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
62 V = A Spar ∗ abs ( z B o t ) ;
63 F B = rho w ∗ g∗V;
64

65 % GM x = KB + BM x − KG
66 KB = abs ( z B o t ) / 2 ;
67 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
68 BM x = I x /V;
69 KG = abs ( z B o t − z g ) ;
70 GM x = KB + BM x − KG;
71 M x = F B ∗ GM x ;
72

73 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

74 % Matrix f o r m u l a t i o n
75

76 M( 1 , 1 ) = m t;
77 M( 1 , 2 ) = m t∗ z g ;
78 M( 2 , 1 ) = m t∗ z g ;
79 M( 2 , 2 ) = I t;
80

81 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
82 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
83 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
84 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
85

86 C = z e r o s ( s i z e (A) ) ;
87 C( 1 , 1 ) = K Moor ;
88 C( 1 , 2 ) = K Moor ∗ z Moor ;
89 C( 2 , 1 ) = K Moor ∗ z Moor ;
90 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
91

92 B = z e r o s ( s i z e (A) ) ;
93 B( 1 , 1 ) = 1 0 ˆ 5 ;
94

95 %

45
Report 5: Dynamic model for simplified OC3-Hywind concept

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % Natural f r e q u e n c i e s
97

98 D = ( i n v (M+A) ) ∗C ;
99

100 omega2 = e i g s (D) ;


101 omega = s q r t ( omega2 ) ;
102 f r e q u e n c y = omega / ( 2 ∗ p i ) ;
103

104 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

105 % time and f r e q u e n c y s e r i e s


106

107 t max = 9 0 0 ; % P e r i o d [ s ]
108 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
109

110 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


111 d e l t a f = 1/ t max ;
112

113 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
114 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
115

116 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

117 % wave c a l c u l a t i o n
118

119 % depht p r o f i l e
120 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
121

122 % water motion


123 eta vec = zeros ( size ( t vec ) ) ;
124 u mat = z e r o s ( l e n g t h ( t v e c ) , l e n g t h ( z v e c ) ) ;
125 dudt mat = z e r o s ( l e n g t h ( t v e c ) , l e n g t h ( z v e c ) ) ;
126

127 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

128 % Wind c a l c u l a t i o n
129

130 V vec = V 10 ∗ o n e s ( s i z e ( t v e c ) ) ;
131

132 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

133 % Numerical i n t e g r a t i o n
134

135 % time v e c t o r
136 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]

46
Report 5: Dynamic model for simplified OC3-Hywind concept

137

138 % I n i t i a l conditions
139 q 0 = [0;0;0;0];
140

141 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


142 q = ode4 (@( t , q ) f u n c d q d t ( t , q ) , t s p a n , q 0 ) ;
143

144 x = q(: ,1) ;


145 theta = q ( : , 2 ) ;
146

147 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

148 % PSD
149

150 % c u t t i n g t h e time s e r i e s
151 i t = round ( l e n g t h ( t s p a n ) / 2 ) +1;
152

153 t s p a n c u t = t s p a n ( i t : end )−t s p a n ( i t ) ;


154 x c u t = x ( i t : end ) ;
155 t h e t a c u t = t h e t a ( i t : end ) ;
156

157 d f f f t = 1/ t s p a n c u t ( end ) ;
158 f span = [ 1 : length ( t span cut ) ] ’∗ d f f f t ;
159 nTrim=round ( l e n g t h ( t s p a n c u t ) / 2 ) ;
160

161 X = f f t ( x cut ) / length ( t span cut ) ;


162 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
163 PSD X(1) = 0;
164 PSD X( nTrim : end ) =0;
165

166 Theta = f f t ( t h e t a c u t ) / l e n g t h ( t s p a n c u t ) ;
167 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
168 PSD theta ( 1 ) = 0 ;
169 PSD theta ( nTrim : end ) =0;
170

171 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

172 % Generating f i g u r e s
173

174 figure ;
175 plot ( t span , x ) ;
176 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
177 x l a b e l ( ’ time [ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
178 y l a b e l ( ’ s u r g e x 0 [m] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
179 s a v e a s ( g c f , ’ f i g q 1 6 a 1 ’ , ’ png ’ ) ;
180

181 figure ;
182 p l o t ( f s p a n , PSD X) ;
183 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )

47
Report 5: Dynamic model for simplified OC3-Hywind concept

184 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;


185 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ , ’ f o n t s i z e ’ , 1 6 )
186 y l a b e l ( ’PSD( x 0 ) ’ , ’ f o n t s i z e ’ , 1 6 )
187 s a v e a s ( g c f , ’ f i g q 1 6 a 2 ’ , ’ png ’ ) ;
188

189 figure ;
190 plot ( t span , theta ) ;
191 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
192 x l a b e l ( ’ time [ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
193 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
194 s a v e a s ( g c f , ’ f i g q 1 6 a 3 ’ , ’ png ’ ) ;
195

196 figure ;
197 p l o t ( f s p a n , PSD theta )
198 s e t ( gca , ’ f o n t s i z e ’ , 1 6 ) ;
199 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
200 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ , ’ f o n t s i z e ’ , 1 6 )
201 y l a b e l ( ’PSD( \ t h e t a ) ’ , ’ f o n t s i z e ’ , 1 6 )
202 s a v e a s ( g c f , ’ f i g q 1 6 a 4 ’ , ’ png ’ ) ;
203 hold o f f
204

205 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

206 % Saving v a r i a b l e s t o p l o t on q u e s t i o n 11
207

208 x 16a = x ;
209 theta 16a = theta ;
210 PSD X 16a = PSD X ;
211 PSD theta 16a = PSD theta ;
212

213 s a v e q 1 6 a . mat x 1 6 a t h e t a 1 6 a PSD X 16a PSD theta 16a

48
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 16b
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 % Hs = 6 ; % [m]
33 % Tp = 1 0 ; % [ s ]
34 % gamma = 3 . 3 ;
35

36 % Problem data − wind


37 D r o t o r = 1 2 6 . 0 ; % Rotor d i a m e t e r
38 r h o a i r = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
39 V 10 = 1 6 . 0 ; % [m/ s ] wind mean v e l o c i t y
40 V r a t e d = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
41 % I = 0.14; % [ ] turbulence i n t e s i s t y factor
42 % l = 3 4 0 . 2 ; % [m] c h a r a c t e r i s t i c l e n g t h
43

44 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

45 % Mass and moment o f i n e r t i a


46

47 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


48

49 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗

49
Report 5: Dynamic model for simplified OC3-Hywind concept

m Rotor ) / m t ;
50

51 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
52 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
53 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
54 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
55

56 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


57

58 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

59 % Boyance f o r c e and moment


60

61 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
62 V = A Spar ∗ abs ( z B o t ) ;
63 F B = rho w ∗ g∗V;
64

65 % GM x = KB + BM x − KG
66 KB = abs ( z B o t ) / 2 ;
67 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
68 BM x = I x /V;
69 KG = abs ( z B o t − z g ) ;
70 GM x = KB + BM x − KG;
71 M x = F B ∗ GM x ;
72

73 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

74 % Matrix f o r m u l a t i o n
75

76 M( 1 , 1 ) = m t;
77 M( 1 , 2 ) = m t∗ z g ;
78 M( 2 , 1 ) = m t∗ z g ;
79 M( 2 , 2 ) = I t;
80

81 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
82 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
83 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
84 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
85

86 C = z e r o s ( s i z e (A) ) ;
87 C( 1 , 1 ) = K Moor ;
88 C( 1 , 2 ) = K Moor ∗ z Moor ;
89 C( 2 , 1 ) = K Moor ∗ z Moor ;
90 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
91

92 B = z e r o s ( s i z e (A) ) ;
93 B( 1 , 1 ) = 1 0 ˆ 5 ;
94

95 %

50
Report 5: Dynamic model for simplified OC3-Hywind concept

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % Natural f r e q u e n c i e s
97

98 D = ( i n v (M+A) ) ∗C ;
99

100 omega2 = e i g s (D) ;


101 omega = s q r t ( omega2 ) ;
102 f r e q u e n c y = omega / ( 2 ∗ p i ) ;
103

104 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

105 % time and f r e q u e n c y s e r i e s


106

107 t max = 9 0 0 ; % P e r i o d [ s ]
108 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
109

110 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


111 d e l t a f = 1/ t max ;
112

113 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
114 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
115

116 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

117 % wave c a l c u l a t i o n
118

119 % depht p r o f i l e
120 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
121

122 % water motion


123 eta vec = zeros ( size ( t vec ) ) ;
124 u mat = z e r o s ( l e n g t h ( t v e c ) , l e n g t h ( z v e c ) ) ;
125 dudt mat = z e r o s ( l e n g t h ( t v e c ) , l e n g t h ( z v e c ) ) ;
126

127 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

128 % Wind c a l c u l a t i o n
129

130 V vec = V 10 ∗ o n e s ( s i z e ( t v e c ) ) ;
131

132 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

133 % Numerical i n t e g r a t i o n
134

135 % time v e c t o r
136 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]

51
Report 5: Dynamic model for simplified OC3-Hywind concept

137

138 % I n i t i a l conditions
139 q 0 = [0;0;0;0];
140

141 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


142 q = ode4 (@( t , q ) f u n c d q d t ( t , q ) , t s p a n , q 0 ) ;
143

144 x = q(: ,1) ;


145 theta = q ( : , 2 ) ;
146

147 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

148 % PSD
149

150 % c u t t i n g t h e time s e r i e s
151 i t = round ( l e n g t h ( t s p a n ) / 2 ) +1;
152

153 t s p a n c u t = t s p a n ( i t : end )−t s p a n ( i t ) ;


154 x c u t = x ( i t : end ) ;
155 t h e t a c u t = t h e t a ( i t : end ) ;
156

157 d f f f t = 1/ t s p a n c u t ( end ) ;
158 f span = [ 1 : length ( t span cut ) ] ’∗ d f f f t ;
159 nTrim=round ( l e n g t h ( t s p a n c u t ) / 2 ) ;
160

161 X = f f t ( x cut ) / length ( t span cut ) ;


162 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
163 PSD X(1) = 0;
164 PSD X( nTrim : end ) =0;
165

166 Theta = f f t ( t h e t a c u t ) / l e n g t h ( t s p a n c u t ) ;
167 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
168 PSD theta ( 1 ) = 0 ;
169 PSD theta ( nTrim : end ) =0;
170

171 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

172 % Generating f i g u r e s
173

174 figure ;
175 plot ( t span , x ) ;
176 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
177 x l a b e l ( ’ time [ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
178 y l a b e l ( ’ s u r g e x 0 [m] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
179 s a v e a s ( g c f , ’ f i g q 1 6 b 1 ’ , ’ png ’ ) ;
180

181 figure ;
182 p l o t ( f s p a n , PSD X) ;
183 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )

52
Report 5: Dynamic model for simplified OC3-Hywind concept

184 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;


185 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ , ’ f o n t s i z e ’ , 1 6 )
186 y l a b e l ( ’PSD( x 0 ) ’ , ’ f o n t s i z e ’ , 1 6 )
187 s a v e a s ( g c f , ’ f i g q 1 6 b 2 ’ , ’ png ’ ) ;
188

189 figure ;
190 plot ( t span , theta ) ;
191 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
192 x l a b e l ( ’ time [ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
193 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
194 s a v e a s ( g c f , ’ f i g q 1 6 b 3 ’ , ’ png ’ ) ;
195

196 figure ;
197 p l o t ( f s p a n , PSD theta ) ;
198 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
199 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
200 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ , ’ f o n t s i z e ’ , 1 6 )
201 y l a b e l ( ’PSD( \ t h e t a ) ’ , ’ f o n t s i z e ’ , 1 6 )
202 s a v e a s ( g c f , ’ f i g q 1 6 b 4 ’ , ’ png ’ ) ;
203 hold o f f
204

205 V rel = ( 0 : 0 . 1 : 2 5 ) ;
206 F wind = z e r o s ( s i z e ( V r e l ) ) ;
207 f o r i =1: l e n g t h ( V r e l )
208 F wind ( i ) = f u n c F w i n d ( r h o a i r , V r e l ( i ) , D r o t o r , V rated , 0 . 0 ) ;
209 end
210

211 figure ;
212 p l o t ( V r e l , F wind )
213 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
214 x l a b e l ( ’ V { r e l } [m/ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
215 y l a b e l ( ’ F {Wind} [N] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
216 s a v e a s ( g c f , ’ f i g q 1 6 b 5 ’ , ’ png ’ ) ;

53
Report 5: Dynamic model for simplified OC3-Hywind concept

1 % q u e s t i o n 17
2

3 clear all ;
4 close all ;
5 clc ;
6

7 global M A B C
8 g l o b a l t v e c z v e c e t a v e c u mat dudt mat
9 g l o b a l V vec
10

11 % Problem data
12 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
13 z CM Floater = −89.92; % [m]
14 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
15 m Tower = 2 4 9 7 1 8 ; % [ kg ]
16 z CM Tower = 4 3 . 4 ; % [m]
17 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
18 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
19 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
20 z Hub = 9 0 ; % [m]
21 D Spar = 9 . 4 ; % [m]
22 z Bot = −113.4; % [m]
23 C M = 1.0; % []
24 C D = 0.60;
25 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
26 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
27 h = 3 2 0 ; % [m]
28 K Moor = 4 1 1 8 0 ; % [N/m]
29 z Moor = −70; % [m]
30

31 % Wave Data
32 % Hs = 6 ; % [m]
33 % Tp = 1 0 ; % [ s ]
34 % gamma = 3 . 3 ;
35

36 % Problem data − wind


37 D r o t o r = 1 2 6 . 0 ; % Rotor d i a m e t e r
38 r h o a i r = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
39 V 10 = 1 6 . 0 ; % [m/ s ] wind mean v e l o c i t y
40 V r a t e d = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
41 % I = 0.14; % [ ] turbulence i n t e s i s t y factor
42 % l = 3 4 0 . 2 ; % [m] c h a r a c t e r i s t i c l e n g t h
43

44 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

45 % Mass and moment o f i n e r t i a


46

47 m t = m F l o a t e r+m Tower+m N a c e l l e+m Rotor ;


48

49 z g = ( z CM Floater ∗ m F l o a t e r+z CM Tower∗m Tower+z Hub ∗ m N a c e l l e+z Hub ∗

54
Report 5: Dynamic model for simplified OC3-Hywind concept

m Rotor ) / m t ;
50

51 I Floater = I F l o a t e r C M + m F l o a t e r ∗ z CM Floater ˆ 2 ;
52 I Tower = I Tower CM + z CM Tower ˆ2∗ m Tower ;
53 I Nacelle = m N a c e l l e ∗ z Hub ˆ 2 ;
54 I Rotor = m Rotor ∗ z Hub ˆ 2 ;
55

56 I t = I F l o a t e r+I Tower+I N a c e l l e+I R o t o r ;


57

58 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

59 % Boyance f o r c e and moment


60

61 A Spar = p i ∗ D Spar ˆ 2 / 4 ;
62 V = A Spar ∗ abs ( z B o t ) ;
63 F B = rho w ∗ g∗V;
64

65 % GM x = KB + BM x − KG
66 KB = abs ( z B o t ) / 2 ;
67 I x = ( p i ∗ D Spar ˆ 4 ) / 6 4 ;
68 BM x = I x /V;
69 KG = abs ( z B o t − z g ) ;
70 GM x = KB + BM x − KG;
71 M x = F B ∗ GM x ;
72

73 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

74 % Matrix f o r m u l a t i o n
75

76 M( 1 , 1 ) = m t;
77 M( 1 , 2 ) = m t∗ z g ;
78 M( 2 , 1 ) = m t∗ z g ;
79 M( 2 , 2 ) = I t;
80

81 A( 1 , 1 ) = −rho w ∗C M∗ A Spar ∗ z B ot ;
82 A( 1 , 2 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
83 A( 2 , 1 ) = −(1/2) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 2 ;
84 A( 2 , 2 ) = −(1/3) ∗ rho w ∗C M∗ A Spar ∗ z B ot ˆ 3 ;
85

86 C = z e r o s ( s i z e (A) ) ;
87 C( 1 , 1 ) = K Moor ;
88 C( 1 , 2 ) = K Moor ∗ z Moor ;
89 C( 2 , 1 ) = K Moor ∗ z Moor ;
90 C( 2 , 2 ) = K Moor ∗ z Moor ˆ2 + M x ;
91

92 B = z e r o s ( s i z e (A) ) ;
93 B( 1 , 1 ) = 1 0 ˆ 5 ;
94

95 %

55
Report 5: Dynamic model for simplified OC3-Hywind concept

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

96 % Natural f r e q u e n c i e s
97

98 D = ( i n v (M+A) ) ∗C ;
99

100 omega2 = e i g s (D) ;


101 omega = s q r t ( omega2 ) ;
102 f r e q u e n c y = omega / ( 2 ∗ p i ) ;
103

104 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

105 % time and f r e q u e n c y s e r i e s


106

107 t max = 9 0 0 ; % P e r i o d [ s ]
108 f max = 0 . 5 ; % Peak f r e q u e n c y [ 1 / s ]
109

110 d e l t a t = 0 . 1 / 2 ; % dt <= 1 / ( 2 ∗ f max )


111 d e l t a f = 1/ t max ;
112

113 t v e c = 0 : d e l t a t : ( t max−d e l t a t ) ; % [ s ]
114 f v e c = d e l t a f : d e l t a f : f max ; % [ 1 / s ]
115

116 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

117 % wave c a l c u l a t i o n
118

119 % depht p r o f i l e
120 z v e c = l i n s p a c e ( z Bot , 0 . 0 , 1 0 0 ) ;
121

122 % water motion


123 eta vec = zeros ( size ( t vec ) ) ;
124 u mat = z e r o s ( l e n g t h ( t v e c ) , l e n g t h ( z v e c ) ) ;
125 dudt mat = z e r o s ( l e n g t h ( t v e c ) , l e n g t h ( z v e c ) ) ;
126

127 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

128 % Wind c a l c u l a t i o n
129

130 V vec = V 10 ∗ o n e s ( s i z e ( t v e c ) ) ;
131

132 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

133 % Numerical i n t e g r a t i o n
134

135 % time v e c t o r
136 t s p a n = 0 : 2 ∗ d e l t a t : ( t max −2∗ d e l t a t ) ; % [ s ]

56
Report 5: Dynamic model for simplified OC3-Hywind concept

137

138 % I n i t i a l conditions
139 C T 0 = func C T ( V 10 , V r a t e d ) ;
140 q 0 = [0;0;0;0;C T 0 ];
141

142 % q = ode4 ( @func dqdt , t s p a n , [ 0 ; 0 ] ) ;


143 q = ode4 (@( t , q ) f u n c d q d t 1 7 ( t , q ) , t s p a n , q 0 ) ;
144

145 x = q(: ,1) ;


146 theta = q ( : , 2 ) ;
147

148 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

149 % PSD
150

151 % c u t t i n g t h e time s e r i e s
152 i t = round ( l e n g t h ( t s p a n ) / 2 ) +1;
153

154 t s p a n c u t = t s p a n ( i t : end )−t s p a n ( i t ) ;


155 x c u t = x ( i t : end ) ;
156 t h e t a c u t = t h e t a ( i t : end ) ;
157

158 d f f f t = 1/ t s p a n c u t ( end ) ;
159 f span = [ 1 : length ( t span cut ) ] ’∗ d f f f t ;
160 nTrim=round ( l e n g t h ( t s p a n c u t ) / 2 ) ;
161

162 X = f f t ( x cut ) / length ( t span cut ) ;


163 PSD X = 2∗X. ∗ c o n j (X) / d f f f t ;
164 PSD X(1) = 0;
165 PSD X( nTrim : end ) =0;
166

167 Theta = f f t ( t h e t a c u t ) / l e n g t h ( t s p a n c u t ) ;
168 PSD theta = 2∗ Theta . ∗ c o n j ( Theta ) / d f f f t ;
169 PSD theta ( 1 ) = 0 ;
170 PSD theta ( nTrim : end ) =0;
171

172 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

173 % Generating f i g u r e s
174

175 figure ;
176 plot ( t span , x ) ;
177 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
178 x l a b e l ( ’ time [ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
179 y l a b e l ( ’ s u r g e x 0 [m] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
180 s a v e a s ( g c f , ’ f i g q 1 7 1 ’ , ’ png ’ ) ;
181

182 figure ;
183 p l o t ( f s p a n , PSD X) ;

57
Report 5: Dynamic model for simplified OC3-Hywind concept

184 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
185 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
186 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ , ’ f o n t s i z e ’ , 1 6 )
187 y l a b e l ( ’PSD( x 0 ) ’ , ’ f o n t s i z e ’ , 1 6 )
188 s a v e a s ( g c f , ’ f i g q 1 7 2 ’ , ’ png ’ ) ;
189

190 figure ;
191 plot ( t span , theta ) ;
192 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
193 x l a b e l ( ’ time [ s ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
194 y l a b e l ( ’ p i t c h \ t h e t a [ rad ] ’ , ’ f o n t s i z e ’ , 1 6 ) ;
195 s a v e a s ( g c f , ’ f i g q 1 7 3 ’ , ’ png ’ ) ;
196

197 figure ;
198 p l o t ( f s p a n , PSD theta ) ;
199 s e t ( gca , ’ f o n t s i z e ’ , 1 6 )
200 s e t ( gca , ’ xlim ’ , [ 0 0 . 5 ] ) ;
201 x l a b e l ( ’ f r e q u e n c y [ Hz ] ’ , ’ f o n t s i z e ’ , 1 6 )
202 y l a b e l ( ’PSD( \ t h e t a ) ’ , ’ f o n t s i z e ’ , 1 6 )
203 s a v e a s ( g c f , ’ f i g q 1 7 4 ’ , ’ png ’ ) ;
204 hold o f f

58
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ C T ] = func C T ( V r e l , V r a t e d )
2

3 C T 0 = 0 . 7 5 ; % [ ] Trust c o e f f i c i e n t b e l l o w r a t i n g
4 a = 0.25; % [ ]
5 b = 0.86; % [ ]
6

7 i f V r e l <= V r a t e d
8 C T = C T 0;
9 else
10 C T = C T 0 . ∗ exp(−a . ∗ ( V r e l −V r a t e d ) . ˆ b ) ;
11 end
12

13 end

59
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n F = func F ( t , x 0 dot , t h e t a 0 d o t )
2

3 g l o b a l t v e c z v e c e t a v e c u mat dudt mat


4 g l o b a l V vec
5

6 % Problem data
7 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
8 z CM Floater = −89.92; % [m]
9 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
10 m Tower = 2 4 9 7 1 8 ; % [ kg ]
11 z CM Tower = 4 3 . 4 ; % [m]
12 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
13 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
14 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
15 z Hub = 9 0 ; % [m]
16 D Spar = 9 . 4 ; % [m]
17 z Bot = −113.4; % [m]
18 C M = 1.0; % []
19 C D = 0.60;
20 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
21 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
22 h = 3 2 0 ; % [m]
23 K Moor = 4 1 1 8 0 ; % [N/m]
24 z Moor = −70; % [m]
25

26 % Problem data − wind


27 D rotor = 1 2 6 . 0 ; % Rotor d i a m e t e r
28 rho air = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
29 V rated = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
30

31 d e l t a t=t v e c ( 2 )−t v e c ( 1 ) ;
32 i t =round ( ( t−t v e c ( 1 ) ) / d e l t a t ) +1;
33 i f abs ( t v e c ( i t )−t )>1e−5
34 d i s p ( ’ P r e c o m p u t e d k i n e m a t i c s not a t r i g h t t i m e s ’ )
35 stop
36 end
37

38 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

39 % Water f o r c e s
40

41 A = p i ∗ ( D Spar ˆ 2 ) / 4 ;
42

43 % z p r o f i l e under water
44 z = z vec ;
45

46 % u = u( z )
47 u = u mat ( i t , : ) ;
48 dudt = dudt mat ( i t , : ) ;
49

60
Report 5: Dynamic model for simplified OC3-Hywind concept

50 %x0+z ∗ t h e t a
51 x dot = x 0 dot + z vec ( : ) .∗ theta 0 dot ;
52

53 df = zeros ( s i z e ( z ) ) ;
54 for i z = 1: length ( z )
55 d f ( i z ) = rho w . ∗ ( C M+1) . ∗A. ∗ dudt ( i z ) + . . .
56 0 . 5 . ∗ rho w . ∗ C D . ∗ D Spar . ∗ ( u ( i z )−x d o t ( i z ) ) . ∗ abs ( u ( i z )−
x dot ( i z ) ) ;
57 end
58

59 F wave = t r a p z ( z , d f ) ;
60 M wave = t r a p z ( z , d f . ∗ z ) ;
61

62 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

63 % Wind f o r c e s
64

65 V hub = V vec ( i t ) ;
66 x h u b d o t = x 0 d o t + z Hub . ∗ t h e t a 0 d o t ;
67

68 F wind = f u n c F w i n d ( r h o a i r , V hub , D r o t o r , V rated , x h u b d o t ) ;


69 M wind = F wind . ∗ z Hub ;
70

71 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

72 % Force and Moment


73

74 F = zeros (2 ,1) ;
75

76 F ( 1 ) = F wave + F wind ;
77 F ( 2 ) = M wave + M wind ;
78

79 end

61
Report 5: Dynamic model for simplified OC3-Hywind concept

1 function F = func F 11 ( t , x 0 dot , theta 0 dot )


2

3 g l o b a l t v e c z v e c e t a v e c u mat dudt mat


4 g l o b a l V vec
5

6 % Problem data
7 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
8 z CM Floater = −89.92; % [m]
9 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
10 m Tower = 2 4 9 7 1 8 ; % [ kg ]
11 z CM Tower = 4 3 . 4 ; % [m]
12 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
13 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
14 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
15 z Hub = 9 0 ; % [m]
16 D Spar = 9 . 4 ; % [m]
17 z Bot = −113.4; % [m]
18 C M = 1.0; % []
19 C D = 0.60;
20 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
21 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
22 h = 3 2 0 ; % [m]
23 K Moor = 4 1 1 8 0 ; % [N/m]
24 z Moor = −70; % [m]
25

26 % Problem data − wind


27 D rotor = 1 2 6 . 0 ; % Rotor d i a m e t e r
28 rho air = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
29 V rated = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
30

31 d e l t a t=t v e c ( 2 )−t v e c ( 1 ) ;
32 i t =round ( ( t−t v e c ( 1 ) ) / d e l t a t ) +1;
33 i f abs ( t v e c ( i t )−t )>1e−5
34 d i s p ( ’ P r e c o m p u t e d k i n e m a t i c s not a t r i g h t t i m e s ’ )
35 stop
36 end
37

38 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

39 % Water f o r c e s
40

41 A = p i ∗ ( D Spar ˆ 2 ) / 4 ;
42

43 % z p r o f i l e under water
44 z = z vec ;
45

46 % u = u( z )
47 u = u mat ( i t , : ) ;
48 dudt = dudt mat ( i t , : ) ;
49

62
Report 5: Dynamic model for simplified OC3-Hywind concept

50 %x0+z ∗ t h e t a
51 x dot = x 0 dot + z vec ( : ) .∗ theta 0 dot ;
52

53 df = zeros ( s i z e ( z ) ) ;
54 for i z = 1: length ( z )
55 d f ( i z ) = rho w . ∗ ( C M+1) . ∗A. ∗ dudt ( i z ) + . . .
56 0 . 5 . ∗ rho w . ∗ C D . ∗ D Spar . ∗ ( u ( i z )−x d o t ( i z ) ) . ∗ abs ( u ( i z )−
x dot ( i z ) ) ;
57 end
58

59 F wave = t r a p z ( z , d f ) ;
60 M wave = t r a p z ( z , d f . ∗ z ) ;
61

62 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

63 % Wind f o r c e s
64

65 % V hub = V vec ( i t ) ;
66 % x h u b d o t = x 0 d o t + z Hub . ∗ t h e t a 0 d o t ;
67 %
68 % F wind = f u n c F w i n d ( r h o a i r , V hub , D r o t o r , V rated , x h u b d o t ) ;
69 % M wind = F wind . ∗ z Hub ;
70 F wind = 0 ;
71 M wind = 0 ;
72

73 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

74 % Force and Moment


75

76 F = zeros (2 ,1) ;
77

78 F ( 1 ) = F wave + F wind ;
79 F ( 2 ) = M wave + M wind ;
80

81 end

63
Report 5: Dynamic model for simplified OC3-Hywind concept

1 function F = func F 12 ( t , x 0 dot , theta 0 dot )


2

3 g l o b a l t v e c z v e c e t a v e c u mat dudt mat


4 g l o b a l V vec
5

6 % Problem data
7 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
8 z CM Floater = −89.92; % [m]
9 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
10 m Tower = 2 4 9 7 1 8 ; % [ kg ]
11 z CM Tower = 4 3 . 4 ; % [m]
12 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
13 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
14 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
15 z Hub = 9 0 ; % [m]
16 D Spar = 9 . 4 ; % [m]
17 z Bot = −113.4; % [m]
18 C M = 1.0; % []
19 C D = 0.60;
20 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
21 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
22 h = 3 2 0 ; % [m]
23 K Moor = 4 1 1 8 0 ; % [N/m]
24 z Moor = −70; % [m]
25

26 % Problem data − wind


27 D rotor = 1 2 6 . 0 ; % Rotor d i a m e t e r
28 rho air = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
29 V rated = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
30

31 d e l t a t=t v e c ( 2 )−t v e c ( 1 ) ;
32 i t =round ( ( t−t v e c ( 1 ) ) / d e l t a t ) +1;
33 i f abs ( t v e c ( i t )−t )>1e−5
34 d i s p ( ’ P r e c o m p u t e d k i n e m a t i c s not a t r i g h t t i m e s ’ )
35 stop
36 end
37

38 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

39 % Water f o r c e s
40

41 A = p i ∗ ( D Spar ˆ 2 ) / 4 ;
42

43 % z p r o f i l e under water
44 z = z vec ;
45

46 % u = u( z )
47 u = u mat ( i t , : ) ;
48 dudt = dudt mat ( i t , : ) ;
49

64
Report 5: Dynamic model for simplified OC3-Hywind concept

50 %x0+z ∗ t h e t a
51 x dot = x 0 dot + z vec ( : ) .∗ theta 0 dot ;
52

53 df = zeros ( s i z e ( z ) ) ;
54 for i z = 1: length ( z )
55 d f ( i z ) = rho w . ∗ ( C M+1) . ∗A. ∗ dudt ( i z ) + . . .
56 0 . 5 . ∗ rho w . ∗ C D . ∗ D Spar . ∗ ( u ( i z )−x d o t ( i z ) ) . ∗ abs ( u ( i z )−
x dot ( i z ) ) ;
57 end
58

59 F wave = t r a p z ( z , d f ) ;
60 M wave = t r a p z ( z , d f . ∗ z ) ;
61

62 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

63 % Wind f o r c e s
64

65 % V hub = V vec ( i t ) ;
66 % x h u b d o t = x 0 d o t + z Hub . ∗ t h e t a 0 d o t ;
67 %
68 % F wind = f u n c F w i n d ( r h o a i r , V hub , D r o t o r , V rated , x h u b d o t ) ;
69 % M wind = F wind . ∗ z Hub ;
70 F wind = 0 ;
71 M wind = 0 ;
72

73 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

74 % Force and Moment


75

76 F = zeros (2 ,1) ;
77

78 F ( 1 ) = F wave + F wind ;
79 F ( 2 ) = M wave + M wind ;
80

81 end

65
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ F , dCdt ] = f u n c F 1 7 ( t , x 0 d o t , t h e t a 0 d o t , C T )
2

3 g l o b a l t v e c z v e c e t a v e c u mat dudt mat


4 g l o b a l V vec
5

6 % Problem data
7 m F l o a t e r = 7 4 6 6 3 3 0 ; % [ kg ]
8 z CM Floater = −89.92; % [m]
9 I F l o a t e r C M = 4 2 2 9 2 3 0 0 0 0 ; % [ kg mˆ 2 ]
10 m Tower = 2 4 9 7 1 8 ; % [ kg ]
11 z CM Tower = 4 3 . 4 ; % [m]
12 I Tower CM = 1 . 2 1 7 ∗ 1 0 ˆ 8 ; % [ kg mˆ 2 ]
13 m N a c e l l e = 2 4 0 ∗ 1 0 ˆ 3 ; % [ kg ]
14 m Rotor = 1 1 0 ∗ 1 0 ˆ 3 ; % [ kg ]
15 z Hub = 9 0 ; % [m]
16 D Spar = 9 . 4 ; % [m]
17 z Bot = −113.4; % [m]
18 C M = 1.0; % []
19 C D = 0.60;
20 rho w = 1 0 2 5 . 0 ; % [ kg /mˆ 3 ]
21 g = 9 . 8 1 ; % [m/ s ˆ 2 ]
22 h = 3 2 0 ; % [m]
23 K Moor = 4 1 1 8 0 ; % [N/m]
24 z Moor = −70; % [m]
25

26 % Problem data − wind


27 D rotor = 1 2 6 . 0 ; % Rotor d i a m e t e r
28 rho air = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
29 V rated = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
30

31 d e l t a t=t v e c ( 2 )−t v e c ( 1 ) ;
32 i t =round ( ( t−t v e c ( 1 ) ) / d e l t a t ) +1;
33 i f abs ( t v e c ( i t )−t )>1e−5
34 d i s p ( ’ P r e c o m p u t e d k i n e m a t i c s not a t r i g h t t i m e s ’ )
35 stop
36 end
37

38 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

39 % Water f o r c e s
40

41 A = p i ∗ ( D Spar ˆ 2 ) / 4 ;
42

43 % z p r o f i l e under water
44 z = z vec ;
45

46 % u = u( z )
47 u = u mat ( i t , : ) ;
48 dudt = dudt mat ( i t , : ) ;
49

66
Report 5: Dynamic model for simplified OC3-Hywind concept

50 %x0+z ∗ t h e t a
51 x dot = x 0 dot + z vec ( : ) .∗ theta 0 dot ;
52

53 df = zeros ( s i z e ( z ) ) ;
54 for i z = 1: length ( z )
55 d f ( i z ) = rho w . ∗ ( C M+1) . ∗A. ∗ dudt ( i z ) + . . .
56 0 . 5 . ∗ rho w . ∗ C D . ∗ D Spar . ∗ ( u ( i z )−x d o t ( i z ) ) . ∗ abs ( u ( i z )−
x dot ( i z ) ) ;
57 end
58

59 F wave = t r a p z ( z , d f ) ;
60 M wave = t r a p z ( z , d f . ∗ z ) ;
61

62 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

63 % Wind f o r c e s
64

65 V hub = V vec ( i t ) ;
66 x h u b d o t = x 0 d o t + z Hub . ∗ t h e t a 0 d o t ;
67

68 [ F wind , dCdt ] = f u n c F w i n d 1 7 ( r h o a i r , V hub , D r o t o r , V rated , x hub dot ,


C T) ;
69 M wind = F wind . ∗ z Hub ;
70

71 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

72 % Force and Moment


73

74 F = zeros (2 ,1) ;
75

76 F ( 1 ) = F wave + F wind ;
77 F ( 2 ) = M wave + M wind ;
78

79 end

67
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ F wind ] = f u n c F w i n d ( r h o a i r , V hub , D r o t o r , V rated , x d o t )


2

3 % Rotor a r e a
4 A r o t o r = p i . ∗ D r o t o r . ˆ 2 . / 4 ; %[mˆ 2 ]
5

6 % Relative Velocity
7 V r e l = V hub−x d o t ; % [m/ s ]
8

9 % Trust c o e f f i c i e n t
10 C T = func C T ( V r e l , V r a t e d ) ;
11

12 F wind = ( ( 1 / 2 ) ∗ r h o a i r ∗ A r o t o r ) ∗C T . ∗ V r e l . ∗ abs ( V r e l ) ;
13 end

68
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ F wind , dCdt ] = f u n c F w i n d 1 7 ( r h o a i r , V hub , D r o t o r , V rated ,


x dot , C T )
2

3 % Rotor a r e a
4 A r o t o r = p i . ∗ D r o t o r . ˆ 2 . / 4 ; %[mˆ 2 ]
5

6 % Relative Velocity
7 V r e l = V hub−x d o t ; % [m/ s ]
8

9 F wind = ( ( 1 / 2 ) ∗ r h o a i r ∗ A r o t o r ) ∗C T . ∗ V r e l . ∗ abs ( V r e l ) ;
10

11 % Trust c o e f f i c i e n t
12 c T = func C T ( V r e l , V r a t e d ) ;
13

14 gamma = 1 . 0 ;
15

16 dCdt = − gamma∗ ( C T − c T ) ;
17 end

69
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n y = func JONSWAP( Hs , Tp , gamma , f )


2 f p = 1/Tp ;
3

4 sigma = z e r o s ( s i z e ( f ) ) ;
5 f o r i =1: l e n g t h ( f )
6 i f f ( i )<=f p
7 sigma ( i ) = 0 . 0 7 ;
8 else
9 sigma ( i ) = 0 . 0 9 ;
10 end
11 end
12

13 r = exp ( − 0 . 5 . ∗ ( ( ( f . / f p ) −1) . / sigma ) . ˆ 2 ) ;


14 y = 0 . 3 1 2 5 . ∗ Hs . ˆ 2 . ∗ Tp . ∗ ( f . / f p ) .ˆ( −5) . ∗ exp ( − 1 . 2 5 . ∗ ( f . / f p ) .ˆ( −4) )
. ∗ ( 1 − 0 . 2 8 7 . ∗ l o g (gamma) ) . ∗ gamma . ˆ r ;
15 end

70
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n S = f u n c K a i m a l ( I , V 10 , l , f )
2 S = 4 . ∗ I . ˆ 2 . ∗ V 10 . ∗ l . / ( 1 + 6 . ∗ f . ∗ l . / V 10 ) . ˆ ( 5 . / 3 ) ;
3 end

71
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n V = func TS ( S , f , t , e p s i l o n )
2 d f = f ( 2 )−f ( 1 ) ;
3 a ( : ) = ( 2 .∗ S ( : ) .∗ df ) . ˆ ( 0 . 5 ) ;
4

5 % Slow c a l c u l a t i o n p r o c e d u r e
6 %{
7 V = zeros ( size ( t ) ) ;
8 omega ( : ) = 2 . ∗ p i . ∗ f ( : ) ;
9 f o r i =1: l e n g t h ( t )
10 V( i ) = sum ( a ( : ) . ∗ c o s ( omega ( : ) . ∗ t ( i )+e p s i l o n ( : ) ) ) ;
11 end
12 %}
13

14 % Fast c a l c u l a t i o n p r o c e d u r e
15 M = length ( t ) ;
16 V = (M) ∗ r e a l ( i f f t ( pad2 ( a . ∗ exp ( 1 i ∗ e p s i l o n ) ,M) ) ) ;
17 end

72
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ dqdt ] = f u n c d q d t ( t , q )
2

3 %{
4 % g l o b a l GD GK GM phiNodal rhoAElement zBeamNodal ;
5 % g l o b a l t v e c e t a v e c u mat dudt mat ;
6 % g l o b a l V vec ;
7 %
8 % % Problem data − water
9 % g = 9 . 8 1 ; % [m/ s ˆ 2 ] g r a v i t y
10 % h = 2 0 ; % [m] depht
11 % D = 6 . 0 ; % [m] d i a m e t e r
12 % r h o w a t e r = 1 0 2 5 ; % [ kg /mˆ 3 ] s e a water s p e c i f i c mass
13 % C D = 1 . 0 ; % [ ] Drag c o e f f i c i e n t
14 % C M = 2.0; % [ ] Inertia coefficient
15 % Hs = 2 . 1 9 ; % [m]
16 % Tp = 6 . 3 7 ; % [ s ]
17 % gamma = 1 ; % [ ]
18 %
19 % % Problem data − wind
20 % D r o t o r = 1 2 6 . 0 ; % Rotor d i a m e t e r
21 % r h o a i r = 1 . 2 9 ; % [ kg /mˆ 3 ] a i r s p e c i f i c mass
22 % V 10 = 1 6 . 0 ; % [m/ s ] wind mean v e l o c i t y
23 % V r a t e d = 1 1 . 4 ; % [m/ s ] Rated v e l o c i t y f o r t h e wind t u r b i n e
24 % I = 0.139; % [ ] turbulence i n t e s i s t y factor
25 % l = 3 4 0 . 2 ; % [m] c h a r a c t e r i s t i c l e n g t h
26 % h hub = 9 0 . 0 ; % [m] hub h e i g h t
27

28 alpha = q (1) ;
29 alpha dot = q (2) ;
30

31 GF1 = func GF ( t , alpha , a l p h a d o t ) ;


32 %}
33

34 g l o b a l M A B C;
35

36 x = q(1) ;
37 theta = q (2) ;
38 x dot = q (3) ;
39 theta dot = q(4) ;
40

41 % x 0 dot = q (3) ;
42 % theta 0 dot = q(4) ;
43

44 y = zeros (2 ,1) ;
45 y(1) = x ;
46 y (2) = theta ;
47

48 y dot = zeros (2 ,1) ;


49 y dot (1) = x dot ;
50 y dot (2) = theta dot ;
51

73
Report 5: Dynamic model for simplified OC3-Hywind concept

52 F = f u n c F ( t , x dot , t h e t a d o t ) ;
53 % F = zeros ( size (y) ) ;
54

55 y d d o t = (M+A) ˆ( −1) ∗ (F−B∗ y dot −C∗y ) ;


56 x ddot = y ddot (1) ;
57 theta ddot = y ddot (2) ;
58

59 dqdt = z e r o s ( s i z e ( q ) ) ;
60 dqdt ( 1 ) = q ( 3 ) ;
61 dqdt ( 2 ) = q ( 4 ) ;
62 dqdt ( 3 ) = x d d o t ;
63 dqdt ( 4 ) = t h e t a d d o t ;
64 end

74
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ dqdt ] = f u n c d q d t 1 0 ( t , q )
2

3 g l o b a l M A B C;
4

5 x = q(1) ;
6 theta = q (2) ;
7 x dot = q (3) ;
8 theta dot = q(4) ;
9

10 % x 0 dot = q (3) ;
11 % theta 0 dot = q(4) ;
12

13 y = zeros (2 ,1) ;
14 y(1) = x ;
15 y (2) = theta ;
16

17 y dot = zeros (2 ,1) ;


18 y dot (1) = x dot ;
19 y dot (2) = theta dot ;
20

21 % F = f u n c F ( t , x dot , t h e t a d o t ) ;
22 F = zeros ( size (y) ) ;
23

24 y d d o t = ( (M+A) ˆ( −1) ) ∗ (F−B∗ y dot −C∗y ) ;


25 x ddot = y ddot (1) ;
26 theta ddot = y ddot (2) ;
27

28 dqdt = z e r o s ( s i z e ( q ) ) ;
29 dqdt ( 1 ) = q ( 3 ) ;
30 dqdt ( 2 ) = q ( 4 ) ;
31 dqdt ( 3 ) = x d d o t ;
32 dqdt ( 4 ) = t h e t a d d o t ;
33 end

75
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ dqdt ] = f u n c d q d t 1 1 ( t , q )
2

3 g l o b a l M A B C;
4

5 x = q(1) ;
6 theta = q (2) ;
7 x dot = q (3) ;
8 theta dot = q(4) ;
9

10 % x 0 dot = q (3) ;
11 % theta 0 dot = q(4) ;
12

13 y = zeros (2 ,1) ;
14 y(1) = x ;
15 y (2) = theta ;
16

17 y dot = zeros (2 ,1) ;


18 y dot (1) = x dot ;
19 y dot (2) = theta dot ;
20

21 F = f u n c F 1 1 ( t , x dot , t h e t a d o t ) ;
22 % F = zeros ( size (y) ) ;
23

24 y d d o t = (M+A) ˆ( −1) ∗ (F−B∗ y dot −C∗y ) ;


25 x ddot = y ddot (1) ;
26 theta ddot = y ddot (2) ;
27

28 dqdt = z e r o s ( s i z e ( q ) ) ;
29 dqdt ( 1 ) = q ( 3 ) ;
30 dqdt ( 2 ) = q ( 4 ) ;
31 dqdt ( 3 ) = x d d o t ;
32 dqdt ( 4 ) = t h e t a d d o t ;
33 end

76
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ dqdt ] = f u n c d q d t 1 2 ( t , q )
2

3 g l o b a l M A B C;
4

5 x = q(1) ;
6 theta = q (2) ;
7 x dot = q (3) ;
8 theta dot = q(4) ;
9

10 % x 0 dot = q (3) ;
11 % theta 0 dot = q(4) ;
12

13 y = zeros (2 ,1) ;
14 y(1) = x ;
15 y (2) = theta ;
16

17 y dot = zeros (2 ,1) ;


18 y dot (1) = x dot ;
19 y dot (2) = theta dot ;
20

21 F = f u n c F 1 2 ( t , x dot , t h e t a d o t ) ;
22 % F = zeros ( size (y) ) ;
23

24 y d d o t = ( (M+A) ˆ( −1) ) ∗ (F−B∗ y dot −C∗y ) ;


25 x ddot = y ddot (1) ;
26 theta ddot = y ddot (2) ;
27

28 dqdt = z e r o s ( s i z e ( q ) ) ;
29 dqdt ( 1 ) = q ( 3 ) ;
30 dqdt ( 2 ) = q ( 4 ) ;
31 dqdt ( 3 ) = x d d o t ;
32 dqdt ( 4 ) = t h e t a d d o t ;
33

34

35 dqdt2 = [ q ( 3 ) ; q ( 4 ) ; ( i n v (M+A) ) ∗ (F−B∗ [ q ( 3 ) ; q ( 4 ) ]−C∗ [ q ( 1 ) ; q ( 2 ) ] ) ] ;


36

37 end

77
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ dqdt ] = f u n c d q d t 1 7 ( t , q )
2

3 g l o b a l M A B C;
4

5 x = q(1) ;
6 theta = q (2) ;
7 x dot = q (3) ;
8 theta dot = q(4) ;
9 C T = q(5) ;
10

11 % x 0 dot = q (3) ;
12 % theta 0 dot = q(4) ;
13

14 y = zeros (2 ,1) ;
15 y(1) = x ;
16 y (2) = theta ;
17

18 y dot = zeros (2 ,1) ;


19 y dot (1) = x dot ;
20 y dot (2) = theta dot ;
21

22 [ F , dCdt ] = f u n c F 1 7 ( t , x dot , t h e t a d o t , C T ) ;
23 % F = zeros ( size (y) ) ;
24

25 y d d o t = (M+A) ˆ( −1) ∗ (F−B∗ y dot −C∗y ) ;


26 x ddot = y ddot (1) ;
27 theta ddot = y ddot (2) ;
28

29 dqdt = z e r o s ( s i z e ( q ) ) ;
30 dqdt ( 1 ) = q ( 3 ) ;
31 dqdt ( 2 ) = q ( 4 ) ;
32 dqdt ( 3 ) = x d d o t ;
33 dqdt ( 4 ) = t h e t a d d o t ;
34 dqdt ( 5 ) = dCdt ;
35 end

78
Report 5: Dynamic model for simplified OC3-Hywind concept

1 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

2 % f u n c l a t e x t a b l e ( f i l e n a m e , format ,M, V, C)
3 % This v e r s i o n o n l l y works on Matlab 2016 a and l a t e r
4 %
5 % f i l e n a m e = must be a s t r i n g w i t h o u t t h e e x t e n s i o n
6 % f o r m t a t = %0.2 e , %d , %i , . . . s e a r c h f o r format
7 % M = matrix with t h e v a l u e s
8 % V = a r r a y o f s t r i n g s d e f i n i n g each colum o f M
9 % C = a r r a y o f s t r i n g s d e f i n i n g each l i n e o f M
10 %
11 % P . S . : 1 − Whenever t h e c h a r a c t e r ’ \ ’ i s d e s i r e d i n t h e LaTeX f i l e , ’ \ \ ’
12 % s h o u l d be used i n t h i s Matlab f u n c t i o n . This i s due t o t h e f a c t
13 % t h a t ’ \ ’ i s s e e n a s a r e s t r i c t c h a r a c t e r by Matlab .
14 % 2 − This v e r s i o n o n l l y works on Matlab 2016 and l a t e r
15 %
16 % Example :
17 %
18 % f i l e n a m e = [ ’ t a b t e s t ’ ] ; % output w i l l be t a b t e s t . t e x
19 % format = ’%0.2 e ’ ;
20 % M = rand ( 4 , 3 ) ;
21 % V = [ ” $M { s t a t i c }$ ” , ” $M { dynamic } $ ” , ” $M { t o t a l } $ ” ] ;
22 % C = [ ” min ” ; ” max ” ; ” mean ” ; ” $ \\ sigma$ ” ] ;
23 %
24 % Import t h e g e n e r a t e d f i l e ’ f i l e n a m e . tex ’ i n t o t h e l a t e x f o l d e r . In t h e
25 % LaTeX f i l e w r i t e :
26 %
27 % \ b e g i n { t a b l e } [H]
28 % \ i n p u t { t a b t e s t } % i . e . t a b t e s t = f i l e n a m e . Again , no e x t e n s i o n used
29 % \ l a b e l { t a b t e s t } % i s u s e f u l to use l a b e l = filename
30 % \ c a p t i o n { Table d e s c t r i p t i o n }
31 % \ end { t a b l e }
32 %
33 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

34 % Author : Lucas Gomes de Camargos S i l v e i r a


35 % F r e e e f o r : r e p r o d u c t i o n , d i s t r i b u t i o n , m o d i f i c a t i o n s and whatever
36 % version :
37 % 3 − (11/2017)
38 % 2 − (10/2017)
39 % 1 − (01/2008)
40 %
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

41

42 f u n c t i o n f u n c l a t e x t a b l e ( f i l e n a m e , format ,M, V, C)
43

44 f i l e I D = f o p e n ( [ f i l e n a m e , ’ . t e x ’ ] , ’w ’ ) ;
45 %f p r i n t f ( f i l e I D , ’ \ \ b e g i n { t a b l e } [H] \n ’ ) ;

79
Report 5: Dynamic model for simplified OC3-Hywind concept

46 f p r i n t f ( f i l e I D , ’ \\ c e n t e r i n g \n ’ ) ;
47 f p r i n t f ( f i l e I D , ’ \\ b e g i n { t a b u l a r } ’ ) ;
48 fprintf ( fileID , ’{ ’ ) ;
49 f o r c =1: s i z e (M, 2 )
50 fprintf ( fileID , ’c | ’ ) ;
51 end
52 f p r i n t f ( f i l e I D , ’ c } \n ’ ) ;
53 f p r i n t f ( f i l e I D , ’ \\ h l i n e \n ’ ) ;
54 f p r i n t f ( f i l e I D , ’ \\ h l i n e \n ’ ) ;
55

56 fprintf ( fileID , ’ & ’ ) ;


57 f o r c =1: s i z e (M, 2 )
58 f p r i n t f ( f i l e I D ,V( c ) ) ;
59 i f c==s i z e (M, 2 )
60 f p r i n t f ( f i l e I D , ’ \\\\ \n ’ ) ;
61 else
62 fprintf ( fileID , ’ & ’ ) ;
63 end
64 end
65 f p r i n t f ( f i l e I D , ’ \\ h l i n e \n ’ ) ;
66

67 f o r l =1: s i z e (M, 1 )
68 f p r i n t f ( f i l e I D , C( l ) ) ;
69 fprintf ( fileID , ’ & ’ ) ;
70 f o r c =1: s i z e (M, 2 )
71 f p r i n t f ( f i l e I D , format ,M( l , c ) ) ;
72 i f c==s i z e (M, 2 )
73 f p r i n t f ( f i l e I D , ’ \\\\ \n ’ ) ;
74 else
75 fprintf ( fileID , ’ & ’ ) ;
76 end
77 end
78 end
79 f p r i n t f ( f i l e I D , ’ \\ h l i n e \n ’ ) ;
80 f p r i n t f ( f i l e I D , ’ \\ h l i n e \n ’ ) ;
81

82 f p r i n t f ( f i l e I D , ’ \\ end { t a b u l a r }\n ’ ) ;
83 % f p r i n t f ( f i l e I D , [ ’ \ \ c a p t i o n { ’ , c a p t i o n , ’ } \n ’ ] ) ;
84 % f p r i n t f ( f i l e I D , [ ’ \ \ l a b e l { ’ , l a b e l , ’ } \n ’ ] ) ;
85 % f p r i n t f ( f i l e I D , ’ \ \ end { t a b l e }\n ’ ) ;
86 fclose ( fileID ) ;
87 end

80
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ eta , u , dudt ] = f u n c l i n e a r w a v e s ( g , h , f , S , t , z , e p s i l o n )
2

3 d e l t a f = f ( 2 )−f ( 1 ) ;
4

5 a = (2.∗S.∗ delta f ) .ˆ(0.5) ;


6 omega = 2 . ∗ p i . ∗ f ;
7

8 % Values o f k ( f )
9 k = zeros ( size ( f ) ) ;
10 f o r p=1: l e n g t h ( f )
11 k ( p ) = f z e r o (@( k ) omega ( p ) .ˆ2 −( g . ∗ k . ∗ tanh ( k . ∗ h ) ) , omega ( p ) . ˆ 2 . / g ) ;
12 end
13

14 % Pre−a l l o c a t i n g memory
15 u = zeros ( length ( t ) , length ( z ) ) ;
16 dudt = z e r o s ( l e n g t h ( t ) , l e n g t h ( z ) ) ;
17

18 N = length ( t ) ;
19

20 % Surface elevation
21 e t a ( : ) = N∗ r e a l ( i f f t ( pad2 ( a . ∗ exp ( 1 i ∗ e p s i l o n ) ,N) ) ) ;
22

23 h s c h e c k = 4∗ s t d 2 ( e t a ( : ) ) ;
24 % beta = 6.0/ hs check ;
25 b e t a = 4∗ s q r t ( t r a p z ( f , S ) ) / h s c h e c k ;
26 a = a∗ beta ;
27

28 e t a ( : ) = N∗ r e a l ( i f f t ( pad2 ( a . ∗ exp ( 1 i ∗ e p s i l o n ) ,N) ) ) ;


29

30 for i z = 1: length ( z )
31 z c = z( i z ) ;
32

33 b ( : ) = omega ( : ) . ∗ a ( : ) . ∗ c o s h ( k ( : ) . ∗ ( z c+h ) ) . / s i n h ( k ( : ) . ∗ h ) ;
34 c ( : ) = 1 i . ∗ omega ( : ) . ∗ b ( : ) ;
35

36 u ( : , i z ) = N∗ r e a l ( i f f t ( pad2 ( b . ∗ exp ( 1 i ∗ e p s i l o n ) ,N) ) ) ;


37 dudt ( : , i z ) = N∗ r e a l ( i f f t ( pad2 ( c . ∗ exp ( 1 i ∗ e p s i l o n ) ,N) ) ) ;
38 end
39 end

81
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n [ eta , u , dudt ] = f u n c r e g u l a r w a v e ( z , T, H, t )
2 % T : wave p e r i o d [ s ]
3 % H : wave h e i g h t [m]
4 % t : time s e r i e s [ s ]
5 g = 9 . 8 1 ; % g r a v i t y [m/ s ˆ 2 ]
6 h = 320 ; % depht [m]
7

8 omega = 2∗ p i /T ; % wave f r e q u ncy [ Hz ]


9 k = f z e r o (@( k ) omegaˆ2−(g∗k∗ tanh ( k∗h ) ) , ( omega ˆ 2 ) / g ) ;
10

11 % lambda = 2 . ∗ p i /k ; % peak d i s t a n c e [m]


12

13 % s u r f a c e e l e v a t i o n a t x=0
14 e t a = H/ 2 . ∗ c o s ( omega . ∗ t ) ;
15

16 % v e l o c i t y p r o f i l e with depht
17 % u = u( t , z )
18 u = zeros ( length ( t ) , length ( z ) ) ;
19 dudt = z e r o s ( l e n g t h ( t ) , l e n g t h ( z ) ) ;
20 f o r i =1: l e n g t h ( t )
21 f o r j =1: l e n g t h ( z )
22 u( i , j ) = ( omega . ∗H. / 2 ) . ∗ ( c o s h ( k . ∗ ( z ( j )+h ) ) . / s i n h ( k . ∗ h ) ) . ∗
c o s ( omega . ∗ t ( i ) ) ;
23 dudt ( i , j ) = −((omega ˆ 2 ) . ∗H. / 2 ) . ∗ ( c o s h ( k . ∗ ( z ( j )+h ) ) . / s i n h ( k . ∗ h ) )
. ∗ s i n ( omega . ∗ t ( i ) ) ;
24 end
25 end
26 end

82
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n Y = ode4 ( odefun , tspan , y0 , v a r a r g i n )


2 %ODE4 S o l v e d i f f e r e n t i a l e q u a t i o n s with a non−a d a p t i v e method o f o r d e r
4.
3 % Y = ODE4(ODEFUN,TSPAN, Y0) with TSPAN = [ T1 , T2 , T3 , . . . TN]
integrates
4 % t h e system o f d i f f e r e n t i a l e q u a t i o n s y ’ = f ( t , y ) by s t e p p i n g from T0
to
5 % T1 t o TN. Function ODEFUN(T,Y) must r e t u r n f ( t , y ) i n a column v e c t o r .
6 % The v e c t o r Y0 i s t h e i n i t i a l c o n d i t i o n s a t T0 . Each row i n t h e
solution
7 % a r r a y Y c o r r e s p o n d s t o a time s p e c i f i e d i n TSPAN.
8 %
9 % Y = ODE4(ODEFUN,TSPAN, Y0 , P1 , P2 . . . ) p a s s e s t h e a d d i t i o n a l p a r a m e t e r s
10 % P1 , P2 . . . t o t h e d e r i v a t i v e f u n c t i o n a s ODEFUN(T, Y, P1 , P2 . . . ) .
11 %
12 % This i s a non−a d a p t i v e s o l v e r . The s t e p s e q u e n c e i s d e t e r m i n e d by
TSPAN
13 % but t h e d e r i v a t i v e f u n c t i o n ODEFUN i s e v a l u a t e d m u l t i p l e t i m e s p e r
step .
14 % The s o l v e r implements t h e c l a s s i c a l Runge−Kutta method o f o r d e r 4 .
15 %
16 % Example
17 % tspan = 0 : 0 . 1 : 2 0 ;
18 % y = ode4 ( @vdp1 , tspan , [ 2 0 ] ) ;
19 % p l o t ( tspan , y ( : , 1 ) ) ;
20 % s o l v e s t h e system y ’ = vdp1 ( t , y ) with a c o n s t a n t s t e p s i z e o f 0 . 1 ,
21 % and p l o t s t h e f i r s t component o f t h e s o l u t i o n .
22 %
23

24 i f ˜ isnumeric ( tspan )
25 e r r o r ( ’TSPAN s h o u l d be a v e c t o r o f i n t e g r a t i o n s t e p s . ’ ) ;
26 end
27

28 i f ˜ i s n u m e r i c ( y0 )
29 e r r o r ( ’Y0 s h o u l d be a v e c t o r o f i n i t i a l c o n d i t i o n s . ’ ) ;
30 end
31

32 h = d i f f ( tspan ) ;
33 i f any ( s i g n ( h ( 1 ) ) ∗h <= 0 )
34 e r r o r ( ’ E n t r i e s o f TSPAN a r e not i n o r d e r . ’ )
35 end
36

37 try
38 f 0 = f e v a l ( odefun , t s p a n ( 1 ) , y0 , v a r a r g i n { : } ) ;
39 catch
40 msg = [ ’ Unable t o e v a l u a t e t h e ODEFUN a t t0 , y0 . ’ , l a s t e r r ] ;
41 e r r o r ( msg ) ;
42 end
43

44 y0 = y0 ( : ) ; % Make a column v e c t o r .
45 i f ˜ i s e q u a l ( s i z e ( y0 ) , s i z e ( f 0 ) )

83
Report 5: Dynamic model for simplified OC3-Hywind concept

46 e r r o r ( ’ I n c o n s i s t e n t s i z e s o f Y0 and f ( t0 , y0 ) . ’ ) ;
47 end
48

49 neq = l e n g t h ( y0 ) ;
50 N = length ( tspan ) ;
51 Y = z e r o s ( neq ,N) ;
52 F = z e r o s ( neq , 4 ) ;
53

54 Y( : , 1 ) = y0 ;
55 f o r i = 2 :N
56 t i = t s p a n ( i −1) ;
57 h i = h ( i −1) ;
58 y i = Y( : , i −1) ;
59 F ( : , 1 ) = f e v a l ( odefun , t i , yi , v a r a r g i n { : } ) ;
60 F ( : , 2 ) = f e v a l ( odefun , t i +0.5∗ hi , y i +0.5∗ h i ∗F ( : , 1 ) , v a r a r g i n { : } ) ;
61 F ( : , 3 ) = f e v a l ( odefun , t i +0.5∗ hi , y i +0.5∗ h i ∗F ( : , 2 ) , v a r a r g i n { : } ) ;
62 F ( : , 4 ) = f e v a l ( odefun , t s p a n ( i ) , y i+h i ∗F ( : , 3 ) , v a r a r g i n { : } ) ;
63 Y( : , i ) = y i + ( h i / 6 ) ∗ (F ( : , 1 ) + 2∗F ( : , 2 ) + 2∗F ( : , 3 ) + F ( : , 4 ) ) ;
64 end
65 Y = Y. ’ ;

84
Report 5: Dynamic model for simplified OC3-Hywind concept

1 f u n c t i o n aPad=pad2 ( a ,M)
2 % pads a with one z e r o i n f r o n t and t r a i l i n g z e r o s i n t h e back t o o b t a i n
a
3 % vector of length M
4 %
5 % aPad=[0 a 0 0 0 0 0 . . . ]
6

7 i f l e n g t h ( a )+1 > M
8 d i s p ( ’M t o o s m a l l t o pad v e c t o r ’ )
9 stop
10 end
11

12 i f iscolumn ( a )
13 aPad=z e r o s (M, 1 ) ;
14 else
15 aPad=z e r o s ( 1 ,M) ;
16 end
17

18 n=l e n g t h ( a ) ;
19

20 aPad ( 1 ) =0;
21 aPad ( 2 : n+1)=a ;
22

23 return

85

You might also like