-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Tortilla #7201
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
Tortilla #7201
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
V = sqrt(2 * gravity * Δy) | ||
|
||
Source: | ||
- https://en.wikipedia.org/wiki/Archimedes%27_principle |
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.
- https://en.wikipedia.org/wiki/Archimedes%27_principle | |
- https://en.wikipedia.org/wiki/Torricelli%27s_law |
Calculates velocity of fluid from Potential Gravitational Energy | ||
|
||
Equation for finding velocity | ||
V = sqrt(2 * gravity * Δy) |
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.
V = sqrt(2 * gravity * Δy) | |
Velocity = sqrt(2 * Acceleration due to gravity * Height) |
Args: | ||
height: The change in height between initial and point of flow (where, | ||
velocity is being measured) | ||
gravity: Acceleration from gravity. Gravitational force on system, |
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.
gravity: Acceleration from gravity. Gravitational force on system, | |
gravity: Acceleration due to gravity. Gravitational force on system, |
""" | ||
Args: | ||
height: The change in height between initial and point of flow (where, | ||
velocity is being measured) |
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.
Please mention the unit of height used.
7.6681158050723255 | ||
""" | ||
if gravity <= 0: | ||
raise ValueError("Impossible Gravity") |
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.
raise ValueError("Impossible Gravity") | |
raise ValueError("The value of g cannot be equal or smaller than 0.") |
returns: | ||
buoyant force on object in Newtons | ||
|
||
>>> archimedes_principle(fluid_density=997, volume=0.5, gravity=9.8) |
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.
If the default value of g is 9.8, you can add a new test case for value of g different than 9.8; otherwise, it seems redundant.
""" | ||
|
||
if fluid_density <= 0: | ||
raise ValueError("Impossible fluid density") |
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.
raise ValueError("Impossible fluid density") | |
raise ValueError("Fluid density cannot be equal or smaller than 0.") |
raise ValueError("Impossible Object volume") | ||
if gravity <= 0: | ||
raise ValueError("Impossible Gravity") |
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.
raise ValueError("Impossible Object volume") | |
if gravity <= 0: | |
raise ValueError("Impossible Gravity") | |
raise ValueError("Object volume cannot smaller than 0") | |
if gravity <= 0: | |
raise ValueError("Acceleration due to gravity cannot be equal or smaller than 0.") |
@DIvkov575 make one PR per algorithm. You have duplications present in #7143 and #7200 |
Hacktoberfest is strenuous for our team of active volunteer maintainers. That small team now has 200+ open pull requests to review. We have high standards for our submissions which are described in For these reasons, I will close all open pull requests failing tests so that our unpaid team has a smaller mountain to climb. If you want us to land your pull request, please read |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.