On part d'un nuage de points (quelque chose de nébuleux), un ensemble de points (x, y) enregistrés, qui représentent une courbe plus ou moins irrégulière,
voire complètement cahotique.
On cherche à déterminer une courbe lisse, représentée par une équation (qui comporte un nombre donné de paramètres), qui soit aussi proche que possible de ce nuage de points.
Il s'agit donc ici de trouver les coefficients (aka paramètres) d'une équation, impliquant un nombre donné (choisi) de paramètres, afin que la courbe qui le représente soit aussi proche que possible d'un ensemble de points donnés.
Autrement dit, que la courbe trouvée colle autant que possible au nuage des points de départ.
Données initiales : Nuage de points
|
Données finales : Courbe (ici un polynôme de degré 4)
|
|
$$
P^{HDC}_{COG} = P^x_y
$$
|
, écrit aussi |
$$
y = f(x)
$$
|
où |
$$
f(x) = ax^2 + bx + c
$$
|
a, b, et c d'un polynôme pour lequel
y, c'est à dire que la différence
a, b et c pour lesquels la dérivée première de cette sommation des carrés des différences
par rapport à chacun des coefficients a, b et c est nulle, ce qui s'écrit :
x, on calcule la valeur de la fonction (ici polynôme) f(x), et on veut
que sa différence avec y soit la plus petite possible.|
$$ ([\Sigma(ax^2 + bx + c - y)^2])' = 0 $$
|
s'écrit aussi |
$$ ([\Sigma((ax^2 + bx + c - y) \times (ax^2 + bx + c - y))])' = 0 $$
|
a :
b :
c :
y de côté, on simplifie par 2 :
Pour un polynôme de degré n, le travail à effectuer se "résume" ainsi à inverser la matrice carrée $ \Sigma x^{0->2n} $ et de
la multiplier par la matrice colonne $ \Sigma yx^{0->n} $ pour obtenir la matrice ligne des coefficients du polynôme recherché.
On cherche ici à élaborer une courbe de déviation, à partir de points enregistrés depuis la station NMEA du bord.
Dans ce contexte, la station doit comporter un GPS, et un compas (compas électronique, donc). Le GPS permettra à la station NMEA de générer des chaînes RMC - qui vont contenir
la route fond (Course Over Ground, aka COG), le compas fournira à la station ce dont elle a besoin pour générer les Caps Compas (Heading, aka HDG, HDM, etc, suivant les stations).
Le fichier contenant les informations produites par la station NMEA aura ainsi une allure comme celle-ci :
. . .
$IIRMC,190402,A,0854.980,S,14006.028,W,00.0,008,031110,10,E,A*07
$IIVHW,,,126,M,00.0,N,,*61
$IIVLW,02839,N,000.0,N*53
$IIVWR,027,R,07.2,N,,,,*61
$IIDPT,012.3,+0.7,*40
$IIGLL,0854.979,S,14006.029,W,190403,A,A*56
$IIHDG,126,,,10,E*16
. . .
On note que le fichier peut contenir d'autres données (VHW, DPT, GLL, VLW, etc), qu'on ignorera ici.
[
{ "hdc": 210.000000, "dev": 4.000000 },
{ "hdc": 210.000000, "dev": 4.000000 },
{ "hdc": 210.000000, "dev": -1.000000 },
{ "hdc": 210.000000, "dev": -2.000000 },
{ "hdc": 208.000000, "dev": -4.000000 },
. . .
]
Plus de détails sur ces opérations sont disponibles dans d'autres documents :
r est le Cap Compas, dev est la déviation (δ entre HDC et HDM, cap compas et cap magnétique).f pour laquelle la déviation dev est obtenue en fournissant r:
HDC (corrigé de la déclinaison locale)
et la route fond (COG) est bien la déviation d, que l'on cherche. Pas de dérive, pas de courant,
la route fond est égale à la route surface, qui est égale au
cap vrai du bateau.
We start with a point cloud (something nebulous), a set of recorded points (x, y) that represent a more or less irregular, or even completely chaotic, curve.
We want to determine a smooth curve, represented by an equation (which has a given number of parameters), that is as close as possible to this point cloud.
The goal here is to find the coefficients (also known as parameters) of an equation, involving a given (chosen) number of parameters,
so that the curve representing it is as close as possible to a given set of points.
In other words, the resulting curve should fit the initial point cloud as closely as possible.
Initial Data: Cloud of Points
|
Final data: Curve (here a polynomial of degree 4)
|
|
$$
P^{HDC}_{COG} = P^x_y
$$
|
, also written |
$$
y = f(x)
$$
|
or |
$$
f(x) = ax^2 + bx + c
$$
|
y, that is to say that the difference
a, b, and c for which the first derivative of this summation of the squares of the differences with
respect to each of the coefficients a, b, and c is zero, which can be written as:
x, we calculate the value of the function (here a polynomial) f(x),
and we want its difference with y to be as small as possible.|
$$ ([\Sigma(ax^2 + bx + c - y)^2])' = 0 $$
|
can be also written |
$$ ([\Sigma((ax^2 + bx + c - y) \times (ax^2 + bx + c - y))])' = 0 $$
|
a:
b:
c:
For a polynomial of degree n, the work to be done essentially involves inverting the square matrix $ \Sigma x^{0->2n} $ and
multiplying it by the column matrix $ \Sigma yx^{0->n} $ to obtain the row matrix of coefficients of the desired polynomial.
The goal here is to develop a deviation curve from points recorded by the onboard NMEA station.
DIn this context, the station must include a GPS and a compass (an electronic compass). The GPS will allow the NMEA station to
generate RMC strings, which will contain the course over ground (COG).
The compass will provide the station with what it needs to generate compass headings (HDG, HDM, etc., depending on the station).
The file containing the information produced by the NMEA station will thus look like this:
. . .
$IIRMC,190402,A,0854.980,S,14006.028,W,00.0,008,031110,10,E,A*07
$IIVHW,,,126,M,00.0,N,,*61
$IIVLW,02839,N,000.0,N*53
$IIVWR,027,R,07.2,N,,,,*61
$IIDPT,012.3,+0.7,*40
$IIGLL,0854.979,S,14006.029,W,190403,A,A*56
$IIHDG,126,,,10,E*16
. . .
Note that the file may contain other data (VHW, DPT, GLL, VLW, etc.), which we will ignore here.
[
{ "hdc": 210.000000, "dev": 4.000000 },
{ "hdc": 210.000000, "dev": 4.000000 },
{ "hdc": 210.000000, "dev": -1.000000 },
{ "hdc": 210.000000, "dev": -2.000000 },
{ "hdc": 208.000000, "dev": -4.000000 },
. . .
]
More details on these operations are available in other documents:
r is the compass heading, and dev is the deviation (δ between HDC and HDM, compass heading and magnetic heading).f for which the deviation dev is obtained by providing r:
d we are looking for. With no drift and no current, the course over ground equals the course through the water,
which is equal to the boat's true heading.