-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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 + 2Used 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 = -2000So at:
elevation = -2000The depth multiplier becomes:
0.001 * (-2000) + 2 = 0Below this depth:
elevation = -3000
0.001 * (-3000) + 2 = -1This results in:
battery = bs * (-1)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.