ship-dynamics-6dof-3-natural-frequencies-and-periods

Sub-skill of ship-dynamics-6dof: 3. Natural Frequencies and Periods (+1).

5 stars

Best use case

ship-dynamics-6dof-3-natural-frequencies-and-periods is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of ship-dynamics-6dof: 3. Natural Frequencies and Periods (+1).

Teams using ship-dynamics-6dof-3-natural-frequencies-and-periods should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/3-natural-frequencies-and-periods/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/engineering/marine-offshore/ship-dynamics-6dof/3-natural-frequencies-and-periods/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/3-natural-frequencies-and-periods/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ship-dynamics-6dof-3-natural-frequencies-and-periods Compares

Feature / Agentship-dynamics-6dof-3-natural-frequencies-and-periodsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of ship-dynamics-6dof: 3. Natural Frequencies and Periods (+1).

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 3. Natural Frequencies and Periods (+1)

## 3. Natural Frequencies and Periods


**Uncoupled Natural Frequency:**
```python
def calculate_natural_frequency_uncoupled(
    mass: float,
    stiffness: float
) -> dict:
    """
    Calculate natural frequency for single DOF.

    ω_n = sqrt(K / M)
    T_n = 2π / ω_n

    Args:
        mass: Mass or moment of inertia
        stiffness: Stiffness or restoring coefficient

    Returns:
        Natural frequency and period
    """
    omega_n = np.sqrt(stiffness / mass)
    period_n = 2 * np.pi / omega_n
    frequency_hz = omega_n / (2 * np.pi)

    return {
        'omega_rad_s': omega_n,
        'frequency_hz': frequency_hz,
        'period_s': period_n
    }

# Example: Heave natural period
m = 150000 * 1000  # kg
A33 = 50000 * 1000  # Added mass in heave (kg)
K33 = 1025 * 9.81 * 15000  # Heave stiffness (N/m)

heave_freq = calculate_natural_frequency_uncoupled(
    mass=m + A33,
    stiffness=K33
)

print(f"Heave natural period: {heave_freq['period_s']:.2f} seconds")
```

**Coupled Natural Frequencies:**
```python
def calculate_coupled_natural_frequencies(
    mass_matrix: np.ndarray,
    stiffness_matrix: np.ndarray
) -> dict:
    """
    Calculate coupled natural frequencies from eigenvalue problem.

    det([K] - ω²[M]) = 0

    Args:
        mass_matrix: 6x6 mass matrix (including added mass)
        stiffness_matrix: 6x6 stiffness matrix

    Returns:
        Natural frequencies for all modes
    """
    # Solve generalized eigenvalue problem
    eigenvalues, eigenvectors = np.linalg.eig(
        np.linalg.solve(mass_matrix, stiffness_matrix)
    )

    # Natural frequencies
    omega_n = np.sqrt(eigenvalues.real)
    periods = 2 * np.pi / omega_n

    # Sort by period
    sort_idx = np.argsort(periods)
    periods = periods[sort_idx]
    omega_n = omega_n[sort_idx]
    eigenvectors = eigenvectors[:, sort_idx]

    dof_names = ['Surge', 'Sway', 'Heave', 'Roll', 'Pitch', 'Yaw']

    return {
        'periods_s': periods,
        'frequencies_rad_s': omega_n,
        'frequencies_hz': omega_n / (2*np.pi),
        'mode_shapes': eigenvectors,
        'dof_names': dof_names
    }

# Example
M_total = M_fpso + np.diag([15000e3, 15000e3, 50000e3, 1e9, 1e9, 5e8])  # With added mass
K = np.diag([0, 0, 150e6, 5e9, 8e9, 0])  # Hydrostatic stiffness

natural_freq = calculate_coupled_natural_frequencies(M_total, K)

print("Natural Periods:")
for i, (dof, T) in enumerate(zip(natural_freq['dof_names'], natural_freq['periods_s'])):
    print(f"  {dof}: {T:.2f} seconds")
```


## 4. Hydrostatic Restoring


**Complete Stiffness Matrix:**
```python
def calculate_complete_hydrostatic_stiffness(
    rho: float,
    g: float,
    displacement: float,
    waterplane_area: float,
    waterplane_inertia: dict,
    center_of_buoyancy: np.ndarray,
    center_of_gravity: np.ndarray,
    metacentric_height: dict
) -> np.ndarray:
    """
    Calculate complete 6x6 hydrostatic stiffness matrix.

    Args:
        rho: Water density (kg/m³)
        g: Gravity (m/s²)
        displacement: Volume displacement (m³)
        waterplane_area: Waterplane area (m²)
        waterplane_inertia: {'Ixx': Ixx, 'Iyy': Iyy} second moments (m⁴)
        center_of_buoyancy: [xb, yb, zb] (m)
        center_of_gravity: [xg, yg, zg] (m)
        metacentric_height: {'GMT': transverse, 'GML': longitudinal} (m)

    Returns:
        6x6 hydrostatic stiffness matrix
    """
    xb, yb, zb = center_of_buoyancy
    xg, yg, zg = center_of_gravity

    C = np.zeros((6, 6))

    # C33: Heave stiffness
    C[2, 2] = rho * g * waterplane_area

    # C44: Roll stiffness
    C[3, 3] = rho * g * displacement * metacentric_height['GMT']

    # C55: Pitch stiffness
    C[4, 4] = rho * g * displacement * metacentric_height['GML']

    # Coupling terms
    # C35, C53: Heave-pitch
    C[2, 4] = -rho * g * waterplane_area * xb
    C[4, 2] = C[2, 4]

    # C34, C43: Heave-roll
    C[2, 3] = -rho * g * waterplane_area * yb
    C[3, 2] = C[2, 3]

    # C45, C54: Roll-pitch
    C[3, 4] = -rho * g * displacement * (zg - zb)
    C[4, 3] = C[3, 4]

    return C

# Example: FPSO hydrostatic stiffness
C_hydro = calculate_complete_hydrostatic_stiffness(
    rho=1025,
    g=9.81,
    displacement=150000,  # m³
    waterplane_area=15000,  # m²
    waterplane_inertia={'Ixx': 5e5, 'Iyy': 3e7},  # m⁴
    center_of_buoyancy=np.array([160, 0, -10]),
    center_of_gravity=np.array([160, 0, 15]),
    metacentric_height={'GMT': 3.0, 'GML': 5.0}
)

print("Hydrostatic Stiffness Matrix (diagonal terms):")
print(np.diag(C_hydro))
```

Related Skills

hydrodynamics

5
from vamseeachanta/workspace-hub

Manage hydrodynamic coefficients, wave spectra, and environmental loading for vessel response analysis. Use for 6×6 matrix management, wave spectrum modeling, OCIMF loading calculations, and RAO interpolation.

mkdocs-entity-relationship

5
from vamseeachanta/workspace-hub

Sub-skill of mkdocs: Entity Relationship.

hydrodynamic-pipeline-gmsh-panel-mesh-for-hydrodynamics

5
from vamseeachanta/workspace-hub

Sub-skill of hydrodynamic-pipeline: Gmsh Panel Mesh for Hydrodynamics (+3).

viv-analysis-natural-frequencies-json

5
from vamseeachanta/workspace-hub

Sub-skill of viv-analysis: Natural Frequencies JSON (+1).

viv-analysis-1-natural-frequency-analysis

5
from vamseeachanta/workspace-hub

Sub-skill of viv-analysis: 1. Natural Frequency Analysis (+3).

ship-dynamics-6dof-example-2-natural-frequency-sensitivity-study

5
from vamseeachanta/workspace-hub

Sub-skill of ship-dynamics-6dof: Example 2: Natural Frequency Sensitivity Study.

ship-dynamics-6dof-example-1-full-6dof-simulation

5
from vamseeachanta/workspace-hub

Sub-skill of ship-dynamics-6dof: Example 1: Full 6DOF Simulation.

ship-dynamics-6dof-6-seakeeping-analysis

5
from vamseeachanta/workspace-hub

Sub-skill of ship-dynamics-6dof: 6. Seakeeping Analysis.

ship-dynamics-6dof-5-time-domain-simulation

5
from vamseeachanta/workspace-hub

Sub-skill of ship-dynamics-6dof: 5. Time-Domain Simulation.

ship-dynamics-6dof-1-6-degrees-of-freedom

5
from vamseeachanta/workspace-hub

Sub-skill of ship-dynamics-6dof: 1. 6 Degrees of Freedom (+1).

orcaflex-vessel-setup-1-fpso-with-aqwa-hydrodynamics

5
from vamseeachanta/workspace-hub

Sub-skill of orcaflex-vessel-setup: 1. FPSO with AQWA Hydrodynamics (+2).

hydrodynamics-wave-spectrum-types

5
from vamseeachanta/workspace-hub

Sub-skill of hydrodynamics: Wave Spectrum Types.