用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill ship-dynamics-6dof-1-6-degrees-of-freedom命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | ship-dynamics-6dof-1-6-degrees-of-freedom |
| description | Sub-skill of ship-dynamics-6dof: 1. 6 Degrees of Freedom (+1). |
| version | 1.0.0 |
| category | engineering |
| type | reference |
| scripts_exempt | true |
DOF Definition:
translations:
surge: # X-direction (longitudinal)
positive: "Forward"
typical_natural_period: "50-150 seconds"
sway: # Y-direction (lateral)
positive: "Port"
typical_natural_period: "50-150 seconds"
heave: # Z-direction (vertical)
positive: "Upward"
typical_natural_period: "6-15 seconds"
rotations:
roll: # Rotation about X-axis
positive: "Starboard down"
typical_natural_period: "15-30 seconds"
pitch: # Rotation about Y-axis
positive: "Bow up"
typical_natural_period: "6-12 seconds"
yaw: # Rotation about Z-axis
positive: "Bow to starboard"
typical_natural_period: "60-200 seconds"
General Form:
[M + A(ω)]{ẍ} + [B(ω)]{ẋ} + [C]{x} = {F(t)}
Where:
- [M] = Mass/inertia matrix (6x6)
- [A] = Added mass matrix (6x6, frequency-dependent)
- [B] = Damping matrix (6x6, frequency-dependent)
- [C] = Hydrostatic restoring matrix (6x6)
- {F} = External force vector (6x1)
- {x} = Displacement vector [surge, sway, heave, roll, pitch, yaw]
Mass Matrix:
import numpy as np
def create_mass_matrix(
mass: float,
radii_of_gyration: dict,
center_of_gravity: np.ndarray = None
) -> np.ndarray:
"""
Create 6x6 mass matrix for vessel.
Args:
mass: Vessel mass (tonnes)
radii_of_gyration: {'Rxx': roll, 'Ryy': pitch, 'Rzz': yaw} (m)
center_of_gravity: [x, y, z] from origin (m)
Returns:
6x6 mass matrix
"""
if center_of_gravity is None:
center_of_gravity = np.zeros(3)
xg, yg, zg = center_of_gravity
# Convert to kg
m = mass * 1000
# Moments of inertia
Ixx = m * radii_of_gyration['Rxx']**2 # Roll
Iyy = m * radii_of_gyration['Ryy']**2 # Pitch
Izz = m * radii_of_gyration['Rzz']**2 # Yaw
# Mass matrix (including CG offset coupling)
M = np.array([
[m, 0, 0, 0, m*zg, -m*yg],
[0, m, 0, -m*zg, 0, m*xg],
[0, 0, m, m*yg, -m*xg, 0 ],
[0, -m*zg, m*yg, Ixx, 0, 0 ],
[m*zg, 0, -m*xg, 0, Iyy, 0 ],
[-m*yg, m*xg, 0, 0, 0, Izz ]
])
M
M_fpso = create_mass_matrix(
mass=,
radii_of_gyration={
: ,
: ,
:
},
center_of_gravity=np.array([, , ])
)
()
(M_fpso)