status: skipped duration: 0.012s Captured stdout call A [[ 0.00000000e+00 0.00000000e+00 6.03603475e+03 -0.00000000e+00 -2.12132034e+00 -0.00000000e+00] [ 0.00000000e+00 0.00000000e+00 -2.13162821e-14 -2.12132034e+00 -0.00000000e+00 -8.39206242e+02] [ 0.00000000e+00 0.00000000e+00 -3.14159265e+01 -0.00000000e+00 -1.50000000e+00 -0.00000000e+00] [ 0.00000000e+00 2.12132034e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 6.03603475e+03] [ 2.12132034e+00 0.00000000e+00 8.39206242e+02 0.00000000e+00 0.00000000e+00 -2.13162821e-14] [ 0.00000000e+00 1.50000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 -3.14159265e+01]] B [[-12124.02697577] [ 0. ] [ 200. ] [ -0. ] [ -5026.54824574] [ 0. ]] C [[ 0. 0. 1. -0. -0. -0.]] D [[0.]] E [[ 1. 0. 0. -0. -0. -0.] [ 0. 1. 0. -0. -0. -0.] [ 0. 0. 1. -0. -0. -0.] [ 0. 0. 0. 1. 0. 0.] [ 0. 0. 0. 0. 1. 0.] [ 0. 0. 0. 0. 0. 1.]] REDUCE captured errors: tpath = '/builds/wield-control/docs/maketests/test_results/test_SS_algorithms.py/test_ABCDE' def test_ABCDE(tpath): print() F_Hz = logspaced(0.1, 100, 1000) z, p, k = ((-1, -5), (-1 + 5j, -1 - 5j, -3), 200) z = np.asarray(z) p = np.asarray(p) A, B, C, D, E = SS.zpk2cDSS(z, p, k, mode="CCF", rescale=3j) A, B, C, D, E = SS.DSS_c2r(A, B, C, D, E) print("A", A) print("B", B) print("C", C) print("D", D) print("E", E) reduced = True while reduced: print("REDUCE") > A, B, C, D, E, reduced = SS.reduce_modal(A, B, C, D, E, mode="O") ../../src/wield/control/algorithms/statespace/dense/test/test_SS_algorithms.py:61: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../src/wield/control/algorithms/statespace/dense/ss_algorithms.py:59: in reduce_modal v_pairs = eigspaces_right_real(A, E, tol=tol) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ A = array([[ 0.00000000e+00, 0.00000000e+00, 6.03603475e+03, -0.00000000e+00, -2.12132034e+00, -0.00000000e+00],... [ 0.00000000e+00, 1.50000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, -3.14159265e+01]]) B = array([[ 1., 0., 0., -0., -0., -0.], [ 0., 1., 0., -0., -0., -0.], [ 0., 0., 1., -0., -0., -0.], [ 0., 0., 0., 1., 0., 0.], [ 0., 0., 0., 0., 1., 0.], [ 0., 0., 0., 0., 0., 1.]]) tol = 1e-07 def eigspaces_right_real(A, B=None, tol=1e-9): v_pairs = eigspaces_right(A, B=B, tol=tol) v_pairs_re = [] v_pairs_im = [] w_im = [] for eigs, evects in v_pairs: eigv = np.mean(eigs) if abs(eigv.imag) < tol: # remove the imaginary part to the eigenvectors assert np.all(np.sum(evects.imag ** 2, axis=1) < tol) v_pairs_re.append((eigs, evects.real)) continue v_pairs_im.append((eigs, evects)) w_im.append(eigv) # this finds conjugate pairs w_near = TFmath.nearest_idx(w_im) v_pairs_im2 = [] for idx_fr, idx_to in enumerate(w_near): if idx_to is None or w_near[idx_to] is None: continue if idx_fr is None or w_near[idx_fr] is None: continue if w_near[idx_to] != idx_fr: continue # unique conjugate pair w_near[idx_to] = None w_near[idx_fr] = None eigs1, eigv1 = v_pairs_im[idx_to] eigs2, eigv2 = v_pairs_im[idx_fr] if w_im[idx_to].imag > 0: eigs_use = eigs1 else: eigs_use = eigs2 v_pairs_im2.append((eigs_use, np.hstack([eigv1, eigv2]))) v_pairs_im3 = [] for eigs, evects in v_pairs_im2: # TODO, it may be the the SVD should be used here # this may rely on r being rank-revealing q, r = scipy.linalg.qr(evects.imag.T) # check that the imaginary space is actually reduced idx_cut = r.shape[0] // 2 assert np.all(np.sum(r[idx_cut:] ** 2, axis=1) < tol) # same check as above (redundant) > assert np.all(np.sum((evects.imag @ q[idx_cut:].T) ** 2, axis=1) < tol) E AssertionError ../../src/wield/control/algorithms/statespace/dense/eig_algorithms.py:106: AssertionError