Repository navigation
Make find_steady_state! for KPS3 find a real equilibrium - #331
Merged
Merged
Conversation
nlsolve usually stopped because its steps became tiny, with the accelerations of the tether particles still at about 25 m/s^2, and on some machines it printed 'solver did not converge'. The Cartesian offsets made the system badly conditioned (stiff stretching modes, soft rotation modes), the start at zero stretch sat on the kink of the spring force, and the kite can only be fully balanced at its natural elevation. Now the unknowns are the angles and relative stretches of the segments, the solver starts from a slightly stretched tether, and, as for KPS4, the elevation of the kite is prescribed instead of its vertical force balance. The horizontal residuals are taken in the plane of the tether, so the result does not depend on upwind_dir. If the pass with reduced stiffness fails, the full-stiffness pass starts again from the straight tether. The test of find_steady_state! now checks the equilibrium, the elevation and that no warning is printed, and no longer skips failures on CI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🟡 Changes recommended
The advertised direction-independent equilibrium behavior lacks automated coverage for non-default wind directions.
1 open finding
What changed in this PR
Improves KPS3 steady-state initialization by using better-conditioned segment angles and stretches while prescribing kite elevation.
Changes:
- Reworks equilibrium variables, convergence handling, and fallback behavior.
- Updates KPS3 equilibrium assertions and expected initial-state values.
- Documents the corrected initialization behavior.
| File | Description |
|---|---|
src/KPS3.jl |
Implements the revised steady-state solver. |
test/test-kps3.jl |
Updates equilibrium tests and expected values. |
CHANGELOG.md |
Describes the solver correction. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Checks the equilibrium in the plane of the tether for upwind_dir = -π/2, 0, π/4 and π, so that a sign error in the coordinate transform of find_steady_state_inner is detected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
https://doi.org/10.5281/zenodo.13310253 redirects to zenodo.org, which takes about 20 s to answer, the default timeout of lychee, so the link checker failed with a timeout on most runs. Co-Authored-By: Claude Opus 5.5 (1M context) <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.

Problem
The steady-state solver of KPS3 almost never found an equilibrium.
nlsolvereported "converged" only because its steps became tiny (x_converged). The accelerations of the tether particles were still about 25 m/s², and the tether stayed nearly straight. On some machines (e.g. the GitHub runners) one of the two passes ran into the 1000-iteration limit and printed:Causes:
set.elevation.Change
inituses.ftol = 1e-6, andcalc_elevation(s)returnsset.elevation.upwind_dir: the horizontal residuals and positions are taken in the plane of the tether.The initial state changes. For the 392 m case in
test-kps3.jlthe kite now starts at 70.0° instead of its natural elevation of 64.3°, so the expected tether length, forces and lift/drag are updated.Tests
test_find_steady_statenow checks that no warning is logged, the elevation, and that the tether particles and the kite's horizontal balance are in equilibrium. It no longer skips failures on CI. With the old solver, 6 of its tests fail.@test_broken).system.yaml; the 392 m case; upwind_dir 0°, 45°, 180°; v_wind 3, 6.5, 12, 20 m/s; elevation 20°, 45°, 85°; 12 segments. Before, elevation 20°/45° and v_wind 20 m/s did not converge.system.yamland with theparking_1psettings of KiteControllers.jl behaves like before.🤖 Generated with Claude Code