Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dankelley opened this issue Dec 14, 2023 · 3 comments
Closed

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

dankelley opened this issue Dec 14, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@dankelley
Copy link
Owner

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

@dankelley dankelley added the bug Something isn't working label Dec 14, 2023
@dankelley dankelley self-assigned this Dec 14, 2023
@github-actions github-actions bot added this to To do in Issues Dec 14, 2023
@dankelley
Copy link
Owner Author

Oh. The problem is with the vertical location that is reported by z(mdk) or depth(mdk), not with the tension itself.

If I plot just the tensions, I get as follows. Note that it has no abrumpt jumps (apart from the definitely-meaningless last point, which ought to be an NA because there is no tension below the anchor).

Screenshot 2023-12-14 at 9 07 38 AM

@dankelley
Copy link
Owner Author

commit e2b65dd
Author: dankelley kelley.dan@gmail.com
Date: Thu Dec 14 09:24:29 2023 -0400

plot(m, which="tension") improved (issue 53)

Issues automation moved this from To do to Done Dec 14, 2023
@dankelley
Copy link
Owner Author

A reprex showing new behaviour is below.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Issues
  
Done
Development

No branches or pull requests

1 participant