Code Monkey home page Code Monkey logo

mooring's Introduction

mooring

R-CMD-check

The goal of the mooring package is to facilitate computations in the R language of the deformation of oceanographic moorings by ocean currents. It builds on Fortran code discussed by Moller (1976), which evolved into a new form as discussed by Hamilton, Fowler, and Belliveau (1997) and Hamilton (1989), and then a Matlab form discussed by Dewey (1999). It is more limited than these earlier works, e.g. in considering only unidirectional currents, in ignoring the stretching of mooring components, and in ignoring the stresses involved during mooring descent.

In addition to a fairly broad suite of functions, the package also provides crude interactive tools for exploring simple moorings.

Conventional R help is provided, in addition to several vignettes, and a youtube playlist.

At the moment, mooring only handles bottom-anchored moorings in which the top buoyancy element is below the sub-surface.

Installation

You can install the development version of mooring from GitHub by typing the following in an R console. (Uncomment the first line, if the devtools package is not already installed on your computer.)

# install.packages("devtools")
devtools::install_github("dankelley/mooring")

Example

The following shows how to assess the knockdown of a mooring consisting of a bottom anchor, 100 m of wire, and a 16-inch Viny float, in a region of water depth 120 m with a constant current of 0.5 m/s (roughly 1 knot). To learn more, (a) alter the current and observe changes in the mooring shape, (b) set the which argument of plot.mooring() to focus more directly on the knockdown, and (c) explore the effects of specifying depth-dependent currents in the knockdown() call. After a few steps like this, you ought to examine the vignettes and the documentation of the package’s functions, so you can tackle a practical case of your own.

library(mooring)
#> Loading required package: S7
# Design a mooring with a 16-inch Viny float attached to a bottom
# anchor with 100m of wire cable.
m <- mooring(anchor(), wire(length = 100), float("16in Viny"), waterDepth = 120)
# Segmentize wire portion (to 1m spacing).
ms <- segmentize(m)
# Apply a depth-invariant 0.5 m/s current.
msk <- knockdown(ms, u = 0.5)
plot(msk, fancy = TRUE)

Acknowledgments

The mooring-element properties that are stored in the mooringElements database stem from three main sources. The first was Richard Dewey’s Matlab code (see Dewey (2023) for an updated version). The second was in spreadsheets and other documents provided by Jay Barthelotte and Matthew Lawson of the Bedford Institute of Oceanography (BIO). And the third was in spreadsheets and other documents provided by Danielle Dempsey and Nicole Torrie of the Centre for Marine Research (CMAR). These sources are designated "Dewey", "BIO" and "CMAR", respectively, in mooringElements.

Conversations with Clark Richards and Chantelle Layton (both of BIO) were helpful in identifying data sources and in clarifying the nature of mooring systems.

References

Dewey, Richard K. 1999. “Mooring Design & Dynamics—a Matlab® Package for Designing and Analyzing Oceanographic Moorings.” Marine Models 1 (1): 103–57. https://doi.org/10.1016/S1369-9350(00)00002-X.

———. 2023. “Mooring Design and Dynamics: Users Guide.” http://web.uvic.ca/~rdewey/mooring/mdd/mdd.php.

Hamilton, James M. 1989. “The Validation and Practical Applications of a Sub-Surface Mooring Model.” 119. Bedford Institute of Oceanography. https://waves-vagues.dfo-mpo.gc.ca/Library/112322.pdf.

Hamilton, James M., George A Fowler, and Donald J. Belliveau. 1997. “Mooring Vibration as a Source of Current Meter Error and Its Correction.” Journal of Atmospheric and Oceanic Technology 14 (3): 644–55. https://doi.org/10.1175/1520-0426(1997)014<0644:MVAASO>2.0.CO;2.

Moller, Donald A. 1976. “A Computer Program for the Design and Static Analysis of Single-Point Subsurface Mooring Systems: NOYFB.” WHOI-76-59. Woods Hole, MA: Woods Hole Oceanographic Institution. https://darchive.mblwhoilibrary.org/server/api/core/bitstreams/0f41541c-7db6-5641-8412-02f68276b439/content .

mooring's People

Contributors

dankelley avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bennettl-hfx

mooring's Issues

releases data should store area, not width

I think I want to do this for all items, actually, but I'll start with releases. The work involves

  • alter code that creates Dewey subset
  • alter data in BIO subset (and the docs that describe the hand-editing required)
  • alter area() accordingly
  • alter print() accordingly
  • check that drag makes sense
  • add some tests to test suite (basically, to make it hard to make capricious changes)

add some more Dewey elements

Dewey has some items that I'm skipping:

  • acrels (acoustic releases)
  • cms (current meters)
  • anchors (anchors)
  • miscs (seems to be a grab-bag, some things looking like instruments, others like floats.

I think I ought to put these all in, or at least the first 3 categories and then whatever I can guess for miscs.

I don't see a big rush on this.

should add an accessor

I want to get some of the advanced lookups that we have in oce. Right now, if m is a mooring object, we can do m[[10]] to get the tenth element. That works because the object is a simple list. But I want also to be able to store things like a velocity value (or function). Those things can fit in a list but then a user would have to know that it is (say) the eleventh element. That's inconvenient. We want e.g.

m[[10]] # return tenth element
m[["v"]] # return velocity, if it exists
m[["waterDepth"]] # return water depth

and so forth.

I am most used to doing this in S4 (as in oce) but this package is using S3 so I need to learn a bit. It seems straightforward, though, e.g. below

library("mooring")
m <- mooring(anchor(depth=100), wire(length=90), float())

`[.mooring` <- function(m, i)
{
    if (is.numeric(i)) {
        m[[i]]
    } else {
        message("handle non-numeric input (e.g. 'v') here")
        NULL
    }
}

print(m[2])
#> '1/4in wire/jack' wire, 90m, -11.7kg, diameter 0.008m, x=0 m, z=-10 m
print(m['v'])
#> handle non-numeric input (e.g. 'v') here
#> NULL

Created on 2021-06-12 by the reprex package (v2.0.0)

add cinder-block anchor

Since there is an interest in very shallow (say 2m) moorings, I think the package should have an ability to specify those as anchors. My guess is that a user will correct me on what sorts of blocks are used (cinder or concrete?) or even whether they are used, but for now I plan to add at least one entry from the site

https://brickmakingmachinee.com/weights-of-concrete-blocks/

as a starting point. The following has weight in air

  • Cinder 8 x 8 x 16 inch (20 x 20 x 40 cm) 16.3 kg
  • Concrete 8 x 8 x 16 inch (20 x 20 x 40 cm) 23.1 kg

but from https://civiltoday.com/civil-engineering-materials/concrete/361-density-of-concrete I see that concrete has density 2.4 times that of water, so that's all I need for starting values.

Other standard mooring components?

What about shackles and swivels? They might not have much drag, but they do have weight and could be important on a large enough mooring. I recall MDD had standard shackle/swivels included, I think?

support user-defined float(), etc

I'll start with float. The idea is that e.g.

float("Kiel SFS40in")

should use the database for that model of float, but that e.g.

float("myFloat", buoyancy=B, lengthHeight=L, cylinderWidth=W, sphereDiameter=D, CD=CD, code=c)

should define a new float for use. That way, users won't have to do PRs to get floats added.

Same for wires etc.

idea for margin-notes on plot

Now that I'm trying real-world moorings, I see that it's going to be very common to have labels overwriting each other (see below, from #24). I think I will implement something I do a lot in things like scholarship rankings, which is to put a more extensive listing of elements over on the RHS, equispaced over the plot height, with lines pointing back to the actual mooring.

I won't bother explaining this too much, since I'm not seeking advice or help on this. The purpose of this issue is just to be a component of a "to do" list. Also, I will need to try this to see if it will work reasonably well, and I don't want to get into a tangle with a whole lot of extra arguments to control spacing, etc. So ... I may do this, and I may drop the idea.

messy diagram

Screen Shot 2021-06-09 at 8 25 44 AM

similar diagram that's less messy

I've cut off the text on the RHS (person names). Notice, though, that if I put that material alongside the scores (the thing plotted on the axis) then the text would be difficult to read.

Screen Shot 2021-06-09 at 8 29 01 AM

tension() is wrong

It even has the wrong sign! This is because of not having converted that part to the new notation (where the first element is now the float, not the anchor, and where T[n] is the tension below the n-the element, not above it.).

print not catching neighbours to wire/chain correctly

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

plot(m, which="knockdown") error at top

Why the jiggy-jag at the top?

library(mooring)
m <- mooring(anchor(depth=100), wire(length=90), float("HMB 20"))
md <- discretise(m)
mdk <- knockdown(md, u=0.5)
plot(mdk, which="knockdown")

Created on 2021-06-14 by the reprex package (v2.0.0)

Include depth (and time?) varying flow

Maybe the time varying flow part of this should be a different issue, but the spirit is the same -- allow the model to run for non-uniform currents, i.e. for u(z)/v(z).

"shape" and "tension" plots should have the same depth axis

The snapshot (from a comment in #12) illustrates the problem. What's happening is that the "shape" uses asp=1 to get a natural aspect ratio, but of course that doesn't make sense for the tension plot, which shows things of different units on the horiz. and vert. axes.

I'm not 100% sure how R actually handles things when you give both asp along with both xlim and ylim (as I do for "shape" plots), so it's not too clear to me how to determine the ylim for the "tension" plot. Maybe I should just do a fake "shape" plot, using just ranges and not actually drawing anything, to get the proper ylim (etc.) to use for a "tension" plot.

PS. obviously, in app(), we could just draw the shape first, but that doesn't help in the more important general case.

Screen Shot 2021-06-03 at 8 41 29 AM

add a way to set water depth

This could be by adding e.g. water(100) at the end of the mooring. Or maybe the anchor() could have an arg for water depth, which requires less thinking on behalf of the user.

plot should have icons for objects

Maybe a box for a bottom anchor, a thick line for an acoustic release, a circle for a float, a diamond (or up/down triangle) for an adcp, etc.

Drawing these will be fiddly, so this is not especially high priority. Built-in symbols will be ok for a while.

anchor('3 trainwheels') lacks a height field

I'm not exactly sure why I even have this (with me as the generator), since it looks like a copy of Dewey's data. Maybe I just wanted to have a name similar to that of other anchors?

library(mooring)
dput(anchor("3 trainwheels"))
#> structure(list(model = "3 trainwheels", buoyancy = -1050, height = 0, 
#>     area = 0, CD = 1.3, depth = 0, source = "kelley"), class = c("mooring", 
#> "anchor"))
dput(anchor("3 Railway Wheels"))
#> structure(list(model = "3 Railway Wheels", buoyancy = -1050, 
#>     height = 0.55, area = 0, CD = 1.3, depth = 0, source = "Dewey"), class = c("mooring", 
#> "anchor"))

Created on 2023-12-09 with reprex v2.0.2

incorporate BIO data

I see some points of confusion. Some relate to the fact that the BIO spreadsheet seems to be designed for human inspection, not automated inspection, so the entries in the cells are sometimes odd (e.g. with text in with the numbers, sometimes).

I am looking first at the 3/16 galvanized case, which is the first line in the BIO file. The entry under "NEWTONS" is "0.76nt/m" which would convert in Dewey's notation to 0.76/9.8=0.077 (approx) for the buoyancy (which is actually buoyancy/metre for a wire). But Dewey lists 0.007 for what seems to be the same thing.

This will require some more investigation. The screenshot below shows some evidence. The top (with yellow) shows the spreadsheet, and the bottom is a text editor with (top) my code, with comments on this case, (middle) the csv I get from Dewey's files and (bottom) output from my reading of the bio data.

Possibly (a) I'm reading Dewey wrong or (b) the BIO table is not correct in this entry.

Screen Shot 2021-05-28 at 9 22 58 AM

need advice on mooring component "syntactic foam float..."

I'm wondering whether one of my BIO colleagues can help with this (perhaps @FormulaFunRacing or @clayton33?).

I decided to try to simulate mooring 1840 (Sackville Spur July 2013). In the details you can see part of the BIO mooring diagram (which I think is available to the above-named colleagues, so I won't post it here), along with my quickly-written R code. There's also a plot, which can be ignored for now, I think.

The issue is that I had to guess on how to specify some of the elements listed in the diagram. In some cases, I think my guess will be OK even if a bit wrong (e.g. I think the two styles of microcat will likely have similar effects on drag and buoyancy). However, I am pretty uncertain also of buoyancy elements, and they are of course crucial to mooring dynamics. That's what I'm asking about. In particular:

  1. what is the "SYNTACTIC FOAM FLOAT WITH LONG RANGER ADCP..." that's shown in the mooring diagram from the BIO doc? Is it in the excel file? If not, can anyone advise me on its buoyancy and area (maybe even CD ... manufacturers tend to list that).
  2. what does a "3 GLASS BUB PACKAGES" mean? Is that three of some kind of package? If so, what is the buoyancy of that package, etc? Lacking any idea, really, I just used float("streamlined bub 3 Viny balls").

Any advice would be appreciated. No rush on this, though. It's just something I spend a few minutes a day on.

Portion of BIO doc

Screen Shot 2021-06-09 at 8 00 01 AM

R code

## Mooring 1840 (p10 of doc)
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") # "AANDERAA RCM11"
microcat <- instrument("SBE37 microcat clamp-on style") # "SBE MICROCAT"

m <- mooring(anchor(depth=1400),
             chain("5/8in galvanized chain", length=10),
             release("benthos 965a release"),  # 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, width=0.05, CD=1), # guess
             float("syn. float,bracket and 109lb ADCP"), # total guess; lots of choices
             W(149),
             microcat,
             float("streamlined bub 3 Viny balls")) # total guess
md <- discretise(m)
mdk <- knockdown(md, u=function(depth) exp(-depth/1000))
#> Warning in knockdown(md, u = function(depth) exp(-depth/1000)): FIXME: u=function() case is not fully coded yet (no iteration is done)
plot(mdk)

Created on 2021-06-09 by the reprex package (v2.0.0)

should have a test case against theory

I'll close this in a moment, since it's already done in https://dankelley.github.io/mooring/articles/pingpong.html and my only reason for posting this as an issue is to let any observers know that it exists.

The test case is a ping-pong ball on a thin monofilament fishing line. The line will have low drag compared to the ball, and also low buoyancy. Therefore, it will be in a straight line, not a catenary-type shape, and that means that a simple one-point-mass theory is sufficient. So, that's what I do in this vignette.

Actually, as I was typing it up, I realized that this could be made into a little device that could be put into a brook or a river, to test flow speed. (It could also work in a rotating table experiment, with a weighted ball and, of course, different numbers.). I haven't thought through the measurement of tension, but an arrangement with a cheap load cell might work.

PS. I'm not suggesting this for a real instrument -- it's just a fun teaching exercise. And, if I got a load cell hookup working, there are other possibilities, independent of buoyancy and line, involving direct measurement of drag. (This gets close to how the old heated-wire anemometers worked...)

request: info for 'STREAMLINED GLASS BUOYANCY PACKAGE'

In the BIO table of components (top part of the snapshot), I don't see anything that seems to match the name STREAMLINED GLASS BUOYANCY PACKAGE that is at the top of the mooring diagram (bottom part) for mooring 1840 (Greenan, Sackville Spur, July 2013).

@FormulaFunRacing or @clayton33: Any idea what I should use for buoyancy, height, area, and CD?

PS: I ask because I want to simulate that mooring.

Screen Shot 2021-06-11 at 5 46 33 AM

datasets for float() etc should store original name of item

This might help people who either know things by the original name, or who have written code to use the original name. But note that I edited those original names, by (a) collapsing multiple spaces to 1 space, (b) removing leading and trailing spaces and (c) removing trailing asterisks (which mean footnotes, I think).

odd minimum in knockdown vs u

In a video (not published, but others in this repo have been told of it), I noticed that -- for a heavy line at least -- slowly increasing velo from 0 does not slowly increase knockdown. Rather, the mooring gets taller for a while, and then gets knocked down. I think this is because the drag bends the mooring over, which gives a force with a vertical component that can lift up more of the wire that was otherwise laying on the ground. Well, that's what I came up with in the dentist's chair yesterday :-)

I made a test, as below. Left: 1/4in line, which can be held up by the default float. Right: 1/2in line (so, roughly 4X as mass per metre), which cannot be held up. Black: case with delta-z of 0.1m; red: case with delta-z of 1m.

What I see is that delta-z doesn't matter much, but that that the odd behaviour only occurs if the mooring is too heavy for the float.

The code (in "develop" branch) for this is in sandbox/dk/02_heavy_mooring but I think it's interesting enough to put in a vignette. (I don't, yet, have a proper vignette for the package. The vignettes so far are mainly for developers.)

This is quite interesting, actually. I think this might be how spiders (or some other bugs, not sure) can spit out a line into the air, and the air catches it and pulls them off the ground. The idea would be similar: current bends the line, now the drag has a vertical component that can possibly outweigh the gravity component. What do you think of this, @richardsc and @clayton33? (And is Jay on GH? It would be good to be able to use the at syntax so Jay can see such things and give ideas.)


author: kelley
date: 2021-06-02
output: "reprex::reprex\_document"
title: soot-cub_reprex.R

library(mooring)
a <- anchor(depth=1000) # make it deep so a heavy wire can't be held up
par(mfrow=c(1, 2), mar=c(3,3,1,1), mgp=c(2,0.7,0))
wiretypes <- c("1/4in wire/jack", "1/2in wire/jack")
for (wiretype in wiretypes) {
    w <- wire(wiretype, length=900)
    f <- float()
    m <- mooring(a, w, f)
    us <- seq(0, 1.5, 0.05)
    first <- TRUE
    for (dz in c(0.1, 1)) {
        md <- discretise(m, dz)
        zs <- sapply(us, function(u)
                     {
                         mdk <- knockdown(md, u)
                         z(tail(mdk,1))
                     }
        )
        if (first) {
            plot(us, zs, type="o", pch=20, cex=0.5, xlab="Horiz. velo. [m/s]", ylab="Float z [m]")
            first <- FALSE
        } else {
            lines(us, zs, type="o", pch=20, cex=0.5, col=2)
        }
    }
    legend("topright", lwd=1, col=c(1,2), legend=c(0.1, 1), title="dz")
    mtext(paste0("wire type: ", wiretype))
}

Created on 2021-06-02 by the reprex package (v2.0.0)

mooring lies below the ground

I decided to eliminate the problem of the stagnant shape going to the surface (snapshot 1) and so started fiddling with the graph generally. I was drawing the ground on top of the mooring line, so I switched the order ... and now I see that the line is going under the ground (snapshot 2). This goes beyond app(), to how the x and z values for mooring elements are computed. I'll take a look at this today or tomorrow.

Snapshot 1

Screen Shot 2021-06-02 at 6 14 58 PM

Snapshot 2

Screen Shot 2021-06-03 at 7 48 21 AM

should have a function to attach elements to a wire

If an instrument is attached to a wire via a clamp, its height value ought not to be added to the total length of the mooring. For deep-ocean moorings with say 10 instruments of height 0.5m each, this is not an issue that matters much. However, it will matter for short moorings (like a 2-metre mooring of issue #47).

Some instruments have words like 'clamp on' in their names, but still have nonzero height values within their description. I suppose it would be worth changing that, but there is also the possibility of a new function to indicate that something is clamped on.

This could be a function like the following

clampon <- function(i) {
   i$height <- 0
   i
}

switch OO scheme

The present scheme builds up moorings by defining a variant of + that works on S3 objects. The problem is that the first object in a list a+b+c will have some class, and so will the second. Therefore, the sum must have the same, for the operation to commute.

This is done presently by using a list for the overall mooring, and another list (of length 1) for each component. This is awkward for the user, who must do e.g.

f <- float()
f[[1]]$CD

to find the $C_D$ of the float object. I don't think users will guess that, and it's a lot of typing. Basically, it's confusing to have a list of lists (although that's how matlab objects often get created in R, e.g. the rafos float data that CL used during thesis work).

That's problem 1 with the present scheme. The other is that this + operator is not very discoverable based on its name. And, even then, I think q lot of users won't know to type

?`+.mooring`

to get its documentation.

I am going to switch this. The new scheme will use a function mooring() that takes objects of certain allowed subclass (e.g. a wire element would inherit from the two classes wire and mooring) and produce something of another class (maybe inheriting from mooring only ... I've not decided yet). This eliminates the need for a list of lists.

As a short-term measure, for a few days anyway, I'll make the + operation spit out a message as to the new way.

Plan. I'll do this before next week.

shallow moorings (< 2 m)

Hello,

As discussed last week, I am wondering if the package can handle relatively shallow moorings (e.g., water depth is ~ 2 m, wire length is ~ 1.5 m).

plot() should hide depths by default

The label is quite confusing, e.g. in the plot below, and I don't think there is any real reason for it. It was helpful before we had plot(m,which="knockdown"), but not now.

Screen Shot 2021-06-20 at 1 06 13 PM

chain() renaming?

The screenshot below (see the bottom part, the mooring diagram) indicates that 5/8 chain should not be of a standard 1-m length. This means -- I now propose -- that this element should be in a category that stores buoyancy as buoyancyPerMeter.

I'm using this word chain() because that's what Dewey uses. But, frankly, I don't like it much, because it includes things like swivels and such, that I don't regard as chains.

I think it might make sense to move chains into wire(), with the rule being that it stores things that indicate buoyancy as kg/m, not kg, and that have a meaning for a length argument.

Or, I could make a category that is only chains, and put those other things like swivels somewhere else.

I have some meetings coming up but I'll think about this later.

Screen Shot 2021-06-08 at 12 45 46 PM

wire/float menus should show buoyancy

I can't keep track of what those names mean, so the menu items should show buoyancy (for floats) and buoyancy/metre (for wires). Also, it would be nice to have buttons to select how to order the items.

make element names be more similar

I don't see any real merit in having different geometrical elements. Some have height and width, others have height and area, etc. This means that e.g. area() has to check which subtype a thing is. I am going to convert them all to height (if known ... obviously that does not apply to wires and chains) and area. The latter will be plain-old area for things like a float, but it will actually store area/meter for chains and wires ... I need to decide whether I want to use areaPerMeter for wires and chains: I think the answer is "yes".

I'll think about this before doing it.

> for (i in c("anchors","chains","connectors","floats","instruments","miscs","releases","wires")) cat(i, ":", paste(names(get(i)),collapse=" "
),"\n")
anchors : name buoyancy height code source originalName
chains : name buoyancyPerMeter width CD code source originalName
connectors : name buoyancy height width CD code source originalName
floats : name buoyancy height diameter CD code source originalName
instruments : name buoyancy height area CD code source originalName
miscs : name buoyancy height area CD code source originalName
releases : name buoyancy height area CD code source originalName
wires : name buoyancyPerMeter diameter CD code source originalName  

So, to be concrete the idea is:

  • chains: change width to areaPerMeter, and make area() compute height*areaPerMeter
  • wires: change diameter to areaPerMeter, and make area() compute height*areaPerMeter
  • floats: change diameter to area, and make area() just look up the number, instead of doing pi^(diameter/2)^2

problem with 1" neutral wire


author: kelley
date: 2021-06-21
output: "reprex::reprex\_document"
title: satin-urial_reprex.R

library(mooring)
a <- anchor(depth=110)
W <- wire('1in Neutral Wire',length=100)
w <- wire('1/2in Neutral Wire',length=100)
f <- float("HMB 20")
m <- discretise(mooring(a,w,f))
M <- discretise(mooring(a,W,f))
par(mfrow=c(1,2))
plot(knockdown(m,0.5),which="knockdown",title="thin wire")
plot(knockdown(M,0.5),which="knockdown",title="thick wire (should deform more)")

w$CD
#> [1] 1.5
W$CD
#> [1] 0

Created on 2021-06-21 by the reprex package (v2.0.0)

use gui to add multiple floats

Hello,

As discussed last week, I am interested in using the app to add multiple floats (sensors) to a wire moored in 2 - 100 m water depth.

problem with tension() and plot(m, which="tension")

Since this is in very active development (in the "develop" branch, changes committed only once in a while), I'll let the reprex speak for itself. I don't think the top point makes sense but I want to see what is going on there. The bottom point I know makes no sense -- it's a remnant of a quick hack to make vector lengths match. I

library(mooring)
a <- function(depth) anchor("fake", buoyancy = -27, height = 0, depth = depth, CD = 0)
m <- mooring(a(2), wire(length = 1.5), float("16in Viny"))
md <- discretise(m, by = 0.1)
mdk <- knockdown(md, 2.0) # has 22 elements (first is float, last is anchor)
par(mfrow = c(2, 2))
plot(mdk, which = "tension", mar = c(3, 3, 3, 1))
xlim <- par("usr")[1:2]
ylim <- par("usr")[3:4]
pch <- 20
col <- ifelse(is.float(mdk), 4, ifelse(is.anchor(mdk), 2, 1))
cex <- ifelse(is.float(mdk), 2, ifelse(is.anchor(mdk), 2, 1))
plot(tension(mdk), depth(mdk),
    pch = pch, cex = cex, col = col,
    ylim = ylim, xlim = xlim, xaxs = "i", yaxs = "i"
)
mtext("all points (red=anchor, blue=float)")
plot(tension(mdk)[-1], depth(mdk)[-1],
    pch = pch,
    ylim = ylim, xlim = xlim, xaxs = "i", yaxs = "i"
)
mtext("trim float")
look <- 2:(length(mdk) - 1)
plot(tension(mdk)[-c(1, length(mdk))], depth(mdk)[-c(1, length(mdk))],
    pch = pch,
    ylim = ylim, xlim = xlim, xaxs = "i", yaxs = "i"
)
mtext("trim float and anchor")

Created on 2023-12-14 with reprex v2.0.2

request: meaning of columns in excel file

I'm a bit lost here as to what columns mean. From prior help kindly provided by @FormulaFunRacing, I think I know what DRAG-T and DRAG-N mean, i.e. DRAG-N is a drag coefficient, CD, in a formula drag = 0.5 x CD x area x speed^2 .... but is that the formula intended, or is the 0.5 not used in the formula? (There are two ways of writing the formula. I have quoted the one normally used for solid objects, but since this package is getting more complete, I do need to be a bit more sure on factors of 2).

But when it gets to the other columns, I have quite a few head-scratchers.

  • columns C and F are both marked as lengths, and they are not equal. (I think I take column C and multiply by column G to get frontal area for drag computations, but I'm also curious about what column F means. Perhaps it's a length in the other direction?)
  • And there are two area-related columns (G and I). (Again, I think I use G with C to get the area for drag computation. If that's the case, I probably don't need to know what column I means.)
  • For buoyancy, I see three possibilities: column D is marked in pounds, and column E is marked in Newtons ... which would be fine, but the numbers don't matchup up. So, I am sort of guessing I should get buoyancy by multiplying the C length column by the H column, to get Newtons. Is that right?

Basically, if it's possible, I'd really love to get a sentence on the meaning of each column. I need this because the package is getting to the point of actually being useful, say within a few weeks.

I realize that this is a hassle for @FormulaFunRacing, but I don't quite know how else I can figure these things out.

If you can help, @FormulaFunRacing (or other BIO colleagues watching this project), I'd really appreciate it. There's no huge rush on this, since it's just a fun little side project. Certainly, for the teaching side, I already have all I want. My goal there is to explain about forces and to give them a basic idea of knockdown issues.

Screen Shot 2021-06-11 at 6 11 02 AM

knockdown() should be added

I'm not too sure on the name, maybe

knockdown(mooring, u=1)

where the u could be a number, of a function.

rename elements for consistency

It's quite confusing to see units for some things (e.g. 3/8" wire but not for others e.g. 3/8 wire) and a decision has been made (in #6) to change " to in. Also, I want to add the unit where it has been omitted.

This is done at the data-ingestion phase, in create_data/dewey and create_data/bio.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.