Skip to content
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

Refactored the Radau transcription to avoid the use of StateIndependentsComp #1117

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

robfalck
Copy link
Contributor

@robfalck robfalck commented Oct 4, 2024

The original Radau transcription can be accessed as RadauDeprecated, but will remain until the new one is thoroughly vetted.

RadauNew removes the need for the StateIndependentsComp which used a complicated hybrid IVC/implicit/explicit component implementation. RadauNew uses the same structure as the Birkhoff transcription, where initial and final values of states in the phase are double-specified...once in the array of state values, and once as initial_states:{name} or final_states:{name}. This provides a better source/target when linking phases together.

An important restriction of the new radau implementation is that it no longer supports compressed transcription. Continuity constraints are implemented between segments for state and control values.

Summary

Summary of PR.

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

…ons as Radau.

Original Radau transcription can be accessed as RadauDeprecated, but will remain until the new one is thoroughly vetted.

RadauNew removes the need for the StateIndependentsComp which used a complicated hybrid IVC/implicit/explicit component implementation.
RadauNew uses the same structure as the Birkhoff transcription, where initial and final values of states in the phase are double-specified...once in the array of state values, and once as initial_states:{name} or final_states:{name}.
This provides a better source/target when linking phases together.

An important restriction of the new radau implementation is that it no longer supports compressed transcription.  Continuity constraints are implemented between segments for state and control values.
@robfalck robfalck marked this pull request as draft October 4, 2024 15:29
@@ -66,7 +66,7 @@ def brachistochrone_min_time(transcription='gauss-lobatto', num_segments=8, tran
# Minimize time at the end of the phase
phase.add_objective('time', loc='final', scaler=10)

p.model.linear_solver = om.DirectSolver()
p.model.linear_solver = om.DirectSolver(assemble_jac=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test have problems with assembled-jac now?

@@ -9,7 +10,7 @@
OPT, OPTIMIZER = set_pyoptsparse_opt('SNOPT', fallback=True)


@use_tempdirs
# @use_tempdirs
Copy link
Member

@Kenneth-T-Moore Kenneth-T-Moore Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to uncomment here and other places.

@@ -1,5 +1,6 @@
from .analytic.analytic import Analytic
from .explicit_shooting import ExplicitShooting
from .pseudospectral.gauss_lobatto import GaussLobatto
from .pseudospectral.radau_pseudospectral import Radau
from .pseudospectral.radau_pseudospectral import Radau as RadauDeprecated
Copy link
Member

@Kenneth-T-Moore Kenneth-T-Moore Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to rename the module to radau_deprecated, just to alleviate confusion when viewing the file in the future. Then radau_new can become radau_pseudospectral. Otherwise, kind of mixing paradigms here.


def configure_timeseries_outputs(self, phase):
"""
Create connections from time series to all post-introspection sources.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, "to time series" and "from all post-introspection sources"

"""
Declare group options.
"""
self.options.declare('grid_data', types=GridData, desc='Container object for grid info.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be recordable=False?


class RadauDefectComp(om.ExplicitComponent):
"""
Class definiton for the Collocationcomp.
Copy link
Member

@Kenneth-T-Moore Kenneth-T-Moore Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propagate rename through the docstring. -> RadauDefectComp

I think inclusion of initial and final defect are also new and should be mentioned?

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