Mpc linearize track log

From XuShuwenn/RedAct · View interactive version

Mpc linearize track log is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Design an MPC around an operating-point linearization, track time-varying references with feedforward, and emit validated logs/metrics for simulator-based control tasks.

How to use this skill

Skill file

Operating-Point Linearization + Finite-Horizon LQR MPC with Logging

This skill packages a reusable workflow for tasks that require: (1) deriving a linearized state-space model of a known simulator around a reference operating point, (2) designing a finite-horizon LQR-based MPC for reference tracking, (3) running a closed-loop simulation for a specified duration, and (4) writing validated JSON outputs (controller parameters, control log, and performance metrics).

The pattern is broadly applicable to web-handling lines, multi-section tension/velocity chains, and other systems where the simulator offers reference trajectories and a time step.

When to Use

Activate this skill when a task asks you to:

Core Workflow

  1. Inspect the simulator and references
  1. Derive continuous-time Jacobians (linearization)
  1. Discretize consistently with the simulator
  1. Choose Q, R, and horizon N
  1. Compute LQR solutions
  1. Implement the tracking control law
  1. Run the closed-loop simulation and log
  1. Compute performance metrics
  1. Save controller parameters and logs

Verification

Common Pitfalls

Optional Script Usage

The provided script scripts/mpc_utils.py contains reusable primitives:

Example (pseudocode):

Success criteria: logs span the required time; controller_params.json fields are present with correct shapes and positivity; metrics meet task thresholds when applicable.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.