Repository navigation
examples: trace ode_comparison through integrate_fixed and test its radius claim - #17
Merged
Merged
Conversation
…adius claim The trajectory trace in `ode_comparison` re-implemented the Euler and Heun steps by hand instead of calling the library integrator it demonstrates. It now calls `integrate_fixed` for i steps to print step i; the printed rows are identical to the hand-stepped ones (checked at steps 19 and 20). The example's closing text says the radius grows by the per-step factor sqrt(1 + h^2) for Euler and sqrt(1 + h^4/4) for Heun on the rotation field. `rotation_radius_grows_by_the_amplification_factor` in tests/ode_convergence_order.rs now checks that closed form to 1e-4 relative at 10, 20, 50 and 200 steps, so the claim is covered by cargo test rather than only printed by an example. cargo fmt --check, cargo clippy --all-targets --all-features -D warnings, the ODE test file (5 tests) and the example run pass.
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.
The trajectory trace in
ode_comparisonre-implemented the Euler and Heunsteps by hand instead of calling the library integrator it demonstrates. It
now calls
integrate_fixedfor i steps to print step i; the printed rows areidentical to the hand-stepped ones (checked at steps 19 and 20).
The example's closing text says the radius grows by the per-step factor
sqrt(1 + h^2) for Euler and sqrt(1 + h^4/4) for Heun on the rotation field.
rotation_radius_grows_by_the_amplification_factorintests/ode_convergence_order.rs now checks that closed form to 1e-4 relative at
10, 20, 50 and 200 steps, so the claim is covered by cargo test rather than
only printed by an example.
cargo fmt --check, cargo clippy --all-targets --all-features -D warnings, the
ODE test file (5 tests) and the example run pass.