Skip to content

Enhance alphaBetaMasses with velocity-dependent final mass computation#63

Open
AstroEloy wants to merge 1 commit into
wmpg:masterfrom
AstroEloy:master
Open

Enhance alphaBetaMasses with velocity-dependent final mass computation#63
AstroEloy wants to merge 1 commit into
wmpg:masterfrom
AstroEloy:master

Conversation

@AstroEloy

Copy link
Copy Markdown

This update extends alphaBetaMasses by supporting the full alpha-beta final-mass solution when both initial and final velocities are provided. The previous asymptotic approximation is retained for backward compatibility when velocity information is unavailable.

Additional improvements include:

  • Input validation for alpha, beta, mu, density, drag parameter, shape coefficient, and velocities.
  • Optional verbose output summarizing the adopted parameters and resulting mass estimates.
  • Expanded documentation.

This update extends alphaBetaMasses by supporting the full alpha-beta
final-mass solution when both initial and final velocities are provided.
The previous asymptotic approximation is retained for backward
compatibility when velocity information is unavailable.

Additional improvements include:
- Input validation for alpha, beta, mu, density, drag parameter,
  shape coefficient, and velocities.
- Optional verbose output summarizing the adopted parameters and
  resulting mass estimates.
- Expanded documentation.
@dvida

dvida commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR — the velocity-dependent final-mass extension is a useful addition and the underlying math is correct (it's the standard Gritsevich dimensionless mass equation, with the old exp(-beta/(1-mu)) recovered as the v_end → 0 limit). The input validation is also a nice touch. A few things to fix before merge:

1. Duplicate function definition (blocking). The new alphaBetaMasses is appended after the existing one rather than replacing it. The file now has two functions with the same name (old at lines ~456–487, new right after). Python silently uses the last definition, so the old one becomes dead code. Please delete the original def alphaBetaMasses(...) block and keep only the new version. As-is, this also leaves two conflicting docstrings (gamma described as "Drag coefficient (2*drag factor)" in the old one vs. "Γ = C_D/2" in the new one).

2. Feature isn't wired into the CLI. The only callers are in the __main__ block (lines ~612 and ~614), and they don't pass vel_init/vel_end — so the new full solution is never exercised by the script itself, only via direct import. Since v_init is already available (line ~608) and the trajectory has the final velocity, please pass them through so the CLI actually uses the new path (or note explicitly that it's library-only).

3. Minor style. Trailing whitespace on several blank lines (docstring opener, before if verbose, etc.), and add a second blank line before the def per PEP8.

Once the duplicate is removed and the velocities are plumbed into the main block, this is good to go.

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.

2 participants