Difference between revisions of "LSF Tides"

From WikiROMS
Jump to navigationJump to search
 
Line 1: Line 1:
<div class="title">Least Squares Fit for ROMS Tides</div>
<div class="title">Least Squares Fit for ROMS Tides</div>


<wikitex>A ROMS state variable, $\phi$, can be represented in terms of its time mean, $\bar\phi$, plus a set of $N$-tidal harmonics of frequency, $\omega_k$.
A ROMS state variable, <math>\phi</math>, can be represented in terms of its time mean, <math>\bar\phi</math>, plus a set of <math>N</math>-tidal harmonics of frequency, <math>\omega_k</math>.


$$\phi(t) = \bar\phi + \sum_{k=1}^N A_k \sin\omega_k t + \sum_{k=1}^N B_k \cos\omega_k t$$
<math display="block">
  \phi(t) = \bar\phi + \sum_{k=1}^N A_k \sin\omega_k t + \sum_{k=1}^N B_k \cos\omega_k t
</math>


The unknown tidal amplitude $A_k$, and $B_k$ and unknown state $\phi$ coefficients are evaluated by minimizing the least-squares error function defined by:
The unknown tidal amplitude <math>A_k</math>, and <math>B_k</math> and unknown state <math>\phi</math> coefficients are evaluated by minimizing the least-squares error function defined by:


$$\varepsilon^2 = \frac{1}{T} \int_{t_1}^{t_2} \left[\phi - \left(\bar\phi + \sum_{k=1}^N (A_k \sin\omega_k t) + \sum_{k=1}^N (B_k \cos\omega_k t)\right)\right]^2dt$$
<math display="block">
  \varepsilon^2 = \frac{1}{T} \int_{t_1}^{t_2} \left[\phi - \left(\bar\phi
                  + \sum_{k=1}^N (A_k \sin\omega_k t)
                  + \sum_{k=1}^N (B_k \cos\omega_k t)\right)\right]^2dt
</math>


In discrete space:
In discrete space:


$$\varepsilon^2 = \frac{1}{M} \sum_{i=1}^M \left[\phi_i - \left(\bar\phi + \sum_{k=1}^N (A_k \sin\omega_k t_i) + \sum_{k=1}^N (B_k \cos\omega_k t_i)\right)\right]^2$$
<math display="block">
  \varepsilon^2 = \frac{1}{M} \sum_{i=1}^M \left[\phi_i - \left(\bar\phi
                  + \sum_{k=1}^N (A_k \sin\omega_k t_i)
                  + \sum_{k=1}^N (B_k \cos\omega_k t_i)\right)\right]^2
</math>


Minimization subject to the additional constraints $\frac{\partial \varepsilon^2}{\partial \bar\phi} = 0$, $\frac{\partial \varepsilon^2}{\partial A_k} = 0$, $\frac{\partial \varepsilon^2}{\partial B_k} = 0$ result in a linear set of equations:
Minimization subject to the additional constraints <math>\frac{\partial \varepsilon^2}{\partial \bar\phi} = 0</math>, <math>\frac{\partial \varepsilon^2}{\partial A_k} = 0</math>, <math>\frac{\partial \varepsilon^2}{\partial B_k} = 0</math> result in a linear set of equations:


$$\sum_{i=1}^M \left[-2\phi_i + 2\bar\phi + 2 \sum_{k=1}^N (A_k \sin\omega_k t_i) + 2 \sum_{k=1}^N (B_k \sin\omega_k t_i)\right] = 0$$
<math display="block">
  \sum_{i=1}^M \left[-2\phi_i + 2\bar\phi + 2 \sum_{k=1}^N (A_k \sin\omega_k t_i)
                + 2 \sum_{k=1}^N (B_k \sin\omega_k t_i)\right] = 0
</math>


$$\sum_{i=1}^M \Bigg[ -2 \phi_i \sin\omega_k t_i + 2 \bar\phi \sin\omega_k t_i + 2\sum_{p=1}^N (A_p \sin\omega_p t_i \sin\omega_k t_i) + 2\sum_{p=1}^N (B_p\cos\omega_p t_i \sin\omega_k t_i)\Bigg] = 0$$
<math display="block">
  \sum_{i=1}^M \Bigg[ -2 \phi_i \sin\omega_k t_i + 2 \bar\phi \sin\omega_k t_i
                + 2\sum_{p=1}^N (A_p \sin\omega_p t_i \sin\omega_k t_i)
                + 2\sum_{p=1}^N (B_p\cos\omega_p t_i \sin\omega_k t_i)\Bigg] = 0
</math>


$$\sum_{i=1}^M \Bigg[ -2 \phi_i \cos\omega_k t_i + 2 \bar\phi \cos\omega_k t_i + 2\sum_{p=1}^N (A_p \sin\omega_p t_i \cos\omega_k t_i) + 2\sum_{p=1}^N (B_p\cos\omega_p t_i \cos\omega_k t_i) \Bigg] = 0$$
<math display="block">
  \sum_{i=1}^M \Bigg[ -2 \phi_i \cos\omega_k t_i + 2 \bar\phi \cos\omega_k t_i
                + 2\sum_{p=1}^N (A_p \sin\omega_p t_i \cos\omega_k t_i)
                + 2\sum_{p=1}^N (B_p\cos\omega_p t_i \cos\omega_k t_i) \Bigg] = 0
</math>


in matrix form ($N$ harmonics). Note: all instances of $\sum$ are actually $\sum_{i=1}^M$ where $M$ is the number of time-steps in the time-averaging window.
in matrix form (<math>N</math> harmonics). Note: all instances of <math>\sum</math> are actually <math>\sum_{i=1}^M</math> where <math>M</math> is the number of time-steps in the time-averaging window.


$$\matrix{\left[ \matrix{
<math display="block">\begin{matrix}
\cr
\begin{bmatrix}
\\
M & \sum \sin\omega_1 t_i & \sum \sin\omega_2 t_i
M & \sum \sin\omega_1 t_i & \sum \sin\omega_2 t_i
& \cdots & \sum \cos\omega_1 t_i & \cdots \cr
& \cdots & \sum \cos\omega_1 t_i & \cdots \\
\cr
\\
\sum \sin\omega_1 t_i & \sum \sin^2 \omega_1 t_i & \sum \sin\omega_2 t_i \sin\omega_1 t_i
\sum \sin\omega_1 t_i & \sum \sin^2 \omega_1 t_i & \sum \sin\omega_2 t_i \sin\omega_1 t_i
& \cdots & \sum \cos\omega_1 t_i \sin\omega_1 t_i & \cdots \cr
& \cdots & \sum \cos\omega_1 t_i \sin\omega_1 t_i & \cdots \\
\cr
\\
\sum \sin\omega_2 t_i & \sum \sin\omega_1 t_i \sin\omega_2 t_i & \sum \sin^2 \omega_2 t_i
\sum \sin\omega_2 t_i & \sum \sin\omega_1 t_i \sin\omega_2 t_i & \sum \sin^2 \omega_2 t_i
& \cdots & \sum \cos\omega_1 t_i \sin\omega_2 t_i & \cdots \cr
& \cdots & \sum \cos\omega_1 t_i \sin\omega_2 t_i & \cdots \\
\cr
\\
\vdots & \vdots & \cdots & \cdots & \cdots & \cdots \cr
\vdots & \vdots & \cdots & \cdots & \cdots & \cdots \\
\cr
\\
\sum \sin\omega_7 t_i & \sum \sin\omega_1 t_i \sin\omega_7 t_i & \sum \sin\omega_2 t_i \sin\omega_7 t_i
\sum \sin\omega_7 t_i & \sum \sin\omega_1 t_i \sin\omega_7 t_i & \sum \sin\omega_2 t_i \sin\omega_7 t_i
& \cdots & \sum \cos\omega_1 t_i \sin\omega_7 t_i & \cdots \cr
& \cdots & \sum \cos\omega_1 t_i \sin\omega_7 t_i & \cdots \\
\cr
\\
\sum \sin\omega_1 t_i & \sum \sin\omega_1 t_i \cos\omega_1 t_i & \sum \sin\omega_2 t_i \cos\omega_1 t_i
\sum \sin\omega_1 t_i & \sum \sin\omega_1 t_i \cos\omega_1 t_i & \sum \sin\omega_2 t_i \cos\omega_1 t_i
& \cdots & \sum \cos^2 \omega_1 t_i & \cdots \cr
& \cdots & \sum \cos^2 \omega_1 t_i & \cdots \\
\cr
\\
\sum \cos\omega_2 t_i & \sum \sin\omega_1 t_i \cos\omega_2 t_i & \sum \sin\omega_2 t_i \cos\omega_2 t_i
\sum \cos\omega_2 t_i & \sum \sin\omega_1 t_i \cos\omega_2 t_i & \sum \sin\omega_2 t_i \cos\omega_2 t_i
& \cdots & \sum \cos\omega_1 t_i \cos\omega_2 t_i & \cdots \cr
& \cdots & \sum \cos\omega_1 t_i \cos\omega_2 t_i & \cdots \\
\cr
\\
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr
\vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\
\cr
\\
\sum \cos\omega_7 t_i & \sum \sin\omega_1 t_i \cos\omega_7 t_i & \sum \sin\omega_2 t_2 \cos\omega_7 t_i
\sum \cos\omega_7 t_i & \sum \sin\omega_1 t_i \cos\omega_7 t_i & \sum \sin\omega_2 t_2 \cos\omega_7 t_i
& \cdots & \sum \cos\omega_1 t_i \cos\omega_7 t_i & \cdots \cr \cr
& \cdots & \sum \cos\omega_1 t_i \cos\omega_7 t_i & \cdots \\ \\ \end{bmatrix}
} \right] &
\;\;&
\left[ \matrix{
\begin{bmatrix}
\cr
\\
\bar\phi \cr \cr A_1 \cr \cr A_2 \cr \cr \vdots \cr \cr A_7 \cr \cr B_1 \cr \cr B_2 \cr \cr \vdots \cr \cr B_7 \cr \cr
\bar\phi \\ \\ A_1 \\ \\ A_2 \\ \\ \vdots \\ \\ A_7 \\ \\ B_1 \\ \\ B_2 \\ \\ \vdots \\ \\ B_7 \\ \\
} \right] &
\end{bmatrix}
= &
& = &
\left[ \matrix{
\begin{bmatrix}
\cr
\\
\sum\phi_i \cr \cr
\sum\phi_i \\ \\
\sum\phi_i \sin\omega_1 ti \cr \cr
\sum\phi_i \sin\omega_1 ti \\ \\
\sum\phi_i \sin\omega_2 ti \cr \cr
\sum\phi_i \sin\omega_2 ti \\ \\
\vdots \cr \cr
\vdots \\ \\
\sum\phi_i \sin\omega_7 ti \cr \cr
\sum\phi_i \sin\omega_7 ti \\ \\
\sum\phi_i \cos\omega_1 ti \cr \cr
\sum\phi_i \cos\omega_1 ti \\ \\
\sum\phi_i \cos\omega_2 ti \cr \cr
\sum\phi_i \cos\omega_2 ti \\ \\
\vdots \cr \cr
\vdots \\ \\
\sum\phi_i \cos\omega_7 ti \cr \cr
\sum\phi_i \cos\omega_7 ti \\ \\
} \right] \cr
\end{bmatrix}
A & x & & b}$$
\\
</wikitex>
A & x & & b
\end{matrix}</math>

Latest revision as of 17:22, 5 August 2015

Least Squares Fit for ROMS Tides

A ROMS state variable, , can be represented in terms of its time mean, , plus a set of -tidal harmonics of frequency, .

The unknown tidal amplitude , and and unknown state coefficients are evaluated by minimizing the least-squares error function defined by:

In discrete space:

Minimization subject to the additional constraints , , result in a linear set of equations:

in matrix form ( harmonics). Note: all instances of are actually where is the number of time-steps in the time-averaging window.