print not catching neighbours to wire/chain correctly
Closed this issue · 1 comments
dankelley commented
The below illustrates. Notice that that we are missing element 1 (the float), and that element 3 is wrong in m
. I think the problem is in how I'm counting and skipping over chain and wire components.
> m
Mooring with 34 elements, listed from the top down:
2: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
3: '3/16in galvanized wire coated to 1/4in' wire, -11.5475kg, length 149m, area 0.94615m^2
7: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
8: '3/16in galvanized wire coated to 1/4in' wire, -11.315kg, length 146m, area 0.9271m^2
9: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
10: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
11: '3/16in galvanized wire coated to 1/4in' wire, -15.2675kg, length 197m, area 1.25095m^2
12: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
13: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
14: '3/16in galvanized wire coated to 1/4in' wire, -15.345kg, length 198m, area 1.2573m^2
15: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
16: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
17: '3/16in galvanized wire coated to 1/4in' wire, -15.345kg, length 198m, area 1.2573m^2
18: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
19: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
20: '3/16in galvanized wire coated to 1/4in' wire, -3.565kg, length 46m, area 0.2921m^2
22: '3/16in galvanized wire coated to 1/4in' wire, -11.3925kg, length 147m, area 0.93345m^2
23: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
24: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
25: '3/16in galvanized wire coated to 1/4in' wire, -11.16kg, length 144m, area 0.9144m^2
27: '3/16in galvanized wire coated to 1/4in' wire, -3.875kg, length 50m, area 0.3175m^2
28: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
29: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
30: '3/16in galvanized wire coated to 1/4in' wire, -2.635kg, length 34m, area 0.2159m^2
32: 'benthos 965a' release, -36.73kg, height 1.23m, area 0.1562m
33: '5/8in galvanized chain' chain, -43.23kg, length 10m, area 0.572m^2
34: '3 trainwheels' anchor, -1050kg, height 0m, in 1400m water depth
> md
Discretised mooring with 1342 elements, listed from the top down:
2: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
3-151: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
155: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
156-301: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
302: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
303: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
304-500: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
501: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
502: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
503-700: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
701: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
702: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
703-900: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
901: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
902: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
903-948: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
950-1096: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
1097: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
1098: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
1099-1242: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
1244-1293: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
1294: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
1295: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
1296-1329: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
1331: 'benthos 965a' release, -36.73kg, height 1.23m, area 0.1562m
1332-1341: '5/8in galvanized chain' chain, -4.323m, length 1m, width 0.0572m
1342: '3 trainwheels' anchor, -1050kg, height 0m, in 1400m water depth
dankelley commented
This is fixed in "main" branch, commit 0bf4c37 ; see Details.
library(mooring)
# Abbreviations for convenience
W <- function(length) wire("3/16in galvanized wire coated to 1/4in", length=length)
BUB3 <- float("streamlined BUB 3 Viny balls")
RCM11 <- instrument("RCM-11 in frame")
microcat <- instrument("SBE37 microcat clamp-on style")
m <- mooring(anchor(depth=1400),
chain("5/8in galvanized chain", length=10),
release("benthos 965a"), # atually, it is listed as dual benthos 965-a
BUB3,
W(34),
microcat,
RCM11,
W(50),
BUB3,
W(144),
microcat,
RCM11,
W(147),
BUB3,
W(46),
microcat,
RCM11,
W(198),
microcat,
RCM11,
W(198),
microcat,
RCM11,
W(197),
microcat,
RCM11,
W(146),
microcat,
connector("swivel"),
connector("ballast", -100/2.2, height=1, area=0.05, CD=1),
float("syn. float, bracket and 109lb ADCP"),
W(149),
microcat,
float('new glass streamlined float c2'))
md <- discretise(m)
print(m)
#> Mooring with 34 elements, listed from the top down:
#> 1: 'new glass streamlined float c2' float, 45.41kg, height 0.87m, area 0.183m
#> 2: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 3: '3/16in galvanized wire coated to 1/4in' wire, -11.5475kg, length 149m, area 0.94615m^2
#> 4: 'syn. float, bracket and 109lb ADCP' float, 789.8kg, height 2.42m, area 1.234m
#> 7: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 8: '3/16in galvanized wire coated to 1/4in' wire, -11.315kg, length 146m, area 0.9271m^2
#> 9: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 10: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 11: '3/16in galvanized wire coated to 1/4in' wire, -15.2675kg, length 197m, area 1.25095m^2
#> 12: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 13: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 14: '3/16in galvanized wire coated to 1/4in' wire, -15.345kg, length 198m, area 1.2573m^2
#> 15: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 16: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 17: '3/16in galvanized wire coated to 1/4in' wire, -15.345kg, length 198m, area 1.2573m^2
#> 18: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 19: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 20: '3/16in galvanized wire coated to 1/4in' wire, -3.565kg, length 46m, area 0.2921m^2
#> 21: 'streamlined BUB 3 Viny balls' float, 52.65kg, height 0.563m, area 0.124m
#> 22: '3/16in galvanized wire coated to 1/4in' wire, -11.3925kg, length 147m, area 0.93345m^2
#> 23: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 24: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 25: '3/16in galvanized wire coated to 1/4in' wire, -11.16kg, length 144m, area 0.9144m^2
#> 26: 'streamlined BUB 3 Viny balls' float, 52.65kg, height 0.563m, area 0.124m
#> 27: '3/16in galvanized wire coated to 1/4in' wire, -3.875kg, length 50m, area 0.3175m^2
#> 28: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 29: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 30: '3/16in galvanized wire coated to 1/4in' wire, -2.635kg, length 34m, area 0.2159m^2
#> 31: 'streamlined BUB 3 Viny balls' float, 52.65kg, height 0.563m, area 0.124m
#> 32: 'benthos 965a' release, -36.73kg, height 1.23m, area 0.1562m
#> 33: '5/8in galvanized chain' chain, -43.23kg, length 10m, area 0.572m^2
#> 34: '3 trainwheels' anchor, -1050kg, height 0m, in 1400m water depth
print(md)
#> Discretised mooring with 1342 elements, listed from the top down:
#> 1: 'new glass streamlined float c2' float, 45.41kg, height 0.87m, area 0.183m
#> 2: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 3-151: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 152: 'syn. float, bracket and 109lb ADCP' float, 789.8kg, height 2.42m, area 1.234m
#> 155: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 156-301: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 302: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 303: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 304-500: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 501: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 502: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 503-700: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 701: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 702: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 703-900: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 901: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 902: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 903-948: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 949: 'streamlined BUB 3 Viny balls' float, 52.65kg, height 0.563m, area 0.124m
#> 950-1096: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 1097: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 1098: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 1099-1242: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 1243: 'streamlined BUB 3 Viny balls' float, 52.65kg, height 0.563m, area 0.124m
#> 1244-1293: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 1294: 'RCM-11 in frame' instrument, -20.31kg, area 0.078m^2
#> 1295: 'SBE37 microcat clamp-on style' instrument, -1.53kg, area 0.117m^2
#> 1296-1329: '3/16in galvanized wire coated to 1/4in' wire, -0.0775kg, length 1m, area 0.00635m
#> 1330: 'streamlined BUB 3 Viny balls' float, 52.65kg, height 0.563m, area 0.124m
#> 1331: 'benthos 965a' release, -36.73kg, height 1.23m, area 0.1562m
#> 1332-1341: '5/8in galvanized chain' chain, -4.323m, length 1m, width 0.0572m
#> 1342: '3 trainwheels' anchor, -1050kg, height 0m, in 1400m water depth
Created on 2021-06-27 by the reprex package (v2.0.0)