state-space-linearization

A control-engineering method for replacing a nonlinear system with a simpler linear model near a chosen operating point. It uses derivatives to describe how small changes affect the system.

In plain words
What is it for?
It helps calculate state-space matrices, convert continuous models to discrete time, and check stability with eigenvalues.
Why use it?
It makes nonlinear behaviour easier to analyse and use for control design, while showing when the model should be updated.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/benchflow-ai/benchflow/state-space-linearization
Any agent
npx skills add benchflow-ai/benchflow --skill state-space-linearization
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/benchflow

Made for: Claude Code, Codex.

Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 324 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00324
Opus 5 $0.00008 $0.00162
Sonnet 5 $0.00003 $0.00065
Haiku 4.5 $0.00002 $0.00032

Measured 3d ago against content hash 1cd18b96f4f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

state-space-linearization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tests/fixtures/skillsbench_slice/r2r-mpc-control/environment/skills/state-space-linearization/SKILL.md · 49 lines

What it actually says

State-Space Linearization

Jacobian Computation

For nonlinear dynamics dx/dt = f(x, u), linearize around (x_ref, u_ref):

A = ∂f/∂x |_{x_ref}  (n×n matrix)
B = ∂f/∂u |_{x_ref}  (n×m matrix)

Discretization

For discrete-time control with timestep dt:

Euler method (simple, first-order accurate):

A_d = I + dt * A_c
B_d = dt * B_c

Matrix exponential (exact for LTI):

A_d = expm(A_c * dt)
B_d = inv(A_c) @ (A_d - I) @ B_c

For R2R Systems

The Jacobian depends on current tensions and velocities. Key partial derivatives:

∂(dT_i/dt)/∂T_i = -v_i / L
∂(dT_i/dt)/∂v_i = EA/L - T_i/L
∂(dv_i/dt)/∂T_i = -R²/J
∂(dv_i/dt)/∂u_i = R/J

Tips

  • Linearize around the reference operating point
  • Update linearization if operating point changes significantly
  • Check stability via eigenvalue analysis
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 49 lines · 16 tokens per session scan A 1cd18b96f4f5

Subscribe to this mod's changes

state-space-linearization is a skill published in the GitHub repository benchflow-ai/benchflow (335 stars, last pushed 3d ago), licensed Apache-2.0. It adds 16 tokens to every session and 324 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

pubchem-database

Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). Search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics.

benchflow-ai/skillsbench · 49 tokens

rdkit

Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom…

benchflow-ai/skillsbench · 80 tokens

Multimodal Fusion for Speaker Diarization

Combine visual features (face detection, lip movement analysis) with audio features to improve speaker diarization accuracy in video files. Use OpenCV for face detection and lip movement tracking, then fuse visual cues with audio-based speaker embeddings. Essential when processing video files with multiple visible…

benchflow-ai/skillsbench · 74 tokens

routing-subtour-elimination

Subtour-elimination methods for TSP, VRP, pickup/dropoff routing, and routing MIPs with binary arc variables. Use when route-continuity constraints may permit disconnected cycles and the model needs MTZ constraints, flow-based connectivity constraints, DFJ subset cuts, or lazy/iterative subtour cuts.

benchflow-ai/skillsbench · 70 tokens

scip-opt

SCIP optimization with PySCIPOpt. Use when facing an optimization problem with an objective, hard constraints, soft penalties, integer decisions, routing, assignment, scheduling, allocation, packing, capacity, inventory, or service-level rules. Prefer modeling and solving the problem with PySCIPOpt when it is…

benchflow-ai/skillsbench · 67 tokens

Voice Activity Detection (VAD)

Detect speech segments in audio using VAD tools like Silero VAD, SpeechBrain VAD, or WebRTC VAD. Use when preprocessing audio for speaker diarization, filtering silence, or segmenting audio into speech chunks. Choose Silero VAD for short segments, SpeechBrain VAD for general purpose, or WebRTC VAD for lightweight…

benchflow-ai/skillsbench · 79 tokens