## Dynamics DSL / LQR beyond n=2 **Priority:** P2 · **Kind:** stdlib first, DSL later **Sketch:** [pattern-adoption.md](https://github.com/flooooooooooow/flow/blob/main/docs/project/pattern-adoption.md) §7 **Design Q:** [Questions.md — LQR n>2](https://github.com/flooooooooooow/flow/blob/main/docs/project/Questions.md) ### Why `apps/cartpole/control.flow` owns a private 4×4 Riccati stack because `dsys`/`analyze` are n=2. ### Recommendation Ship stdlib `lqr`/`dare` over LAPACK/Accelerate; extend DSL `n` only when matrix literals/codegen are solid. ### Work - [ ] `lqr` (or discrete ARE) in stdlib wrapping BLAS/LAPACK - [ ] Replace cartpole private mat4/Riccati with stdlib - [ ] (Follow-on) `analyze { lqr { … } }` for n>2 in DSL ### Exit Cartpole control has no private mini-linalg; general n supported via stdlib. ### Related #168 BLAS routing ROADMAP-SYNC: dynamics-dsl-lqr-beyond-n-2
Activity
godofecht commentedon Aug 5, 2026
Stdlib MVP landed in #194: dynamics/lqr.flow (dlqr_diag_q_scalar_u, n<=8 scalar-u). Cartpole uses it. Leaving open for DSL analyze { lqr } / LAPACK DARE follow-on.
godofecht commentedon Aug 5, 2026
analyze { lqr }DSL + n=4 demo in upcoming PR; LAPACK DARE still optional follow-on.analyze { lqr } DSL beyond n=2 (#162) (#204)