Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66 +/- ##
===========================================
- Coverage 91.32% 80.80% -10.52%
===========================================
Files 32 34 +2
Lines 6111 7311 +1200
===========================================
+ Hits 5581 5908 +327
- Misses 530 1403 +873 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f699d13 to
f01d451
Compare
3 tasks
Introduces the CoupledOperatingPoint class to represent operating conditions for individual Airplanes in free flight aerodynamic simulations. Updates module docstrings to reflect the addition and provides methods for dynamic pressure, transformation matrices, and freestream velocity calculations.
Introduces the CoupledMovement class to encapsulate multiple AirplaneMovements and their associated CoupledOperatingPoints for coupled unsteady simulations. Updates documentation in movement.py, __init__.py, and operating_point.py to reflect the new structure and clarify initialization and usage of CoupledMovement in CoupledUnsteadyProblems.
Introduces CoupledSteadyProblem and CoupledUnsteadyProblem classes to support coupled unsteady aerodynamic simulations. Updates docstrings and type annotations for clarity and consistency.
…interface with MuJoCo for free flight simulations MuJoCoModel class includes methods for applying loads, stepping the simulation, extracting state, and resetting. Updates documentation and configuration files to include mujoco as a core dependency and configures mypy for the new module.
Refactored CoupledMovement, CoupledOperatingPoint, and CoupledSteadyProblem to operate on a single Airplane and CoupledOperatingPoint per problem instead of lists. Updated initialization, validation, and documentation to reflect this change, simplifying the interface and internal logic for coupled aerodynamic problems.
Introduces CoupledUnsteadyRingVortexLatticeMethodSolver for solving CoupledUnsteadyProblems with the unsteady ring vortex lattice method. Updates _functions.py and related logic to support the new solver, including load processing and panel attribute updates.
Introduces the animate_free_flight function to animate a CoupledUnsteadyRingVortexLatticeMethodSolver's Airplane, including support for wake vortex visualization and scalar coloring. Updates draw and related internal functions to handle the coupled solver, adds new helper functions for panel and wake surface generation in free flight, and refines type checks and error handling for streamline and wake visualization.
…ttice_method.py Swapped np.cross for _functions.numba_1d_explicit_cross in backLegForces_GP1 calculation to improve performance and maintain consistency with other optimized operations.
…ging scripts with new variable names and converged/trimmed parameters Also updates debugging log with latest progress
Also updates Claude's development tracker
…oModel and CoupledUnsteadyRingVortexLatticeMethodSolver classes Also updates Claude's progress tracking log
…Point Also cleans up various typos, improves docstrings, and updates docstring style guide with subclass pattern
…it quaternions Also adds comprehensive unit tests for the new function and removes old cruder methods that tried to implement this functionality
Renamed mujoco_model.py to _mujoco_model.py and refactored MuJoCoModel to accept CoupledMovement and inertia matrix directly, generating the MuJoCo XML internally. Added new transformation matrix properties to OperatingPoint and CoupledOperatingPoint for improved axis conversions. Updated CoupledUnsteadyProblem to require inertia matrix and instantiate MuJoCoModel. Removed direct mujoco_model import from __init__.py.
The MuJoCo model is now obtained from the CoupledUnsteadyProblem instance instead of being passed directly to the CoupledUnsteadyRingVortexLatticeMethodSolver. This simplifies the constructor and enforces tighter coupling between the problem and its associated MuJoCo model.
Introduces the rotationPointOffset_Gs_Ler parameter to WingMovement, allowing specification of a custom rotation point for wing angular motion. Updates initialization, wing generation logic, fixtures, and adds comprehensive unit tests to verify correct behavior and validation of the new feature.
Replaces delta_time calculation in gammabot simulation scripts with fixed values for fine and coarse meshes. Refactors movement.py to improve delta_time optimization, including a two-stage local/global search, reproducibility via random seed, and more robust mismatch evaluation. Enhances logging and error handling for optimization process.
Numba debug messages are now silenced in the glider and flat plate free flight scripts to reduce log noise. Typing annotation added for minimizer_kwargs in movement.py, and a debug log string in coupled_unsteady_ring_vortex_lattice_method.py was updated to stop Python 3.11 "unterminated string" error.
Introduces docs/MUJOCO_CONVENTIONS.md detailing MuJoCo state variable mappings to Ptera conventions. Adds debugging_scripts/flat_plate.py for flat plate solver testing. Refactors quaternion and velocity handling in _mujoco_model.py for clarity and correctness. Improves logging in coupled_unsteady_ring_vortex_lattice_method.py to show velocity vectors. Adds vCg_E__E property to CoupledOperatingPoint for velocity in Earth axes.
Enhanced free flight visualization by correcting coordinate transformations to PyVista axes, improving camera positioning, and ensuring proper clipping range for animations. Fixed panel and wake surface transformations to PyVista axes. Updated debugging scripts and documentation to reflect current development status, added new code style and writing guidelines, and removed obsolete debugging files. Also ensured MuJoCo model initializes derived quantities before simulation steps.
8414265 to
8f9e636
Compare
… from merge with main
…now stored on a different branch
Resolve conflicts across 10 files, adapting feature/free_flight's coupled classes to main's immutability patterns (private attrs, read-only properties, tuple collections, module renames). Fix duplicate rotation point offset adjustment in WingMovement.generate_wings and update CLASSES_AND_IMMUTABILITY.md with new coupled class documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Integrates the vortex singularity refactor into the coupled unsteady RVLM solver and updates docs to reflect completion. Code changes: add _list_wake_rc0s, _currentStackBoundRc0s and _currentStackWakeRc0s storage and per-step initialization; compute wing r_c0 = 0.03 * wing.standard_mean_chord during geometry collapse and populate bound/wake r_c0 arrays; extend calculate_solution_velocity to accept and accumulate bound/wake singularity counts; pass r_c0s and singularity_counts to expanded/collapsed velocity calls throughout solver; track and log unexpected singularity counts at ERROR/INFO/DEBUG levels in wing-wing, wake-wing, load calculation, and wake population paths. Docs: FREE_FLIGHT_DEVELOPMENT.md updated to mark the singularity refactor as incorporated and to shift immediate focus to immutability/refactor and validation.
Convert coupled free-flight classes to immutable patterns and update docs/tests. CoupledMovement, CoupledSteadyProblem, and CoupledUnsteadyProblem now store constructor-set attributes as private fields with read-only properties; Airplane collections use tuples; derived properties (max_period, static) use manual lazy caching; CoupledUnsteadyProblem inertia matrix I_BP1_CgP1 is set non-writeable. Solver-populated lists (coupled_operating_points, forces_W, etc.) remain mutable. Updated docs (CLASSES_AND_IMMUTABILITY.md, FREE_FLIGHT_DEVELOPMENT.md), added a fixture for basic CoupledUnsteadyProblem (tests/unit/fixtures/problem_fixtures.py), and extended/added unit tests for initialization and immutability (tests/unit/test_movement.py, tests/unit/test_problems.py).
Add a comprehensive validation script (debugging_scripts/5_simple_glider_validation.py) that runs an unpowered glider case (converged prescribed + 500 free steps), checks aerodynamic force sensibility, gliding behavior, and energy dissipation (dE/dt ≈ -drag*speed), and emits plots (simple_glider_validation.png). Update docs/FREE_FLIGHT_DEVELOPMENT.md with validation results, summary items, and reference to the new script. Fix an immutability-related crash in CoupledUnsteadyRingVortexLatticeMethodSolver by replacing manual Airplane reconstruction with prescribed_airplane.deep_copy_with_Cg_GP1_CgP1(...) to avoid re-processing wing symmetry attributes.
…y MuJoCoModel class for GammaBot coupled simulation Track large zip archive with LFS.
12 tasks
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.
Description
This PR adds the ability to perform simulations that couple an airplane's motion to the aerodynamic forces due to its motion.
Motivation
Adding coupled simulations increases the use-cases of Ptera Software beyond pure aerodynamic investigations and makes it more attractive for general robotics simulations.
Relevant Issues
Closes #65 and improves upon solution to #50.
Changes
CoupledOperatingPointclass topterasoftware/operating_point.pyCoupledMovementclass topterasoftware/movements/movement.pyCoupledUnsteadyProblemclass topterasoftware/problems.pyCoupledSteadyProblemclass topterasoftware/problems.pypterasoftware/mujoco_model.py, which contains theMuJoCoModelclass.pterasoftware/coupled_unsteady_ring_vortex_lattice_method.py, which contains theCoupledUnsteadyRingVortexLatticeMethodSolverclass.pterasoftware/__init__.pyto import the new modules.UnsteadyRingVortexLatticeMethodSolver's_calculate_loadsmethod where it was using different functions for calculating the cross product for eachLineVortexleg.pterasoftware.output.animate.RingVortexpterasoftware.output.animateandpterasoftware.output.draw.output.print_resultsto display values in scientific notation for better readability across scales.rotationPointOffset_Gs_Lerparameter toWingMovement, allowing specification of a custom rotation point for wing angular motion.delta_time's"optimize"mode by tuning the local optimizer and introducing a fall back to dual annealing as a global optimizer.delta_time's"optimize"mode where static cases weren't improved.docs/. This uses the progressive disclosure strategy known to produce better results.MUJOCO_CONVENTIONS.mdfile with verified interpretations of MuJoCo's relevant inputs and outputs.animate_free_flightfunction inoutput.py, along with a few helper functions.Temporary Debug Scripts to Remove Before Merging
debugging_scriptsand all files withindocs/FREE_FLIGHT_DEVELOPMENT.mdgammabot_simulationsand all files withinNew Dependencies
Change Magnitude
Moderate: Medium-sized change that adds or modifies a feature without large-scale impact.
Checklist
mainand is up to date with the upstreammainbranch.--in-place --black). See the style guide for type hints and docstrings for more details.pterasoftwarepackage use type hints. See the style guide for type hints and docstrings for more details.testspackage.testspackage.codespell,black,mypy, andtests).