commit 5021c326e2f552156d5d7a80341464b61246ae7b
parent b95abbeeda95adc3153c1ec7c2def7fc730939fe
Author: Ivan Gankevich <i.gankevich@spbu.ru>
Date: Tue, 4 May 2021 23:27:05 +0300
Anton's corrections
Diffstat:
7 files changed, 82 insertions(+), 31 deletions(-)
diff --git a/gnuplot/acf.gnuplot b/gnuplot/acf.gnuplot
@@ -20,7 +20,7 @@ set xlabel 'Lag'
set title offset 0,-1
set lmargin 5
set rmargin 0
-set tmargin 1
+set tmargin 2
set multiplot layout 2,3
round(x) = floor(x+0.5)
@@ -36,7 +36,10 @@ load "build/gnuplot/acf_rmse.gnuplot"
###################################
set yrange [0:2]
-set title sprintf('NRMSE_x = %.1f%%', (acf_x_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE_x = %.1f%%",\
+ strftime('%F %H:%M', acf_x_rmse_max_timestamp),\
+ strftime('%H:%M', acf_x_rmse_max_timestamp+2*60*60),\
+ (acf_x_rmse_max*100))
plot \
filename('x',acf_x_rmse_max_timestamp) index 0 using (-$1):2 with points pt 6 lc '#404040',\
'' index 0 using (-$1):3 with lines lw 2 lc '#4040c0',\
@@ -44,7 +47,10 @@ filename('x',acf_x_rmse_max_timestamp) index 0 using (-$1):2 with points pt 6 lc
'' index 1 using ($1):3 with lines lw 2 lc '#c04040'
set yrange [0:0.25]
-set title sprintf('NRMSE_y = %.1f%%',(acf_y_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE_y = %.1f%%",\
+ strftime('%F %H:%M', acf_y_rmse_max_timestamp),\
+ strftime('%H:%M', acf_y_rmse_max_timestamp+2*60*60),\
+ (acf_y_rmse_max*100))
plot \
filename('y',acf_y_rmse_max_timestamp) index 0 using (-$1):2 with points pt 6 lc '#404040',\
'' index 0 using (-$1):3 with lines lw 2 lc '#4040c0',\
@@ -52,7 +58,10 @@ filename('y',acf_y_rmse_max_timestamp) index 0 using (-$1):2 with points pt 6 lc
'' index 1 using ($1):3 with lines lw 2 lc '#c04040'
set yrange [0:2]
-set title sprintf('NRMSE_z = %.1f%%', (acf_z_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE_z = %.1f%%",\
+ strftime('%F %H:%M', acf_z_rmse_max_timestamp),\
+ strftime('%H:%M', acf_z_rmse_max_timestamp+2*60*60),\
+ (acf_z_rmse_max*100))
plot \
filename('z',acf_z_rmse_max_timestamp) index 0 using (-$1):2 with points pt 6 lc '#404040',\
'' index 0 using (-$1):3 with lines lw 2 lc '#4040c0',\
@@ -65,7 +74,10 @@ filename('z',acf_z_rmse_max_timestamp) index 0 using (-$1):2 with points pt 6 lc
set bmargin 3
set yrange [0:0.25]
-set title sprintf('NRMSE_x = %.1f%%', (acf_x_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE_x = %.1f%%",\
+ strftime('%F %H:%M', acf_x_rmse_min_timestamp),\
+ strftime('%H:%M', acf_x_rmse_min_timestamp+2*60*60),\
+ (acf_x_rmse_min*100))
plot \
filename('x',acf_x_rmse_min_timestamp) index 0 using (-$1):2 with points pt 6 lc '#404040',\
'' index 0 using (-$1):3 with lines lw 2 lc '#4040c0',\
@@ -73,7 +85,10 @@ filename('x',acf_x_rmse_min_timestamp) index 0 using (-$1):2 with points pt 6 lc
'' index 1 using ($1):3 with lines lw 2 lc '#c04040'
set yrange [0:0.25]
-set title sprintf('NRMSE_y = %.1f%%',(acf_y_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE_y = %.1f%%",\
+ strftime('%F %H:%M', acf_y_rmse_min_timestamp),\
+ strftime('%H:%M', acf_y_rmse_min_timestamp+2*60*60),\
+ (acf_y_rmse_min*100))
plot \
filename('y',acf_y_rmse_min_timestamp) index 0 using (-$1):2 with points pt 6 lc '#404040',\
'' index 0 using (-$1):3 with lines lw 2 lc '#4040c0',\
@@ -81,7 +96,10 @@ filename('y',acf_y_rmse_min_timestamp) index 0 using (-$1):2 with points pt 6 lc
'' index 1 using ($1):3 with lines lw 2 lc '#c04040'
set yrange [0:0.1]
-set title sprintf('NRMSE_z = %.1f%%', (acf_z_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE_z = %.1f%%",\
+ strftime('%F %H:%M', acf_z_rmse_min_timestamp),\
+ strftime('%H:%M', acf_z_rmse_min_timestamp+2*60*60),\
+ (acf_z_rmse_min*100))
plot \
filename('z',acf_z_rmse_min_timestamp) index 0 using (-$1):2 with points pt 6 lc '#404040',\
'' index 0 using (-$1):3 with lines lw 2 lc '#4040c0',\
diff --git a/gnuplot/direction-dist.gnuplot b/gnuplot/direction-dist.gnuplot
@@ -10,7 +10,7 @@ set xrange [-180:180]
set xtics -180,90
set yrange [0:2]
set rmargin 1.5
-set tmargin 1
+set tmargin 2
set title offset 0,-1
set multiplot layout 1,2
positive(x) = x<0 ? (1/0) : x
@@ -20,7 +20,9 @@ rad2deg(rad) = (rad * 180) / pi
filename = sprintf('build/direction/vonmises/%d', direction_rmse_max_timestamp)
set lmargin 5
-set title sprintf('NRMSE = %.0f%%, mean speed = %.1fm/s', \
+set title sprintf("%s–%s\nNRMSE = %.0f%%, mean speed = %.1fm/s", \
+ strftime('%F %H:%M', direction_rmse_max_timestamp),\
+ strftime('%H:%M', direction_rmse_max_timestamp+2*60*60),\
round(direction_rmse_max*100), direction_rmse_max_speed)
plot \
filename index 0 using (rad2deg($1)):2 every 5 with points pt 6 lc '#404040' title 'Observed PDF of υ_x',\
@@ -29,7 +31,9 @@ filename index 0 using (rad2deg($1)):2 every 5 with points pt 6 lc '#404040' tit
filename = sprintf('build/direction/vonmises/%d', direction_rmse_min_timestamp)
set lmargin 5
-set title sprintf('NRMSE = %.0f%%, mean speed = %.1fm/s', \
+set title sprintf("%s–%s\nNRMSE = %.0f%%, mean speed = %.1fm/s", \
+ strftime('%F %H:%M', direction_rmse_min_timestamp),\
+ strftime('%H:%M', direction_rmse_min_timestamp+2*60*60),\
round(direction_rmse_min*100), direction_rmse_min_speed)
plot \
filename index 0 using (rad2deg($1)):2 every 5 with points pt 6 lc '#404040' title 'Observed PDF of υ_x',\
diff --git a/gnuplot/hold-peak.gnuplot b/gnuplot/hold-peak.gnuplot
@@ -9,7 +9,7 @@ set output 'build/gnuplot/hold-peak.svg'
set xlabel offset 0,1.0
set xlabel 'Time, s'
set ylabel 'Wind speed, m/s' offset 1.5,0
-set title offset 0,-1
+set title offset 0,-1.5
set lmargin 5
set rmargin 2
set tmargin 4.0
@@ -24,15 +24,21 @@ set yrange [0:5]
set ytics 0,1,5
set xtics 0,30
-set title sprintf('NRMSE = %.1f%%', (speed_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE = %.1f%%",\
+ strftime('%F %H:%M', speed_rmse_max_timestamp),\
+ strftime('%H:%M', speed_rmse_max_timestamp+2*60*60),\
+ (speed_rmse_max*100))
plot \
filename(speed_rmse_max_timestamp) index 0 using 1:2 with points pt 6 lc '#404040',\
'' index 0 using 1:3 with lines lw 2 lc '#c04040',\
'' index 1 using 1:2 with lines lw 2 lc '#c0c040'
-set key Left reverse at screen 0.80, screen 1.00
+set key Left reverse at screen 0.80, screen 1.02
-set title sprintf('NRMSE = %.1f%%', (speed_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE = %.1f%%",\
+ strftime('%F %H:%M', speed_rmse_min_timestamp),\
+ strftime('%H:%M', speed_rmse_min_timestamp+2*60*60),\
+ (speed_rmse_min*100))
plot \
filename(speed_rmse_min_timestamp) index 0 using 1:2 with points pt 6 lc '#404040' title 'Load cell data',\
'' index 0 using 1:3 with lines lw 2 lc '#c04040' title 'HP-866A data',\
diff --git a/gnuplot/velocity-dist.gnuplot b/gnuplot/velocity-dist.gnuplot
@@ -15,7 +15,7 @@ set xlabel 'υ_x' offset 0,1.0
set yrange [0:0.4]
set ytics 0,0.1
set rmargin 0
-set tmargin 1
+set tmargin 2
set multiplot layout 2,3
positive(x) = x<0 ? (1/0) : x
@@ -29,7 +29,10 @@ round(x) = floor(x+0.5)
filename = sprintf('build/velocity/x/weibull/%d', x_rmse_max_timestamp)
set lmargin 5
set title offset 0,-1
-set title sprintf('NRMSE_x = %.1f%%', (x_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE_x = %.1f%%",\
+ strftime('%F %H:%M', x_rmse_max_timestamp),\
+ strftime('%H:%M', x_rmse_max_timestamp+2*60*60),\
+ (x_rmse_max*100))
set xrange [-10:10]
plot \
filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of υ_x',\
@@ -40,7 +43,10 @@ filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of
filename = sprintf('build/velocity/y/weibull/%d', y_rmse_max_timestamp)
set lmargin 5
set xlabel 'υ_y'
-set title sprintf('NRMSE_y = %.1f%%',(y_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE_y = %.1f%%",\
+ strftime('%F %H:%M', y_rmse_max_timestamp),\
+ strftime('%H:%M', y_rmse_max_timestamp+2*60*60),\
+ (y_rmse_max*100))
#set xrange [-4:4]
plot \
filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of υ_y',\
@@ -52,7 +58,10 @@ filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of
filename = sprintf('build/velocity/z/weibull/%d', z_rmse_max_timestamp)
#set xrange [-4:4]
set xlabel 'υ_z'
-set title sprintf('NRMSE_z = %.1f%%', (z_rmse_max*100))
+set title sprintf("%s–%s\nNRMSE_z = %.1f%%",\
+ strftime('%F %H:%M', z_rmse_max_timestamp),\
+ strftime('%H:%M', z_rmse_max_timestamp+2*60*60),\
+ (z_rmse_max*100))
plot \
filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of υ_z',\
'' index 0 using (positive($1)):3 with lines lw 2 lc '#c04040' title 'Estimated PDF of positive υ_z',\
@@ -74,7 +83,10 @@ set ytics 0,0.2
filename = sprintf('build/velocity/x/weibull/%d', x_rmse_min_timestamp)
set lmargin 5
-set title sprintf('NRMSE_x = %.1f%%', (x_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE_x = %.1f%%",\
+ strftime('%F %H:%M', x_rmse_min_timestamp),\
+ strftime('%H:%M', x_rmse_min_timestamp+2*60*60),\
+ (x_rmse_min*100))
plot \
filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of υ_x',\
'' index 0 using (positive($1)):3 with lines lw 2 lc '#c04040' title 'Estimated PDF of positive υ_x',\
@@ -85,7 +97,10 @@ filename = sprintf('build/velocity/y/weibull/%d', y_rmse_min_timestamp)
set lmargin 5
#set xrange [-3:3]
set xlabel 'υ_y'
-set title sprintf('NRMSE_y = %.1f%%', (y_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE_y = %.1f%%",\
+ strftime('%F %H:%M', y_rmse_min_timestamp),\
+ strftime('%H:%M', y_rmse_min_timestamp+2*60*60),\
+ (y_rmse_min*100))
#set xrange [-3:5]
plot \
filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of υ_y',\
@@ -95,7 +110,10 @@ filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of
filename = sprintf('build/velocity/z/weibull/%d', z_rmse_min_timestamp)
set xlabel 'υ_z'
-set title sprintf('NRMSE_z = %.1f%%', (z_rmse_min*100))
+set title sprintf("%s–%s\nNRMSE_z = %.1f%% ",\
+ strftime('%F %H:%M', z_rmse_min_timestamp),\
+ strftime('%H:%M', z_rmse_min_timestamp+2*60*60),\
+ (z_rmse_min*100))
plot \
filename index 0 using 1:2 with points pt 6 lc '#404040' title 'Observed PDF of υ_z',\
'' index 0 using (positive($1)):3 with lines lw 2 lc '#c04040' title 'Estimated PDF of positive υ_z',\
diff --git a/gnuplot/velocity-xy-dist.gnuplot b/gnuplot/velocity-xy-dist.gnuplot
@@ -19,7 +19,7 @@ unset key
#set ylabel 'υ_y'
set cbrange [0:*]
set lmargin 2
-set tmargin 2.5
+set tmargin 3.5
set bmargin 1.5
set rmargin 6
set size square
@@ -87,7 +87,10 @@ set cbtics offset -0.5,0
set xrange [-1*s:1*s]
set yrange [-1*s:1*s]
set title offset 0,0.5
-set title sprintf('NRMSE = %.0f%%, mean speed = %.1fm/s', round(rmse*100), speed)
+set title sprintf("%s–%s\nNRMSE = %.0f%%, mean speed = %.1fm/s",\
+ strftime('%F %H:%M', direction_rmse_timestamp),\
+ strftime('%H:%M', direction_rmse_timestamp+2*60*60),\
+ round(rmse*100), speed)
#plot filename using 1:2:(positive($3)) with points pt 7 ps 0.25 linecolor palette z
plot filename using ($1+0.005):2:(circle($1,$2,$3)) with image
#plot filename_cnt using (circle($1,$2,$1)):2 with lines lc '#404040'
diff --git a/gnuplot/vtestbed.gnuplot b/gnuplot/vtestbed.gnuplot
@@ -14,6 +14,7 @@ set output 'build/gnuplot/vtestbed.svg'
set multiplot layout 2,3
n = 1
+rad2deg(rad) = (rad * 180) / pi
set xrange [0:40]
set yrange [0:*]
set xlabel 'Lag'
@@ -54,13 +55,13 @@ plot \
n = 20
-set xrange [*:0]
-set xtics -4,1
+set xrange [-180:0]
+set xtics -180,90
set key top right Left reverse width -20
set xlabel 'Direction, degrees'
set title 'Wind direction'
plot \
-'build/vtestbed/anem/direction' using 1:2 every n with points pt 6 lc '#404040' notitle,\
+'build/vtestbed/anem/direction' using (rad2deg($1)):2 every n with points pt 6 lc '#404040' notitle,\
'' using 1:3 with lines lw 2 lc '#404040' title 'Real',\
-'build/vtestbed/vtb/direction' using 1:2 every n with points pt 6 lc '#c04040' notitle,\
+'build/vtestbed/vtb/direction' using (rad2deg($1)):2 every n with points pt 6 lc '#c04040' notitle,\
'' using 1:3 with lines lw 2 lc '#c04040' title 'Simulated'
diff --git a/main.tex b/main.tex
@@ -100,7 +100,8 @@ coefficients are different~\cite{veers1984modeling}.
The spectrum describes wind velocity vector in the plane that is perpendicular
the mean wind direction vector and travels in the same direction
with mean wind speed. Time series is generated as Fourier series, coefficients
-of which are determined from the spectrum, and phases are random variables:
+of which are determined from the spectrum, and phases are random
+variables~\cite{veers1984modeling}:
\begin{align*}
& V(t) = \overline{V} + \sum\limits_{j=1}^{n}
\left( A_j \sin\omega_jt + B_j \cos\omega_jt\right), \\
@@ -269,9 +270,9 @@ Our solution to this problem is to use two Weibull distributions: one for positi
one for negative projection --- but with different parameters.
\begin{equation}
f\left(\upsilon_x;b_1,c_1,b_2,c_2\right) = \begin{cases}
- b_1 c_1 \left(b_1 \upsilon_x\right)^{c_1-1} \exp\left(-\left(b_1\upsilon_x\right)^{c_1}\right).
+ b_1 c_1 \left(b_1 \left|\upsilon_x\right|\right)^{c_1-1} \exp\left(-\left(b_1\left|\upsilon_x\right|\right)^{c_1}\right).
\qquad \text{if } \upsilon_x < 0 \\
- b_2 c_2 \left(b_2 \upsilon_x\right)^{c_2-1} \exp\left(-\left(b_2\upsilon_x\right)^{c_2}\right).
+ b_2 c_2 \left(b_2 \left|\upsilon_x\right|\right)^{c_2-1} \exp\left(-\left(b_2\left|\upsilon_x\right|\right)^{c_2}\right).
\qquad \text{if } \upsilon_x \geq 0 \\
\end{cases}\label{eq-velocity-distribution}.
@@ -504,7 +505,7 @@ are presented in figure~\ref{fig-direction-distributions}.
\centering
\includegraphics{build/gnuplot/velocity-xy-dist-min.eps}
\end{minipage}
- \vskip\baselineskip
+ \vskip2\baselineskip
\includegraphics{build/gnuplot/direction-dist.eps}
\caption{Bivariate \(x\) and \(y\) velocity distribution
in polar coordinates (first row), wind direction distributions fitted into