|
|
|
@ -1094,14 +1094,14 @@ def findrfc_astm(tp):
|
|
|
|
|
sig_rfc[:,2] Cycle type, half (=0.5) or full (=1.0)
|
|
|
|
|
"""
|
|
|
|
|
return numba_misc.findrfc_astm(tp)
|
|
|
|
|
y1 = atleast_1d(tp).ravel()
|
|
|
|
|
sig_rfc, cnr = clib.findrfc3_astm(y1)
|
|
|
|
|
# the sig_rfc was constructed too big in rainflow.rf3, so
|
|
|
|
|
# reduce the sig_rfc array as done originally by a matlab mex c function
|
|
|
|
|
n = len(sig_rfc)
|
|
|
|
|
# sig_rfc = sig_rfc.__getslice__(0, n - cnr[0])
|
|
|
|
|
# sig_rfc holds the actual rainflow counted cycles, not the indices
|
|
|
|
|
return sig_rfc[:n - cnr[0]]
|
|
|
|
|
# y1 = atleast_1d(tp).ravel()
|
|
|
|
|
# sig_rfc, cnr = clib.findrfc3_astm(y1)
|
|
|
|
|
# # the sig_rfc was constructed too big in rainflow.rf3, so
|
|
|
|
|
# # reduce the sig_rfc array as done originally by a matlab mex c function
|
|
|
|
|
# n = len(sig_rfc)
|
|
|
|
|
# # sig_rfc = sig_rfc.__getslice__(0, n - cnr[0])
|
|
|
|
|
# # sig_rfc holds the actual rainflow counted cycles, not the indices
|
|
|
|
|
# return sig_rfc[:n - cnr[0]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def findrfc(tp, h=0.0, method='clib'):
|
|
|
|
@ -1404,18 +1404,20 @@ def mctp2tc(f_Mm, utc, param, f_mM=None):
|
|
|
|
|
if dim_m == 1:
|
|
|
|
|
tempm[0, 0] = (Bm / (1 - Am * Bm) * em)
|
|
|
|
|
else:
|
|
|
|
|
tempm = np.dot(Bm,
|
|
|
|
|
linalg.lstsq(Im-np.dot(Am, Bm), em)[0])
|
|
|
|
|
rh = Im - np.dot(Am, Bm)
|
|
|
|
|
tempm = np.dot(Bm, linalg.lstsq(rh, em)[0])
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
if (j > ntc) and (i < ntc):
|
|
|
|
|
a = np.dot(np.dot(tempp.T, f_mM[i:ntc-1, n-ntc:-1:n-j+1]),
|
|
|
|
|
a = np.dot(np.dot(tempp.T,
|
|
|
|
|
f_mM[i:ntc - 1, n - ntc:-1:n - j + 1]),
|
|
|
|
|
tempm)
|
|
|
|
|
b = np.dot(np.dot(tempp.T, f_mM[i:ntc - 1, n - j:-1:1]),
|
|
|
|
|
ones((n - j, 1)))
|
|
|
|
|
c = np.dot(np.dot(ones((1, i-1)), f_mM[1:i-1, n-ntc:-1:n-j+1]),
|
|
|
|
|
c = np.dot(np.dot(ones((1, i - 1)),
|
|
|
|
|
f_mM[1:i - 1, n - ntc:-1:n - j + 1]),
|
|
|
|
|
tempm)
|
|
|
|
|
F[i, n - j + 1] = F[i, n - j + 1] + a + b + c
|
|
|
|
|
# end
|
|
|
|
@ -1428,7 +1430,8 @@ def mctp2tc(f_Mm, utc, param, f_mM=None):
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
if (j > ntc) and (i == ntc):
|
|
|
|
|
c = np.dot(np.dot(ones((1, i-1)), f_mM[1:i-1, n-ntc:-1:n-j+1]),
|
|
|
|
|
c = np.dot(np.dot(ones((1, i - 1)),
|
|
|
|
|
f_mM[1:i - 1, n - ntc:-1:n - j + 1]),
|
|
|
|
|
tempm)
|
|
|
|
|
F[i, n - j + 1] = F[i, n - j + 1] + c
|
|
|
|
|
for k in range(ntc, n):
|
|
|
|
@ -3109,7 +3112,8 @@ def test_docstrings():
|
|
|
|
|
# np.set_printoptions(precision=6)
|
|
|
|
|
import doctest
|
|
|
|
|
print('Testing docstrings in %s' % __file__)
|
|
|
|
|
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)
|
|
|
|
|
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE |
|
|
|
|
|
doctest.ELLIPSIS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|