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

Draft: Utilities module #250

Closed
wants to merge 26 commits into from
Closed

Draft: Utilities module #250

wants to merge 26 commits into from

Conversation

dtgaebe
Copy link
Collaborator

@dtgaebe dtgaebe commented Jun 29, 2023

Description

With this PR a utilities.py module is added to the code. In utilities.py there are several functions commonly used in WEC analysis, but that are not required for the optimization problem itself.

Type of PR

  • Bug fix
  • New feature
  • Documentation
  • Other: (specify)

Checklist for PR

Additional details

Utility functions so far include:

  • Calculating the natural frequency for DoFs with natural restoring force based on the hydrodynamic_impedance (intrinsic impedance
  • Plotting the BEM results based on all available DoFs in bem_data
  • Plotting the Bode graph of all the DoFs in the hydrodynamic_impedance

@dtgaebe
Copy link
Collaborator Author

dtgaebe commented Jun 29, 2023

TODO:
Update the tutorials and use the new utility functions where appropriate

@dtgaebe dtgaebe changed the title Utilities module Draft: Utilities module Jun 29, 2023
@coveralls
Copy link

coveralls commented Jun 29, 2023

Pull Request Test Coverage Report for Build 8861591992

Details

  • 230 of 232 (99.14%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 94.527%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tests/test_utilities.py 103 105 98.1%
Totals Coverage Status
Change from base Build 8529707928: 0.5%
Covered Lines: 2729
Relevant Lines: 2887

💛 - Coveralls

@dtgaebe
Copy link
Collaborator Author

dtgaebe commented Jul 6, 2023

Other utils funcitons

  • function for reading or running bem - read if freqs and mesh is identical, else run bem

@cmichelenstrofer
Copy link
Member

Other functions to consider for the utilities module in future PR:

  • Thévenin equivalent system:
    • linear solution
    • natural frequency of full Thévenin equivalent system
  • Plots: Smith plots?

@cmichelenstrofer
Copy link
Member

The code used to have several other functions that were eliminated, but that makes sense to bring back into this utilities submodule. E.g. #89: power limit, optimal velocity (linear theory),

@ryancoe
Copy link
Collaborator

ryancoe commented Nov 30, 2023

@dtgaebe - Per discussion today,

@dtgaebe dtgaebe marked this pull request as ready for review December 12, 2023 22:09
@dtgaebe
Copy link
Collaborator Author

dtgaebe commented Dec 12, 2023

The current version of this PR has 4 new utility functions and tests for them

  1. plot_hydrodynamic_coefficients
  2. plot_bode_impedance
  3. calculate_power_flows
  4. plot_power_flow

@dtgaebe dtgaebe mentioned this pull request Apr 27, 2024
12 tasks
@michaelcdevin
Copy link
Collaborator

@dtgaebe: just to confirm, can we close this PR without merging since #343 has now been merged in its place?

@dtgaebe
Copy link
Collaborator Author

dtgaebe commented May 9, 2024

@michaelcdevin , Yes. I'll close it

@dtgaebe dtgaebe closed this May 9, 2024
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.

5 participants