Skip to content

Navigation Menu

Sign in
Sign up

Validate that a custom aeroelastic spacing's supplied second derivative matches the spacing #247

Open
Labels
maintenanceImprovements or additions to documentation, testing, robustness, or tooling

Description

Problem Statement

AeroelasticWingMovement accepts a custom callable angular-spacing component paired with a spacingAnglesSecondDerivative_Gs_to_Wn_ixyz callable that is supposed to be that spacing's analytical second time derivative. The constructor validates only that the derivative is present and callable when the spacing is callable (and absent otherwise); it never checks that the supplied callable is in fact the second derivative of the spacing. A wrong derivative silently corrupts the inertial moment that _generate_inertial_moment_function in problems.py builds from it, and therefore the structural deformation, with no error and no obvious symptom. This is the one custom-callable parameter in the package whose mathematical contract is both checkable and currently unchecked: the spacing function itself gets a full behavioral validation pass (_validate_custom_spacing_function in _oscillation.py samples it over two periods and enforces float return, finiteness, start at 0.0, return to 0.0 after one period, amplitude 1.0, and periodicity), but its supplied second derivative gets none.

Location(s): pterasoftware/movements/aeroelastic_wing_movement.py, pterasoftware/_oscillation.py

Proposed Solution

Because the constructor already holds both the spacing and its derivative, it can sample-verify their consistency the same way the spacing itself is validated: evaluate the spacing on a time grid, take a second-order finite-difference second derivative, and compare against the supplied callable within a tolerance, raising a ValueError that reports the measured maximum discrepancy on mismatch. Tie the grid and tolerance to the existing spacing-validation pass (201 points over two periods, 0.05 absolute tolerance) so the two feel consistent. The same call also catches the cheaper failures for free (the derivative returning a non-float or non-finite value), so those need no separate handling. The design work is in the numerics, not the plumbing: finite-differencing a second derivative to a meaningful tolerance requires reconciling endpoint handling, grid spacing against the function's curvature, and the amplitude and period scaling the solver applies to the spacing, before the comparison is apples-to-apples.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceImprovements or additions to documentation, testing, robustness, or tooling

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /