comments added, variables renamed and unused rm
This commit adds more comments in `MuscleTorques` class in
`external_forces.py` file. Also with this commit we are not initializing
the variable `torque` because it is unnecessary. Moreover with this
commit `ramp_up_time` and `with_spline` are renamed.
@@ -192,10 +192,12 @@ class AnistropicFrictionalPlane(NoForces, InteractionPlane):
tangent_perpendicular_to_normal_direction,
tangent_perpendicular_to_normal_direction,
)
+ # Normalize tangent_perpendicular_to_normal_direction. This is axial direction for plane. Here we are adding
+ # small tolerance (1e-10) for normalization, in order to prevent division by 0.
axial_direction = np.einsum(
"ij, j-> ij",
tangent_perpendicular_to_normal_direction,
- 1 / tangent_perpendicular_to_normal_direction_mag,
+ 1 / (tangent_perpendicular_to_normal_direction_mag + 1e-10),
)
element_velocity = 0.5 * (
system.velocity_collection[..., :-1] + system.velocity_collection[..., 1:]
