During development of #343 discovered an inconsistency in how the depth polynomial behaves for gliders.
In short, the depth scaling model in SlocumGlider can produce zero or negative battery consumption for bathymetry below -2000 m.
The depth polynomial is applied to negative elevation values, causing the linear model to cross zero and become negative.
Depth polynomial definition:
depth_coefficients = np.array([0.001, 2])
self.depth_polynomial = np.poly1d(depth_coefficients)
This corresponds to:
f(elevation) = 0.001 * elevation + 2
Used in:
battery = [
bs * self.depth_polynomial(cellbox.agg_data["elevation"])
for bs in battery_speed
]
Important to note that bathymetry is stored as negative elevation.
Which implies when solving for zero:
0.001e + 2 = 0
0.001e = -2
e = -2000
So at:
The depth multiplier becomes:
Below this depth:
elevation = -3000
0.001 * (-3000) + 2 = -1
This results in:
ie we're producing negative battery consumption (we're charging the batteries below 2000m)
We should bind the model in some way so it cannot cross 0, or redefine the depth model in terms of positive dive depth rather than negative elevation.
During development of #343 discovered an inconsistency in how the depth polynomial behaves for gliders.
In short, the depth scaling model in
SlocumGlidercan produce zero or negative battery consumption for bathymetry below -2000 m.The depth polynomial is applied to negative elevation values, causing the linear model to cross zero and become negative.
Depth polynomial definition:
This corresponds to:
Used in:
Important to note that bathymetry is stored as negative elevation.
Which implies when solving for zero:
So at:
The depth multiplier becomes:
Below this depth:
This results in:
ie we're producing negative battery consumption (we're charging the batteries below 2000m)
We should bind the model in some way so it cannot cross 0, or redefine the depth model in terms of positive dive depth rather than negative elevation.