fix: give each natural variable its own harmonic in the van der Pol ansatz - #521
Merged
Conversation
…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.
Contributor
There was a problem hiding this comment.
⚠️ 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.
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.
Closes #251.
van_der_Polread one frequency off the front of the harmonics dict and built the ansatz with it for every natural variable. A system withxat ω andyat 3ω therefore goty = 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.