Skip to content

fix: give each natural variable its own harmonic in the van der Pol ansatz - #521

Merged
oameye merged 2 commits into
masterfrom
fix/commensurate-krylov-harmonics
Jul 28, 2026
Merged

fix: give each natural variable its own harmonic in the van der Pol ansatz#521
oameye merged 2 commits into
masterfrom
fix/commensurate-krylov-harmonics

Conversation

@oameye

@oameye oameye commented Jul 28, 2026

Copy link
Copy Markdown
Member

Closes #251.

van_der_Pol read one frequency off the front of the harmonics dict and built the ansatz with it for every natural variable. A system with x at ω and y at 3ω therefore got y = u2*cos(ωt) + v2*sin(ωt), and the whole 3ω sector of the Krylov-Bogoliubov equations came out wrong. Each variable now rotates at the harmonic it was given.

The regression test checks the ansatz carries both harmonics, and that the order-1 equations agree termwise with harmonic balance at random numeric points, up to the opposite sign convention of the two methods.

…nsatz

Closes #251.

`van_der_Pol` read one frequency off the front of the harmonics dict and built
the ansatz with it for every natural variable. A system with x at ω and y at 3ω
therefore got y = u2*cos(ωt) + v2*sin(ωt), and the whole 3ω sector of the
Krylov-Bogoliubov equations came out wrong. Each variable now rotates at the
harmonic it was given.

The regression test checks the ansatz carries both harmonics, and that the
order-1 equations agree termwise with harmonic balance at random numeric points,
up to the opposite sign convention of the two methods.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmark Results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: fdee72b Previous: 7362269 Ratio
Construction/Krylov Equation/Order 1 36175321877 ns 26196757903 ns 1.38
Construction/Krylov Equation/Order 2 41628622539 ns 30537298628 ns 1.36

This comment was automatically generated by workflow using github-action-benchmark.

@oameye
oameye merged commit 9723096 into master Jul 28, 2026
10 checks passed
@oameye
oameye deleted the fix/commensurate-krylov-harmonics branch July 28, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Krylov-Bogoliubov for commensurate frequencies

1 participant