Releases: jamestjsp/controlsys
Releases · jamestjsp/controlsys
v0.5.0
Breaking Changes
Lqe,Kalman,Kalmdnow accept*RiccatiOptsas final parameter for workspace reuse
Performance Optimizations
Riccati Solvers (Care/Dare)
RiccatiWorkspacestruct pools ~25 arrays, reducing GC churn by ~96% (1.95 MB/call eliminated)- Care_N10: 54,640 → 994 B/op, Dare_N10: 63,784 → 906 B/op
HinfNorm
- Replace 50x per-frequency EvalFr+SVD loop with single vectorized
Sigma()call - 43% faster, 95% less memory, 83% fewer allocs
Transfer Functions
- Pool
vPolyRecurrenceallocations: 25% fewer allocs per matrix transformation
FeedbackLFT
- Scoped BLAS workspace eliminates ~48 intermediate allocations (321 → 273 allocs/op)
Balreal / Balred
- Single unified buffer replaces 17
make()calls (104 → 88 allocs/op)
ControllabilityStaircase
- Static
blockBufeliminates per-iterationmat.NewDense(126 → 109 allocs/op)
Raw Stride Indexing
- Replace
At()/Set()with directRawMatrix().Dataindexing in transfer.go, frequency.go, feedback_lft.go hot paths
Lqr/Kalman Workspace Propagation
Lqe/Kalman/KalmdproxyRiccatiOptsto inner Care/Dare calls- Kalman_N100: 2,213 Ki → 309 Ki B/op (86% reduction)
v0.4.0
Breaking Changes
System.InternalDelay,System.B2,System.C2,System.D12,System.D21,System.D22fields replaced bySystem.LFT *LFTDelaynested structsys.InternalDelay→sys.LFT.Tausys.B2→sys.LFT.B2(same for C2, D12, D21, D22)nilcheck:sys.LFT == nilreplaces individual field checks
Improvements
- Add
copyStrided/copyBlockmatrix copy helpers, eliminating ~100 duplicate inline copy loops - Unify duplicate
extractBlock/extractSubmatrixfunctions - -3.5% benchmark geomean improvement across 101 benchmarks (up to -17% on delay operations)
- Net -51 lines of code
Tests & Coverage
- Add MATLAB delay system tests (Pade, Thiran, c2d, feedback, margins)
- Add exact MATLAB/python-control expected values to all tests
- Tighten test tolerances
- Coverage 83.9% → 85.7%
Other
- Update README with full API coverage
v0.3.0
Performance & Robustness
Simulation hot-path optimizations
- Replace gonum
MulVec/AddVecwrappers with directblas64.Gemvcalls insimulateNoDelay(-22%) andsimulateWithInternalDelay(-74%) - Fuse
A*x + B*uintoGemv(beta=1)accumulation, eliminating intermediate buffers
Frequency response allocation reduction
- Add
TransferFunc.evalIntofor allocation-free transfer function evaluation FreqResponseallocs -71% (560→160),Bodeallocs -81% (992→192)
Numerical robustness (#347510c)
- Harden numerical robustness and close test coverage gaps
Simulation performance (#4429669)
- Batch delayed MIMO simulation to remove per-input replay overhead (#2)
New benchmarks
- 7 MATLAB-inspired benchmarks: DC motor, Boeing 747 lateral/longitudinal, mass-spring-damper chain, large system (50 states), feedback+simulate pipeline, large MIMO Bode
v0.2.0
Bug Fixes
-
Fix DiscretizeZOH silently dropping InternalDelay (#1)
DiscretizeZOHandDiscretizenow properly handle systems with internal delays (LFT structure produced byFeedbackwith delays in the feedback path).Two underlying bugs fixed:
DiscretizeZOH/Discretizesilently discarded the LFT delay structure (B2,C2,D12,D21,D22,InternalDelay), reducing the system to its delay-free rational part — causingS ≈ 1andT ≈ 0instead of correct sensitivity functions.discretizeWithInternalDelaycopied the continuous-timeB2unchanged instead of computingBd2 = Γ·B2via the augmented matrix exponential, making the delayed feedback gain ~20× too large.