#NEWLINE# def test_multi_mass_spring_damper_double( ) : #NEWLINE# #INDENT# ( m0 , m1 , c0 , c1 , k0 , k1 , g ) = sm . symbols ( 'm0, m1, c0, c1, k0, k1, g' ) #NEWLINE# ( x0 , x1 , v0 , v1 , f0 , f1 ) = me . dynamicsymbols ( 'x0, x1, v0, v1, f0, f1' ) #NEWLINE# sys = multi_mass_spring_damper ( 2 , True , True ) #NEWLINE# assert ( sys . constants_symbols == { c1 , m1 , k0 , c0 , k1 , g , m0 } ) #NEWLINE# assert ( sys . specifieds_symbols == { f0 , f1 } ) #NEWLINE# assert ( sys . coordinates == [ x0 , x1 ] ) #NEWLINE# assert ( sys . speeds == [ v0 , v1 ] ) #NEWLINE# assert ( sys . states == [ x0 , x1 , v0 , v1 ] ) #NEWLINE# expected_mass_matrix_full = sm . Matrix ( [ [ 1 , 0 , 0 , 0 ] , [ 0 , 1 , 0 , 0 ] , [ 0 , 0 , ( m0 + m1 ) , m1 ] , [ 0 , 0 , m1 , m1 ] ] ) #NEWLINE# expected_forcing_full = sm . Matrix ( [ [ v0 ] , [ v1 ] , [ ( ( ( ( ( ( ( - c0 ) * v0 ) + ( g * m0 ) ) + ( g * m1 ) ) - ( k0 * x0 ) ) + f0 ) + f1 ) ] , [ ( ( ( ( ( - c1 ) * v1 ) + ( g * m1 ) ) - ( k1 * x1 ) ) + f1 ) ] ] ) #NEWLINE# assert ( sm . simplify ( ( sys . eom_method . mass_matrix_full - expected_mass_matrix_full ) ) == sm . zeros ( 4 , 4 ) ) #NEWLINE# assert ( sm . simplify ( ( sys . eom_method . forcing_full - expected_forcing_full ) ) == sm . zeros ( 4 , 1 ) )