@@ -707,7 +707,8 @@ def mode_expansion_from_model(Psi, omega, M, K, measured):
707
707
708
708
Notes
709
709
-----
710
- .. seealso:: incomplete multi-mode update
710
+ .. seealso:: incomplete multi-mode update. Would require each at a
711
+ different frequency.
711
712
712
713
"""
713
714
measured = measured .reshape (- 1 ) # retained dofs
@@ -913,13 +914,32 @@ def real_modes(Psi, autorotate = True):
913
914
Psi : float array
914
915
Real modes
915
916
917
+ Examples
918
+ --------
919
+ >>> import vibrationtesting as vt
920
+ >>> M = np.array([[4, 0, 0],
921
+ ... [0, 4, 0],
922
+ ... [0, 0, 4]])
923
+ >>> Cso = np.array([[.1,0,0],
924
+ ... [0,0,0],
925
+ ... [0,0,0]])
926
+ >>> K = np.array([[8, -4, 0],
927
+ ... [-4, 8, -4],
928
+ ... [0, -4, 4]])
929
+ >>> Bt = np.array([[1],[0],[0]])
930
+ >>> Ca = np.array([[1,0,0]])
931
+ >>> Cd = Cv = np.zeros_like(Ca)
932
+ >>> A, B, C, D = vt.so2ss(M, Cso, K, Bt, Cd, Cv, Ca)
933
+ >>> Am, Bm, Cm, Dm, eigenvalues, modes = vt.ss_modal(A, B, C, D)
934
+ >>> Psi = vt.real_modes(modes[:,0::2])
935
+
916
936
Notes
917
937
-----
918
938
.. note:: Rotation of modes should be performed to get them as close to real
919
939
as possible first.
920
940
.. warnings:: Current autorotate bases the rotation on de-rotating the first
921
941
element of each vector. User can use their own pre-process by doing to
922
- and setting `autorotate` to False
942
+ and setting `autorotate` to False.
923
943
924
944
"""
925
945
if autorotate is True :
@@ -977,8 +997,8 @@ def ss_modal(A, B = None, C = None, D = None):
977
997
>>> print(Cm)
978
998
[[ 0.0241-0.9307j 0.0241+0.9307j 0.0039-0.717j 0.0039+0.717j
979
999
0.0594-0.0001j 0.0594+0.0001j]]
980
- """
981
1000
1001
+ """
982
1002
if B is None :
983
1003
B = np .zeros_like (A )
984
1004
@@ -989,6 +1009,11 @@ def ss_modal(A, B = None, C = None, D = None):
989
1009
D = np .zeros_like (A )
990
1010
991
1011
eigenvalues , vectors = la .eig (A )
1012
+
1013
+ idxp = abs (eigenvalues ).argsort ()
1014
+ eigenvalues = eigenvalues [idxp ]
1015
+ vectors = vectors [:, idxp ]
1016
+
992
1017
A_modal = la .solve (vectors ,A )@vectors
993
1018
B_modal = la .solve (vectors ,B )
994
1019
C_modal = C @vectors
0 commit comments