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

Added interpolation of results to arbitrary nodes, removed use of scipy.interpolate.interp1d from phase.interp. #1129

Merged
merged 45 commits into from
Nov 15, 2024

Conversation

robfalck
Copy link
Contributor

@robfalck robfalck commented Nov 8, 2024

Summary

  • Per a users request, added the ability to use phase.interp to obtain outputs on any set of points in phase tau space [-1, 1].
  • Switched phase.interp to use scipy.interpolate.make_interp_spline. Spline types that are no longer supported will now result in linear interpolation.
  • remove deprecated Phase.interpolate method. users should use Phase.interp.
  • removed outdated test_upgrade_guide tests.
  • changed cannonball implicit duration test to use ScipyOptimizeDriver.

In general IPOPT on the latest workflow seems to be having issues with converging some of the problems, but it's not obvious yet as to why. Need to keep an eye on it.

Related Issues

  • Resolves #

Backwards incompatibilities

-Phase.interpolate is removed in favor of Phase.interp.

New Dependencies

None

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@robfalck robfalck marked this pull request as draft November 10, 2024 14:16
@coveralls
Copy link

coveralls commented Nov 15, 2024

Coverage Status

coverage: 93.667% (-0.3%) from 93.922%
when pulling c61f09a on robfalck:interp_update
into bb341a4 on OpenMDAO:master.

@robfalck robfalck marked this pull request as ready for review November 15, 2024 14:10
# self.rho_interp = InterpND(points=np.array(alt_data),
# values=np.array(rho_data),
# method='slinear', extrapolate=True)
self.rho_interp = make_interp_spline(alt_data, rho_data, k=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

cleanup

p.driver = om.pyOptSparseDriver()
p.driver.options['optimizer'] = 'IPOPT'
p.driver = om.ScipyOptimizeDriver()
# p.driver.options['optimizer'] = 'SLSQP'
Copy link
Contributor

Choose a reason for hiding this comment

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

cleanup

res = np.atleast_2d(interpfunc(node_locations))

Copy link
Member

Choose a reason for hiding this comment

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

If reversed_xs, do you need to flip the indices on res before returning it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I don't think so. By flipping the results returned by unique, which are always sorted, we recover the requested ordering.

@robfalck robfalck merged commit f05f58c into OpenMDAO:master Nov 15, 2024
12 checks passed
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.

4 participants