Skip to content

Commit

Permalink
fix frictional inelastic no-slip case
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-mcblane committed Jan 3, 2025
1 parent 95571ff commit 522d4c6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ def _resolve_ball_ball(rvw1, rvw2, R, u_b, e_b):
# then slip condition is invalid so we need to calculate no-slip condition
if not has_relative_velocity or np.dot(v12_c, v12_c_slip) <= 0: # type: ignore
# velocity tangent component for no-slip condition
D_v1_t = -(1.0 / 9.0) * (
2.0 * (rvw1[1] - rvw2[1])
+ R * ptmath.cross(2.0 * rvw1[2] + 7.0 * rvw2[2], unit_x)
D_v1_t = -(1.0 / 7.0) * (

Check warning on line 68 in pooltool/physics/resolve/ball_ball/frictional_inelastic/__init__.py

View check run for this annotation

Codecov / codecov/patch

pooltool/physics/resolve/ball_ball/frictional_inelastic/__init__.py#L68

Added line #L68 was not covered by tests
rvw1[1] - rvw2[1] + R * ptmath.cross(rvw1[2] + rvw2[2], unit_x)
)
D_w1 = (5.0 / 9.0) * (
rvw2[2] - rvw1[2] + ptmath.cross(unit_x, rvw2[1] - rvw1[1]) / R
D_w1 = -(5.0 / 14.0) * (

Check warning on line 71 in pooltool/physics/resolve/ball_ball/frictional_inelastic/__init__.py

View check run for this annotation

Codecov / codecov/patch

pooltool/physics/resolve/ball_ball/frictional_inelastic/__init__.py#L71

Added line #L71 was not covered by tests
ptmath.cross(unit_x, rvw1[1] - rvw2[1]) / R + rvw1[2] + rvw2[2]
)
rvw1_f[1] = rvw1[1] + D_v1_t
rvw1_f[2] = rvw1[2] + D_w1
Expand Down

0 comments on commit 522d4c6

Please sign in to comment.