finite-horizon-lqr

Solve finite-horizon LQR problems using backward Riccati recursion and forward simulation.

317|40|Updated Jan 21, 2025
One-click install
npx skills add https://github.com/benchflow-ai/benchflow --skill finite-horizon-lqr-benchflow-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finite-horizon-lqr
Source: https://github.com/benchflow-ai/benchflow/tree/main/tests/fixtures/skillsbench_slice/r2r-mpc-control/environment/skills/finite-horizon-lqr
Command: npx skills add https://github.com/benchflow-ai/benchflow --skill finite-horizon-lqr-benchflow-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy.

What problem does it solve?

This skill automates the computation of optimal control sequences for linear systems, addressing the complexity of manual dynamic programming in Model Predictive Control (MPC) applications.

Core Features & Use Cases

  • Backward Riccati Recursion: Efficiently computes optimal gain matrices by iterating backward through the control horizon.
  • Forward Simulation: Projects system states forward in time based on the derived optimal control laws.
  • Use Case: Use this skill to calculate the optimal control trajectory for a robotic arm or autonomous vehicle system where minimizing cost over a specific time horizon is required.

Quick Start

Use the finite-horizon-lqr skill to compute the optimal control sequence for a system defined by matrices A and B over a specified horizon N.

Frequently Asked Questions about finite-horizon-lqr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute optimal control sequences for a linear system using finite-horizon LQR?

To compute optimal control sequences for a linear system using finite-horizon LQR, this skill applies backward Riccati recursion to derive optimal gain matrices and then projects states forward through simulation over your specified control horizon.

What is backward Riccati recursion and how does it optimize MPC control laws?

Backward Riccati recursion is a dynamic programming technique that iterates backward through the control horizon to calculate optimal gain matrices, efficiently automating the complexity of manual control law optimization for MPC frameworks.

Can I use this LQR solver for robotics applications like autonomous vehicles?

Yes, you can use this LQR solver for robotics applications like autonomous vehicles or robotic arms, as it minimizes the quadratic cost over a specific time horizon for linear dynamical systems to calculate optimal control trajectories.

Do I need NumPy to run finite-horizon LQR calculations?

Yes, you need NumPy to run finite-horizon LQR calculations, as the solver requires NumPy specifically for handling the underlying matrix operations and linear algebra computations involved in the Riccati recursion.

What's the best way to calculate an optimal control trajectory for a robotic arm in Python?

The best way to calculate an optimal control trajectory for a robotic arm in Python is to define your system matrices A and B, set a control horizon N, and use this skill to solve the linear quadratic regulator problem.