numpy-numerical-analysis-5-linear-algebra-operations
Sub-skill of numpy-numerical-analysis: 5. Linear Algebra Operations.
Best use case
numpy-numerical-analysis-5-linear-algebra-operations is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of numpy-numerical-analysis: 5. Linear Algebra Operations.
Teams using numpy-numerical-analysis-5-linear-algebra-operations 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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/5-linear-algebra-operations/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How numpy-numerical-analysis-5-linear-algebra-operations Compares
| Feature / Agent | numpy-numerical-analysis-5-linear-algebra-operations | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of numpy-numerical-analysis: 5. Linear Algebra Operations.
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
# 5. Linear Algebra Operations
## 5. Linear Algebra Operations
**Eigenvalue Analysis:**
```python
def natural_frequency_analysis(
mass_matrix: np.ndarray,
stiffness_matrix: np.ndarray
) -> dict:
"""
Perform eigenvalue analysis to find natural frequencies and mode shapes.
[K]{ϕ} = ω²[M]{ϕ}
Args:
mass_matrix: Mass matrix [M]
stiffness_matrix: Stiffness matrix [K]
Returns:
Dictionary with natural frequencies and mode shapes
"""
# Solve generalized eigenvalue problem
eigenvalues, eigenvectors = np.linalg.eig(
np.linalg.solve(mass_matrix, stiffness_matrix)
)
# Natural frequencies (rad/s)
natural_frequencies_rad = np.sqrt(eigenvalues)
# Natural frequencies (Hz)
natural_frequencies_hz = natural_frequencies_rad / (2 * np.pi)
# Sort by frequency
sort_indices = np.argsort(natural_frequencies_hz)
natural_frequencies_hz = natural_frequencies_hz[sort_indices]
eigenvectors = eigenvectors[:, sort_indices]
# Periods
periods = 1 / natural_frequencies_hz
return {
'frequencies_hz': natural_frequencies_hz,
'frequencies_rad_s': natural_frequencies_rad[sort_indices],
'periods_s': periods,
'mode_shapes': eigenvectors
}
# Example: FPSO natural frequencies
# 6DOF system
M = np.diag([150000, 150000, 150000, 1e7, 1e7, 5e6]) # Mass matrix (tonnes, tonne-m²)
K = np.diag([500, 500, 3000, 5e5, 5e5, 1e5]) # Stiffness (kN/m, kN-m/rad)
results = natural_frequency_analysis(M, K)
print("Natural Frequencies:")
for i, (freq, period) in enumerate(zip(results['frequencies_hz'], results['periods_s'])):
dof_names = ['Surge', 'Sway', 'Heave', 'Roll', 'Pitch', 'Yaw']
print(f" Mode {i+1} ({dof_names[i]}): f = {freq:.4f} Hz, T = {period:.2f} s")
```
**Matrix Decomposition:**
```python
def lu_decomposition_solve(A: np.ndarray, b: np.ndarray) -> np.ndarray:
"""
Solve linear system using LU decomposition.
Args:
A: Coefficient matrix
b: Right-hand side vector
Returns:
Solution vector x
"""
from scipy.linalg import lu
# LU decomposition
P, L, U = lu(A)
# Solve Ly = Pb
y = np.linalg.solve(L, P @ b)
# Solve Ux = y
x = np.linalg.solve(U, y)
return x
# Example
A = np.array([[4, -1, 0],
[-1, 4, -1],
[0, -1, 3]])
b = np.array([15, 10, 10])
x = lu_decomposition_solve(A, b)
print(f"Solution: {x}")
```Related Skills
mnt-analysis-cleanup
Survey, classify, and clean up `/mnt/local-analysis/` (or any sibling-to-workspace-hub directory holding orphan worktrees, codex-burn artifacts, agent log accumulations, and outer-clone duplicates) without losing useful code/work. Surfaces a tiered approval menu rather than baking decisions; defers all destructive ops until user confirms.
memory-bridge-operations
Operate and recover the Hermes-to-repo memory bridge: drift checks, quality gate, bridge commits, push verification, and stash recovery when pre-bridge scripts fail after generating outputs.
linear
Manage Linear issues, projects, and teams via the GraphQL API. Create, update, search, and organize issues. Uses API key auth (no OAuth needed). All operations via curl — no dependencies.
repo-architecture-analysis
Scan a Python repo's package structure, count classes/functions, classify module maturity (PRODUCTION/DEVELOPMENT/SKELETON/GAP), and generate architecture reports with Mermaid diagrams. Use when asked to analyze codebase structure, find untested packages, or assess module maturity.
github-issue-lifecycle-operations
Class-level GitHub issue lifecycle operations: issue creation, planning/execution routing, labels, evidence fields, roadmap anchors, closeout races, and visual planning.
viv-analysis
Assess vortex-induced vibration (VIV) for risers and tubular members with natural frequency and safety factor calculations. Use for VIV susceptibility analysis, natural frequency calculation, vortex shedding assessment, and tubular member fatigue from VIV.
structural-analysis
Structural analysis for marine and offshore structures per DNV/API/ISO codes. Use when performing ULS/ALS limit state checks, column buckling, beam deflection, tubular joint capacity (DNV-RP-C203), or stiffened panel analysis. Covers section properties, combined loading, and ALS dented pipe assessment.
signal-analysis
Perform signal processing, rainflow cycle counting, and spectral analysis for fatigue and time series data. Use for analyzing stress time histories, computing FFT/PSD, extracting fatigue cycles (ASTM E1049-85), and batch processing OrcaFlex signals.
orcawave-qtf-analysis
Second-order wave force QTF computation in OrcaWave. Use when computing mean drift forces, difference-frequency or sum-frequency QTFs, slow-drift response, or applying Newman approximation for offshore structures.
orcaflex-modal-analysis
Perform modal and frequency analysis on OrcaFlex models to extract natural frequencies, mode shapes, and identify dominant DOF responses. Use for VIV assessment, resonance identification, and structural dynamics characterization.
orcaflex-jumper-analysis
Rigid and flexible jumper modelling in OrcaFlex covering installation analysis, in-place analysis, VIV screening, and fatigue assessment.
orcaflex-installation-analysis
Create and analyze OrcaFlex models for offshore installation sequences including subsea structure lowering, pipeline installation, and crane operations. Generate models at multiple water depths and orientations for installation feasibility studies.