-
Notifications
You must be signed in to change notification settings - Fork 68
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
Rework of cannonball example. #545
Conversation
Fixed WaterRocket example since CannonballPhase no longer exists. Fixed a missing minus sign in brachistochrone docs.
# Ask OpenMDAO to compute the partial derivatives using complex-step | ||
# with a partial coloring algorithm for improved performance | ||
self.declare_partials('*', '*', method='cs') | ||
self.declare_coloring(wrt='*', method='cs') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the declare_partials if we have declare_coloring
descent.add_state('v', fix_initial=False, fix_final=False) | ||
descent.add_state('r', units='m', rate_source='r_dot') | ||
descent.add_state('h', fix_initial=False, fix_final=True, | ||
units='m', rate_source='h_dot') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in this example, we are being explicit about rate_source and units (because it is a more advanced feature to let dymos figure them out for you)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, since we define the ODE in that same example we should probably just tag the state rates.
@@ -82,7 +82,8 @@ that provides the maximum range cannonball. | |||
|
|||
## Building and running the problem | |||
|
|||
The following code instantiates our problem, our trajectory, two phases, | |||
The following code instantiates our defines the components for the physical |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something got lost here. Probably need to remove the words "instantiates our".
subsys=USatm1976Comp(num_nodes=nn)) | ||
# Ask OpenMDAO to compute the partial derivatives using complex-step | ||
# with a partial coloring algorithm for improved performance | ||
self.declare_partials('*', '*', method='cs') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too, don't need declare partials.
Summary
Makes the cannonball example simpler.
Makes necessary changes to water rocket example due to changes in cannonball.
Fixed a missing minus sign in brachistochrone docs.
This PR includes changes from #544
Related Issues
None
Status
Backwards incompatibilities
None
New Dependencies
None