You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def Spk(self):
"""
Calculates Spk.
Returns
-------
float
"""
# For now we are using the closest value in the array to ylower
# This way, we are losing or gaining a bit of area. In the future we might use some
# additional interpolation. For now this is sufficient.
# Area enclosed above yupper between y-axis (at x=0) and abbott-firestone curve
idx = argclosest(self._yupper, self._height)
A1 = np.abs(trapezoid(self._material_ratio[:idx], x=self._height[:idx]))
Spk = 2 * A1 / self.Smr1()
return Spk
def Svk(self):
"""
Calculates Svk.
Returns
-------
float
"""
# Area enclosed below ylower between y-axis (at x=100) and abbott-firestone curve
idx = argclosest(self._ylower, self._height)
A2 = np.abs(trapezoid(100 - self._material_ratio[idx:], x=self._height[idx:]))
Svk = 2 * A2 / (100 - self.Smr2())
return Svk
Hello.
I think the 2 functions need to be modified as below. Please review if what I think is correct.
This is a common warning regarding division.(RuntimeWarning: invalid value encountered in scalar divide)
Spk Function
When the Smr1() value comes out to zero in the Spk function, warring occurs in the Spk calculation.
Theoretically, if Smr1 is 0%, I know that Spk height is also 0.
Therefore, when Smr1 is zero, i propose that the value of the Spk function is also zero.
Svk Function
For the same reason as above, the Svk function generates a division warning when the Smr2() value is 100%.
If Smr2() value is 100%, treat Svk as an exception with 0.
The text was updated successfully, but these errors were encountered:
singhyun90
changed the title
Inquiries about possible modification of SVk and Spk functions.
Inquiries about possible modification of Svk and Spk functions.
Dec 20, 2024
Hi, your reasoning makes sense as far as I can tell. However, I'm wondering which edge case you are looking at to get Smr1 of 0% and Smr2 of 100%. The only surfaces I can think of right now for which that would be the case are either a completely flat surface, a completely flat but inclined surface or a random uniform distribution.
I just checked these and for these edgecases the values seem to be a little bit wrong, e.g. and Smr1 of 0.5 for the inclined flat surface, where it should be 0.
At some point I will try to fix that but the it's not high priority since it make not much sense to calculate functional parameters for these kind of surfaces anyways. I can still implement your fix though, but it's not going to fix the fundamental problems with the current implementation for edgecases.
Hello.
I think the 2 functions need to be modified as below. Please review if what I think is correct.
This is a common warning regarding division.(RuntimeWarning: invalid value encountered in scalar divide)
Spk Function
When the Smr1() value comes out to zero in the Spk function, warring occurs in the Spk calculation.
Theoretically, if Smr1 is 0%, I know that Spk height is also 0.
Therefore, when Smr1 is zero, i propose that the value of the Spk function is also zero.
Svk Function
For the same reason as above, the Svk function generates a division warning when the Smr2() value is 100%.
If Smr2() value is 100%, treat Svk as an exception with 0.
The text was updated successfully, but these errors were encountered: