1- function f = secondOrderExt(time_vector ,fastVaryingForce ,slowVaryingForce ,t )
1+ function f_rotated = secondOrderExt(time_vector , fastVaryingForce , slowVaryingForce , t , displacement )
22% The second-order forces related to the Quadratic Transfer Functions (QTFs) are calculated
33% in the frequency domain during the initialization step within the methods of the bodyClass.
44
1010% (the time series can be obtained through an FFT).
1111% - The time series of second-order forces will act on a single point at the origin
1212% (similarly to the first-order forces).
13- % - Wave forces and moments are fixed to a reference frame that translates
14- % (but does not rotate) with the platform. This can be implemented using force rotations.
13+ % - The function assumes small X-Y displacments (To be done in future releases).
1514% - Wavelengths are large compared to the motion of the platform.
16- % - Current WEC-Sim version solves the Full QTFs.
1715% - Single wave direction is assumed.
1816
19- [~ ,Index ] = min(abs(time_vector - t ));
17+ [~ , index ] = min(abs(time_vector - t ));
2018
21- f = fastVaryingForce(Index ,: )' + slowVaryingForce(Index ,: )' ;
19+ f = fastVaryingForce(index ,: )' + slowVaryingForce(index ,: )' ;
20+
21+ % Apply rotation
22+ [phi , theta , psi ] = deal(displacement(4 ), displacement(5 ), displacement(6 ));
23+ rotMat = eulXYZ2RotMat(phi , theta , psi );
24+ f_rotated = [rotMat * f(1 : 3 ) ; rotMat * f(4 : end )];
2225
2326end
0 commit comments