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

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

5 stars

Best use case

ship-dynamics-6dof-example-1-full-6dof-simulation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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

Teams using ship-dynamics-6dof-example-1-full-6dof-simulation 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/example-1-full-6dof-simulation/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/engineering/marine-offshore/ship-dynamics-6dof/example-1-full-6dof-simulation/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/example-1-full-6dof-simulation/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

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

Feature / Agentship-dynamics-6dof-example-1-full-6dof-simulationStandard 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: Example 1: Full 6DOF Simulation.

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

# Example 1: Full 6DOF Simulation

## Example 1: Full 6DOF Simulation


```python
def simulate_vessel_6dof_in_waves(
    vessel_properties: dict,
    wave_conditions: dict,
    duration: float = 3600,
    dt: float = 0.1
) -> dict:
    """
    Complete 6DOF vessel simulation in irregular waves.

    Args:
        vessel_properties: Vessel mass, stiffness, damping
        wave_conditions: Hs, Tp, heading
        duration: Simulation duration (s)
        dt: Time step (s)

    Returns:
        Complete motion results
    """
    import plotly.graph_objects as go
    from plotly.subplots import make_subplots

    # Time array
    t = np.arange(0, duration, dt)
    n_steps = len(t)

    # Extract properties
    M = vessel_properties['mass_matrix']
    C_damp = vessel_properties['damping_matrix']
    K = vessel_properties['stiffness_matrix']

    # Generate wave forces (simplified JONSWAP spectrum)
    Hs = wave_conditions['Hs']
    Tp = wave_conditions['Tp']
    heading = wave_conditions['heading']  # degrees

    # Wave force time series (simplified)
    omega_p = 2 * np.pi / Tp
    F_wave = np.zeros((n_steps, 6))

    # Generate forces for each DOF based on heading
    if heading == 0:  # Head seas
        F_wave[:, 0] = Hs * 1e5 * np.sin(omega_p * t)  # Surge
        F_wave[:, 2] = Hs * 5e5 * np.sin(omega_p * t)  # Heave
        F_wave[:, 4] = Hs * 1e6 * np.sin(omega_p * t)  # Pitch
    elif heading == 90:  # Beam seas
        F_wave[:, 1] = Hs * 1e5 * np.sin(omega_p * t)  # Sway
        F_wave[:, 3] = Hs * 2e6 * np.sin(omega_p * t)  # Roll

    # Add random component for irregular seas
    for i in range(6):
        F_wave[:, i] += np.random.randn(n_steps) * 0.2 * np.std(F_wave[:, i])

    # Run simulation
    result = newmark_beta_integration(
        M, C_damp, K, F_wave,
        x0=np.zeros(6), v0=np.zeros(6), t=t
    )

    # Calculate statistics for all DOFs
    dof_names = ['Surge', 'Sway', 'Heave', 'Roll', 'Pitch', 'Yaw']
    statistics = {}

    for i, dof in enumerate(dof_names):
        statistics[dof] = calculate_seakeeping_statistics(
            result['displacement'][:, i], dt, dof
        )

    # Create visualization
    fig = make_subplots(
        rows=2, cols=3,
        subplot_titles=dof_names
    )

    for i, dof in enumerate(dof_names):
        row = i // 3 + 1
        col = i % 3 + 1

        fig.add_trace(
            go.Scatter(
                x=t,
                y=result['displacement'][:, i],
                name=dof,
                showlegend=False
            ),
            row=row, col=col
        )

    fig.update_layout(
        title=f'6DOF Vessel Motions (Hs={Hs}m, Tp={Tp}s, Heading={heading}°)',
        height=800
    )

    fig.write_html('reports/6dof_simulation.html')

    return {
        'time': t,
        'motions': result,
        'statistics': statistics,
        'wave_conditions': wave_conditions
    }

# Example usage
vessel = {
    'mass_matrix': M_fpso,
    'damping_matrix': np.diag([50e6, 50e6, 100e6, 5e8, 5e8, 2e8]),
    'stiffness_matrix': C_hydro
}

waves = {
    'Hs': 8.5,
    'Tp': 12.0,
    'heading': 0  # Head seas
}

results = simulate_vessel_6dof_in_waves(vessel, waves, duration=600, dt=0.1)

print("Motion Statistics:")
for dof, stats in results['statistics'].items():
    print(f"{dof}: Sig = {stats['significant_amplitude']:.2f}, Max = {stats['max_amplitude']:.2f}")
```

Related Skills

full-branch-cleanup-and-worktree-hygiene

5
from vamseeachanta/workspace-hub

Track all dirty/untracked workspace-hub changes, merge stale branches into main, clean remote/local branches, and remove stale worktrees while preserving tracked nested gitlinks.

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.

gh-issue-creation-full-repo-and-batch-setup

5
from vamseeachanta/workspace-hub

Create multiple related GitHub issues safely by resolving full OWNER/REPO, checking duplicates and labels first, and verifying each created issue.

mkdocs-example

5
from vamseeachanta/workspace-hub

MkDocs example admonition syntax. Use when inserting code examples or worked demonstrations in MkDocs documentation.

mkdocs-entity-relationship

5
from vamseeachanta/workspace-hub

Sub-skill of mkdocs: Entity Relationship.

skill-creator-inspiration-examples

5
from vamseeachanta/workspace-hub

Sub-skill of skill-creator: Inspiration & Examples.

skill-creator-example-1-scenario-name

5
from vamseeachanta/workspace-hub

Sub-skill of skill-creator: Example 1: [Scenario Name] (+1).

bash-script-framework-example-1-create-new-cli-tool

5
from vamseeachanta/workspace-hub

Sub-skill of bash-script-framework: Example 1: Create New CLI Tool (+1).

instrument-data-allotrope-example-1-vi-cell-blu-file

5
from vamseeachanta/workspace-hub

Sub-skill of instrument-data-allotrope: Example 1: Vi-CELL BLU file (+2).

clinical-trial-protocol-full-workflow-logic

5
from vamseeachanta/workspace-hub

Sub-skill of clinical-trial-protocol: Full Workflow Logic.

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

5
from vamseeachanta/workspace-hub

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

wave-theory-example-1-complete-wave-analysis

5
from vamseeachanta/workspace-hub

Sub-skill of wave-theory: Example 1: Complete Wave Analysis.