Abstract
The amplitudes and phase lags of tides or tidal currents, which are collectively known as tidal harmonic constants (THCs), cannot be interpolated linearly and separately. Mistreatment for the interpolations could occur, and indeed, it is seen even in the literature. This note clarifies this topic by providing correct formulas to interpret THCs. One has to perform a nonlinear and coupled interpolation of THCs to have equivalence to the liner interpolation in the time domain.
Similarly, tidal current ellipse parameters (ep-parameters) cannot be interpolated linearly and separately. To interpolate ep-parameters, this note recommends that one should first convert them to amplitude and phase lag parameters (ap-parameters) and then use the nonlinear and coupled interpolants proposed herein to interpolate the ap-parameters, followed by converting the results back to ep-parameters.
Examples are provided to illustrate the problems and MATLAB functions are provided in Appendix as interpolating tools.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Tidal heights or currents at a location with a single tidal constituent frequency ω can be described as follows:
where a and ϕ are the amplitude and the phase lag, respectively, and the value of ω can be assigned based on astronomic knowledge. The amplitude and phase lag at one location are constant in time; therefore, they are also collectively referred to as tidal harmonic constants (THCs). Often, interpolations of THCs must be performed. For example, given two pairs of THCs at two locations, say (a 1, ϕ 1) and (a 2, ϕ 2) at x 1 and x 2, we may want to interpolate them to obtain a new pair of THCs at a point somewhere in between.
An incorrect approach is to interpolate the amplitudes and phase lags linearly and separately. For amplitude, one might calculate as follows:
where α and β are interpolation weights, and their sum is equal to one. For phase lag, one might calculate as follows:
where atan2 is an inverse function of the tangent and provides angles ranging from −π to π (e.g., Park et al. (2012)). However, this is not correct as we will see in the next section. This incorrect approach could even be carried over to intenerating tidal current ellipse parameters (Byun and Hart 2017). To clarify the confusion, this note is dedicated to presenting correct THC interpolants.
The next section will derive correct THC interpolants. The “Examples” section will provide examples for 1-D and 2-D interpolations to demonstrate how the interpolants are applied and to illustrate the differences from the results obtained using the incorrect interpolants as of Eqs. (2), (3), and (4). Five MATLAB functions for the THC interpolations are presented in Appendix.
2 Nonlinear and coupled interpolants for THCs
This section derives two interpolants for amplitudes and phase lags, respectively. The interpolants will be nonlinear and coupled in term of given amplitudes and phase lags (ap-parameters). The starting point for the derivation is a linear interpolation in terms of the time functions of tidal heights or currents as expressed by Eq. (1). It is emphasized here from the outset that to have a linear interpolation in the time domain, one has to perform a nonlinear interpolation in the ap-parameters domain (which may also be referred as the spectrum domain). This is understandable because the ap-parameters work together nonlinearly to affect tidal heights and currents.
Suppose that at x = x 1 and x = x 2 (assuming x 2 > x 1), two pairs of THCs, (a 1, ϕ 1) and (a 2, ϕ 2), are known, with which we can describe tidal height (or a current component) at these two locations as follows:
Also, suppose that we would like to know u(t) at x somewhere in between x 1 and x 2 by a linear interpolation of u 1(t) and u 2(t), i.e.,
where α and β are interpolation weights, with α = (x 2 − x)/(x 2 − x 1) and β = 1 − α (interpolation in the time domain). Further, assume that we do not wish to perform interpolation for every point of time; rather, we wish to perform interpolation once and directly on the two pairs of THCs to obtain a new pair of THCs at x (interpolation in the spectrum domain). When the new pair of THCs interpolated from the spectrum domain is inserted into Eq. (1), the resulting time series u(t) will be identical to the one interpolated in the time domain using Eq. (7). This is the mathematical setup for the problem. Now, let us solve it.
In fact, it can be easily solved by expanding Eq. (7) as follows:
Equation (1) can be rewritten as follows:
By equating the coefficients of cosωt and sinωt from the right-hand sides of the above two equations, we obtain the following:
from which we can solve for a and ϕ as follows:
Note that by using atan2 (in MATLAB) instead of atan in Eq. (12), the amplitude a values in Eqs. (13) and (14) are guaranteed to be positive. Equations (12) and (13) (or Eq. (14)) are the correct interpolants to interpolate THCs. The time series reconstructed from so interpolated THCs will observe the linear interpolation in the time domain as specified in Eq. (7). This will not be the case if Eqs. (2) to (4), or any other formulas, are used as interpolants instead.
When 2-D interpolations are required, the 1-D interpolation can be applied in one direction first, and the results can be further interpolated in another direction. This process will be illustrated in examples 2 and 3 in the next section.
This paper is meant as a short note paper and could end here now. However, to help readers better intuit the problem and observe the consequences of correct and incorrect interpolations graphically, some examples are provided in the next section. The examples will also bring in MATLAB functions for THC interpolation, which should be useful for ocean modelling community.
3 Examples
This section shows three examples, one for a 1-D interpolation and two for 2-D interpolations. Five MATLAB functions listed in Appendix for the THC interpolations will also be briefly introduced.
3.1 Example 1: 1-D interpolation
Let ω = 2π/T with T = 12 h for the semi-diurnal frequency, let a 1 = 1.50 m and ϕ 1 = 45.00 deg at x 1 = 0, let a 2 = 2.00 m, and ϕ 2 = − 45.00 degat x 2 = 1 (the unit of the coordinates is understood because it is not relevant to the interpolation problem here). Suppose at x i = 0.6, we want to know the THCs by interpolation. First, we need to calculate the interpolation weights of α and β according to the following:
By substituting the given x 1, x 2, and x i , we have α = 0.35 and β = 0.65. With the given (a 1, ϕ 1) and (a 2, ϕ 2), we then have the following:
In comparison, using the interpolants of Eqs. (2)–(4), we obtain values of a = 1.8250 m and \( \phi =-16.6992\kern0.2em \deg \overset{\mathrm{or}}{=}343.3008\kern0.2em \deg \), which differ greatly from the correct values.
Figure 1 shows the four time series of u 1 and u 2 and two versions of the interpolated u i that represent the correct and incorrect versions. The green curve (the correct interpolation) always remains between the two data curves (blue and black), which is most evident when the green curve runs through the points where the black and blue curve intersect. This is what we expect from a liner interpolation in the time domain between the two data curves. If linear interpolation is performed for every point of time according to Eq. (7), the result will be the same as the green curve. However, the red curve (the incorrect interpolation) sometimes travels even beyond the envelope of the two data curves; in fact, it violates the liner interpolation required by Eq. (7) all the time.
List 1 and List 2 in Appendix are two MATLAB functions interp1_w and THCinterp1, which are used for this example. The function interp1_w calculates the interpolation weights of the given coordinates for a set of data points (x) and coordinates for the interpolation points (x i ). The function THCinterp1 implements the 1-D interpolation using Eqs. (12) and (13).
3.2 Example 2: 2-D interpolation of amplitudes and phase lags
This example demonstrates how the 1-D interpolants can be extended for a 2-D interpolation. The top two panels of Fig. 2 show amplitudes (left panel) and phase lags (right panel), with the original THC data defined on the grid points printed in blue. The interpolation problem here is to interpolate the original THC data on to the centers of the cells as indicated by the circles. The MATLAB function THCinterp2mat in List 3 of Appendix is used for interpolation. It applies the 1-D interpolants of Eqs. (12) and (13) twice. The first application is in the x-direction, where the amplitudes and phase lags on each of the horizontal lines are interpolated to the middle points of each segment marked by the “x” on the horizontal lines. With the interpolated amplitudes assigned on the “x” points, the 1-D interpolation is applied again but in the y-direction. In terms of spatial coverage, this bi-directional approach is the same as a standard bi-linear interpolation in the sense that they both apply a one-dimensional interpolant twice. However, in terms of interpolants used, the bi-directional approach proposed here is different from the standard bi-linear interpolation. The former uses a nonlinear interpolant, and the latter uses a linear interpolant.
The interpolated results are printed in green beneath the circle points. For comparison, the results obtained using the incorrect 1-D interpolants of Eqs. (2)–(4) in the above bi-directional approach are also printed in red above the circles. To see how the time series will differ using these correct and incorrect THCs, let us focus on the shaded cell on the second row and fourth column of the top two panels. From the correctly and incorrectly interpolated amplitudes and phase lags shown in the middle of the cell, we can reconstruct two versions of the time series. We can also use the amplitudes and phase lags shown on the four corners of the cell to reconstruct four data time series. All the time series are shown in the bottom panel in green, red and gray, respectively. Since the interpolation point is in the center of the cell, the correct interpolated value is an arithmetical average of the four gray curves at each time step, as is the case with the green curve. The red curve is clearly incorrect.
The function THCinterp2mat assumes that xx and yy are gridded data coordinates and the interpolation points of xxi and yyi are also gridded. There are also cases where we need to interpolate from gridded data points to irregular points. The MATLAB function THCinterp2 provided in List 4 in Appendix satisfies this need. This function also works for cases where the interpolation points are gridded points as well; however, the computational speed will be slightly slower than using THCinterp2mat. Interpolations from irregular points to irregular points can be also considered but are not addressed further here.
3.3 Example 3: 2-D interpolation of tidal current ellipse parameters
For tidal current, we can generally neglect its weak vertical component and focus on its two strong horizontal components, u and v. Referring to Eq. (1), we see that to describe u and v, we need two pairs of parameters, (a u , ϕ u ) and (a v , ϕ v ). Interpolations on these ap-parameters can be performed with Eqs. (12) and (13), following the procedures illustrated by the above two examples.
On the other hand, by plotting v against u, we will see an ellipse. Therefore, tidal currents can also be described by ellipse parameters (ep-parameters). The ap-parameters and ep-parameters can be converted into each other by using the ap2ep and ep2ap MATLAB functions developed by Xu (2000, 2002). One might work out a set of interpolants that can be directly applied to ep-parameters, but such a set might be very complicated. It is better to convert ep-parameters to ap-parameters first, then using Eqs. (12) and (13) as the interpolants, and then convert the results back to the ep-parameters. The MATLAB function THCepinterp2 shown in List 5 in Appendix assumes these steps.
Figure 3 illustrates an interpolation of tidal ellipses. Four data ellipses are provided at four corners of a grid cell. The ellipse drawn on the center of the cell is interpolated from the four data ellipses. The interpolation can be performed by calling THCepinerp2 in this way:
where
are two matrices containing the coordinates of the four grid points, and the EP is a MATLAB structure with the ep-parameters of the data ellipses as its fields:
where the four fields EP.SEMA, EP.INC, EP.ECC, and EP.PHA contain the lengths of the semi-major axes, the orientations (inclinations) of the semi-major axes, the eccentricities,Footnote 1 and the phase angles of the four data ellipses, respectively. The phase angle of a tidal ellipse indicates a time that is expressed as an angle (= time × frequency) when the tidal current reaches its maximum speed. The interpolation point is the center of the cell, which means that x i = 0.5 and y i = 0.5.
As we can see, the interpolated ellipse is much smaller than any of the four data ellipses. This seems surprising but it is actually correct, because the u- and v-time series represented by the four ellipses are out of phase to a large degree. Figure 4 shows time series of u-components (top panel) and v-components (bottom panel) reconstructed from the data ellipses (in gray) and from the interpolated ellipse (in green). Since the interpolation point is in the center of the cell, the green curve for the u-component should simply be an arithmetic average of the four gray curves of the u-components; so is the green curve for the v-component. As we can see, the four time series at the four corners of the cell have very different phases, which causes their average in the middle of the cell to have a much smaller amplitude. This example demonstrates the importance of treating tidal ellipse interpolation appropriately.
The semi-major axes of the ellipses are shown in the range of [0, 180°) in Fig. 3. The semi-minor axes are shown 90° from the semi-major axes, and they are either counter-clockwise or clockwise depending on whether the eccentricity is positive or negative. The inclinations of the semi-major axes do not have to be in the direction as shown. Their opposite directions could have well been chosen as the inclinations. However, to choose the inclinations to be in the range of [0, 180°) is conventional, the so-called the northern axis convention (Foreman 1978, p. 13). The ap2ep and ep2ap functions have two versions. The one provided by Xu (2000) allows inclinations in the range of [0, 380°), whereas the revised version by Xu (2002) adopts the northern axis convention. Both versions will give the same ap-parameters however. Therefore, no matter which version one may prefer, the interpolation will not be affected.
4 Conclusions
The amplitude and phase parameters (ap-parameters) for tidal heights and tidal currents cannot be interpolated in space as though they are independent quantities—errors arise when they are interpolated separately and linearly. This note paper provides correct nonlinear and coupled interpolation interpolants: Eqs. (12) and (13) (or (14)), together with examples and MATLAB functions. When these interpolants are used, the time series reconstructed from the interpolated ap-parameters are identical to those obtained by interpolating the tidal height or current time series.
Similarly, the tidal current ep-parameters cannot be interpolated linearly and separately. First, they should be converted to ap-parameters. Then, the nonlinear and coupled interpolants can be used to interpolate the ap-parameters, followed by converting the results back to ep-parameters.
The MATLAB functions listed in Appendix provide tools to interpolate THCs. These functions relieve uses from the complexity of the interpolations and provide an easy user interface. The function THCepinterp2 is a tool for interpolating tidal ep-parameters, a procedure that can otherwise be quite complicated and prone to error.
Notes
Due to a historical reason in oceanography, the eccentricity is defined as the ratio of the semi-minor axis to the semi-major axis of the ellipse, which is different to the usual mathematical definition. Its negative value indicates that the ellipse traverses in a clockwise rotation.
References
Byun DS, Hart DE (2017) A robust interpolation for producing tidal current ellipse inputs to regional and coastal ocean numerical models. Ocean Dyn 67(3–4):451–463. https://doi.org/10.1007/s10236-017-1037-4
Foreman MGG (1978) Manual for Tidal Currents Analysis and Prediction, Pacific Marine Science Report 78-6, Institute of Ocean Sciences, Patricia Bay, Sidney. British Columbia, 70
Park SY, Byun DS, Hart DE (2012) A solution for the correct interpolation of data across regions with abrupt changes in tidal phase-lag. Ocean Sci J 47(3):215–219. https://doi.org/10.1007/s12601-012-0022-6
Xu Z (2000) Ellipse parameters conversion and vertical velocity profiles for tidal currents. Bedford Institute of Oceanography, Fisheries and Oceans Canada. Canada, 20 p. The first edition. Available at https://www.researchgate.net/publication/312234150_Ellipse_Parameters_Conversion_and_Velocity_Profile_For_Tidal_Currents
Xu 2002 Ellipse Parameters Conversion and Velocity Profiles for Tidal Currents in Matlab. Maurice Lamontagne Institute, Ocean Science Division, Fisheries and Oceans Canada. 2nd edn. Available at https://www.researchgate.net/publication/284367541_Ellipse_Parameters_Conversion_and_Velocity_Profiles_for_Tidal_Currents_in_Matlab
Author information
Authors and Affiliations
Corresponding author
Additional information
Responsible Editor: Lie-Yauw Oey
Appendix: MATLAB functions for interpolating THCs
Appendix: MATLAB functions for interpolating THCs
List 1 Function interp1_w for calculating the interpolation weights.
List 2 Function THCinterp1 for performing 1-D interpolations of tidal harmonic constants
List 3 Function THCinterp2mat for performing 2-D tidal harmonic constant interpolations. Both the data coordinate points and interpolation points must be gridded
List 4 Function THCinterp2 for performing 2-D tidal harmonic constant interpolations. The data coordinate points must be gridded, whereas the interpolation points do not have to be gridded
List 5 Function THCepinterp2 for performing 2-D interpolations of the tidal ellipse parameters
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Xu, Z. A note on interpreting tidal harmonic constants. Ocean Dynamics 68, 211–222 (2018). https://doi.org/10.1007/s10236-017-1122-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10236-017-1122-8