-
Notifications
You must be signed in to change notification settings - Fork 4
Multi component terminal objective #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jack-champagne
merged 24 commits into
main
from
feature/multi-component-terminal-objective
Jan 16, 2026
Merged
Multi component terminal objective #44
jack-champagne
merged 24 commits into
main
from
feature/multi-component-terminal-objective
Jan 16, 2026
Conversation
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
…d clarity - Updated integrators to accept NamedTrajectory as a parameter, allowing for better access to trajectory dimensions and components. - Modified test_integrator function to utilize NamedTrajectory for state dimension retrieval and KnotPoint creation. - Adjusted jacobian_structure and hessian_structure functions across integrators to align with the new trajectory structure. - Refined the BilinearIntegrator, DerivativeIntegrator, TimeDependentBilinearIntegrator, and TimeIntegrator to replace vector indices with symbolic names for components. - Enhanced the IpoptEvaluator to create dynamics from integrators at evaluation time, improving modularity. - Updated DirectTrajOptProblem to store integrators directly, removing the previous dynamics structure. - Ensured all relevant tests are updated to reflect these changes, maintaining functionality and correctness.
… simplicity and consistency across the codebase
…ces once for improved performance and clarity
…nd performance; update test cases for consistency
- Refactor trajectory data extraction in `TrajectoryDynamics` to separate trajectory and global data. - Update `NamedTrajectory` wrapping to utilize extracted trajectory data for improved performance. - Introduce `NonlinearKnotPointConstraint` for applying nonlinear constraints at specific knot points in trajectories. - Implement methods for evaluating constraints, Jacobians, and Hessians for `NonlinearKnotPointConstraint`. - Add tests for `NonlinearKnotPointConstraint` covering single and multiple variable scenarios, including inequality and equality constraints. - Ensure compatibility with existing trajectory dynamics and solvers by updating constraint evaluation methods.
- Updated KnotPointObjective to streamline constructor and improve documentation. - Enhanced MinimumTimeObjective to clarify its purpose and improve gradient calculations. - Refined QuadraticRegularizer to optimize gradient and Hessian computations, ensuring proper handling of trajectory components. - Changed DirectTrajOptProblem to use AbstractObjective instead of Objective for better abstraction. - Modified IpoptEvaluator to accommodate the new AbstractObjective interface and improve Hessian evaluations. - Adjusted test utilities to include bounds for the timestep variable in the bilinear dynamics example.
…nt for trajectory constraints - Implemented NonlinearGlobalKnotPointConstraint to handle constraints at individual knot points with global parameters. - Added functionality for evaluating constraint values, Jacobians, and Hessians for both global and knot point constraints. - Introduced constructors for both constraints to accommodate varying numbers of variables and parameters. - Enhanced the existing NonlinearKnotPointConstraint with support for multiple variables, including separate and concatenated arguments. - Included extensive documentation and examples for both constraint types. - Added unit tests to verify the correctness of the new implementations and their integration with existing trajectory functionalities.
- Updated `BoundsConstraint`, `EqualityConstraint`, `SymmetryConstraint`, and `TotalConstraint` to use variable names instead of indices. - Enhanced documentation for constraints, detailing fields and usage. - Modified constructors to handle both scalar and vector values for bounds and equality constraints. - Improved the application of constraints in the `IpoptSolverExt` and `constraints.jl` files to accommodate the new structure. - Added tests for various constraints to ensure functionality and correctness.
…gnatures and remove deprecated file
…raints and integrators - Removed unused Hessian functions and preallocated matrices in various objective types. - Updated `hessian_structure` methods to return sparse matrices instead of tuples. - Introduced a `CommonInterface` module to standardize evaluation and Jacobian/Hessian computations for integrators and constraints. - Modified integrator and constraint evaluations in the Ipopt solver to utilize the new common interface. - Enhanced the `TerminalObjective` constructor for better usability. - Cleaned up the code for clarity and efficiency, ensuring consistent handling of Hessians across objectives.
…h, and `IpoptOptions` type definitions.
…tor state dimension retrieval
… IpoptEvaluator for performance with pre-computed offsets and multi-threading; enhance trajectory cache updates; add validation for timestep bounds in DirectTrajOptProblem; implement efficient value filling for Jacobian and Hessian
…ptProblem to prevent negative values during optimization
94294a7 to
0fbd761
Compare
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.
This pull request introduces a new linear constraint for time consistency, improves trajectory validation, and streamlines how time progression is enforced in trajectory optimization problems. The main changes are the addition of the
TimeConsistencyConstraintfor enforcing the relationship between time and timestep variables, automatic addition of time consistency constraints when appropriate, and removal of the oldTimeIntegratorintegrator in favor of the new constraint-based approach. There are also improvements to documentation and performance optimizations in the solver.New time consistency constraint and integration:
TimeConsistencyConstraintas a new linear constraint to enforcet_{k+1} = t_k + Δt_kwhen both time and timestep variables are present in the trajectory. This replaces the previousTimeIntegratorintegrator and is now the recommended way to ensure time progression consistency.TimeConsistencyConstraint(and initial time constraint) to the trajectory if both:tand the timestep variable are present, viaget_trajectory_constraints.TimeConsistencyConstraintinto the IPOPT solver so that the constraint is properly added to the optimization problem.Validation and safety improvements:
DirectTrajOptProblem, if a trajectory has a timestep variable but no bounds, a default lower bound of 0 is automatically added to prevent negative timesteps, with a user warning and recommendation for explicit bounds.Codebase maintenance and documentation:
TimeIntegratorintegrator and its related code, which has been superseded by the new constraint. [1] [2]CONTEXT.mdfile documenting the package's architecture, abstractions, and common patterns for maintainers and contributors.These changes improve the reliability and maintainability of time-related constraints in trajectory optimization workflows.