본문으로 건너뛰기
cccskills
무료GitHub에 공개

finite-horizon-lqr

Compute finite-horizon linear quadratic regulator (LQR) controls with dynamic programming for model predictive control (MPC). The skill outlines a backward Riccati recursion, forward simulation, and applying the first control at each time step.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Solving finite-horizon LQR via dynamic programming for MPC.

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Deriving finite-horizon LQR control inputs
  • Applying LQR within a model predictive control loop
  • Reviewing a backward Riccati recursion

포함된 파일(1)

  • SKILL.md1.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Finite-Horizon LQR for MPC

Problem Formulation

Minimize cost over horizon N:

J = Σ(k=0 to N-1) [x'Qx + u'Ru] + x_N' P x_N

Backward Riccati Recursion

Initialize: P_N = Q (or LQR solution for stability)

For k = N-1 down to 0:

K_k = inv(R + B'P_{k+1}B) @ B'P_{k+1}A
P_k = Q + A'P_{k+1}(A - B @ K_k)

Forward Simulation

Starting from x_0:

u_k = -K_k @ x_k
x_{k+1} = A @ x_k + B @ u_k

Python Implementation

def finite_horizon_lqr(A, B, Q, R, N, x0):
    nx, nu = A.shape[0], B.shape[1]
    K = np.zeros((nu, nx, N))
    P = Q.copy()

    # Backward pass
    for k in range(N-1, -1, -1):
        K[:,:,k] = np.linalg.solve(R + B.T @ P @ B, B.T @ P @ A)
        P = Q + A.T @ P @ (A - B @ K[:,:,k])

    # Return first control
    return -K[:,:,0] @ x0

MPC Application

At each timestep:

  1. Measure current state x
  2. Solve finite-horizon LQR from x
  3. Apply first control u_0
  4. Repeat next timestep

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Analyze SEC 13F filings to summarize a fund’s holdings and assets under management for a quarter, compare holdings across two quarters, and rank funds by the reported value of a stock position.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Summarizing a fund’s holdings for one quarter
  • Comparing a fund’s reported positions across quarters
  • Finding funds with the largest reported position in a stock
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Compute active and reactive power flows at both ends of an AC power line, accounting for transformer tap ratios and phase shifts. The skill also covers apparent power, bus balance aggregation, MVA limit checks, and branch loading calculations.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Calculate power flow in both directions across a transmission line
  • Check branch apparent power against its MVA rating
  • Calculate and report the most heavily loaded branches
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Prepare academic PDFs for blind review by removing matching identifying details before the References section. The skill focuses redaction on specific text matches, preserves references and self-citations, and checks that the saved document retains its pages and most of its text.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Anonymizing an academic paper for blind review
  • Removing author names and affiliations from a PDF
  • Checking a redacted paper for text loss
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Check bathroom floor plans against simplified ADA-derived geometric rules for turning space, door width and swing, toilet placement, grab bars, and lavatory knee or toe clearance. It reports rule-specific violations and suggests local, traceable layout repairs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check turning space in a bathroom plan
  • Review door width and swing clearances
  • Verify toilet and grab bar placement
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Reviews failed GitHub Actions job logs for a pull request or specific job URLs. It returns a concise summary of the likely root cause, error messages, test names, and relevant log excerpts, so you can see what needs attention.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Summarizing failed CI jobs for a pull request
  • Investigating an individual GitHub Actions job
  • Finding the error and related test in logs
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Extract plan-view geometry from architectural DXF files by interpreting CAD layers and geometric entities. Normalize rooms, doors, fixtures, clearances, and grab bars into consistent, machine-checkable JSON, and describe repaired geometry in a new DXF when needed.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Turning an architectural DXF plan into structured JSON
  • Checking room and door geometry for accessibility
  • Extracting fixture bounds and grab bar details
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

benchflow-ai의 스킬 모두 보기

이 스킬의 문제 신고