feat: FreqResponsePointwise — batch sweep with guaranteed single-point arithmetic - #169
Merged
Merged
Conversation
…hmetic
FreqResponse switches long sweeps of delay-free state-space models to a
transfer-function conversion (directFrequencySweepWorkLimit) whose values
are close but not bit-identical to the single-point path. Downstream
consumers that need sweep results to reproduce single-point evaluations
exactly had to mirror the internal work limit and chunk their sweeps.
FreqResponsePointwise contracts per-frequency single-point arithmetic:
the value at each omega[k] is bit-identical to
FreqResponse([]float64{omega[k]}) regardless of sweep length, including
the per-point transfer-function fallback when the state-space solve
fails at an isolated frequency. Internal-delay (LFT) and descriptor
paths already evaluate one frequency at a time and delegate unchanged.
Co-Authored-By: Claude Mythos 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
FreqResponseswitches long sweeps of delay-free state-space models to a transfer-function conversion (directFrequencySweepWorkLimit = 80) whose values are close but not bit-identical to the single-point path. Downstream consumers that need sweep results to reproduce single-point evaluations exactly have to mirror the internal work limit and chunk their sweeps — a coupling to an unexported constant that a dependency bump can silently break.Concretely:
internal/csadapterin APC.Exp.AspenAPC-Go carriesdirectSweepWorkLimit = 80plus a chunking loop, pinned byTestChunkedFreqResponseBitIdentical. This PR removes the need for both (monorepo task CM2QFO, found by DFDQAZ wave 48).What
New exported method:
Contract: the value at each
omega[k]is bit-identical toFreqResponse([]float64{omega[k]}), regardless oflen(omega).evalFrSSInto) with the delay phase applied per point — the exact single-point arithmetic.FreqResponsecall does for that point; the TF conversion is computed once and reused (deterministic).Also adds a README API-table row.
Tests
frequency_pointwise_test.gopins the bit-identity guarantee (Float64bits comparison) across:FreqResponse)Local validation:
go fix ./...clean,go vet ./...clean,go test -count=1 -race ./...green.Please review; do not merge/tag on my behalf — the monorepo adapter switch is staged and lands after a tagged release.
🤖 Generated with Claude Code