Coder Social home page Coder Social logo

Stiffness matrix and translation about meshmagick HOT 4 OPEN

lheea avatar lheea commented on September 20, 2024
Stiffness matrix and translation

from meshmagick.

Comments (4)

mancellin avatar mancellin commented on September 20, 2024

Actually it seems that the x and y coordinates given in the cog argument have no influence on the results.

from meshmagick.

ryancoe avatar ryancoe commented on September 20, 2024

Looking at this a bit more, here's my current understanding:

stiffness: I think there was a bit of a problem here, which I've submitted a fix for with #22 (note however that what I've done is not yet propagated back to the Hydrostatics class; if you think it looks good we can finish doing this).

hydrostatics: these look like they are currently calculated relative to a point on a vertical line passing through origin but with the correct vertical position:

This section uses the x and y location of the origin (xi, yi = polyverts[0, :2])

xi, yi = polyverts[0, :2]
for (xii, yii) in polyverts[1:, :2]:
dx = xii - xi
dy = yii - yi
px = xi + xii
py = yi + yii
# a = xi * xi + xii * xii
sigma0 += dy * px
sigma1 += dy * (px * px - xi * xii)
sigma2 += dx * (py * py - yi * yii)
# sigma3 += dy * (py * a + 2 * px * (xi * yi + xii * yii))
sigma3 += dy * (py * px * px + yi * xi * xi + yii * xii * xii)
sigma4 += dy * (xi * xi + xii * xii) * px
sigma5 += dx * (yi * yi + yii * yii) * py
xi, yi = xii, yii

This section uses the vertical location of the cog (self.zg)

a = self.zg - zb # BG
gm_x = transversal_metacentric_radius - a
gm_y = longitudinal_metacentric_radius - a

Thus, it might be appropriate to change this method so that it calculates based on COG, right?

polyverts = clipper.clipped_crown_mesh.vertices[polygon]

This line would be changed to polyverts = clipper.clipped_crown_mesh.vertices[polygon] - self._gravity_center

from meshmagick.

ryancoe avatar ryancoe commented on September 20, 2024

related to #1

from meshmagick.

frongere avatar frongere commented on September 20, 2024

I just released v3.0 which should fix these issues.

Note however that I have totally refactored the hydrostatics module using only functions with no class. The code is far more simple and the number of lines of code has lowered.

The stiffness matrix and metacentric stuffs are now expressed on a line passing though COG/buoyancy centre.

Positions such as buoyancy centre are expressed in the initial frame. It allows to directly compare results to other commercial software such as Maat Hydro.

from meshmagick.

Related Issues (20)

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.