In our calculation of the cross moment Iyz for generic sections, we raise a RuntimeError if the two ways of calculating the moment does not result in values that are close enough. In the current version we check only the absolute value of these results, but this is too strict if the section has a value of the cross moment significantly different from zero.
This is an attempt to liberalize the check by introducing a relative check in addition by using the math.isclose function. The absolute tolerance used in isclose is rather liberal, but the value is kept equal to the existing implementation.
Although beyond the scope of the PR, I have also changed math.sin and math.cos to the numpy versions of the functions to have a cleaner import block.
In our calculation of the cross moment Iyz for generic sections, we raise a
RuntimeError
if the two ways of calculating the moment does not result in values that are close enough. In the current version we check only the absolute value of these results, but this is too strict if the section has a value of the cross moment significantly different from zero.This is an attempt to liberalize the check by introducing a relative check in addition by using the
math.isclose
function. The absolute tolerance used inisclose
is rather liberal, but the value is kept equal to the existing implementation.Although beyond the scope of the PR, I have also changed
math.sin
andmath.cos
to thenumpy
versions of the functions to have a cleaner import block.