#NEWLINE# def test_init( self ) : #NEWLINE# #INDENT# sys = System ( self . kane ) #NEWLINE# assert ( sys . constants_symbols == set ( sm . symbols ( 'k0, m0, g, c0' ) ) ) #NEWLINE# assert ( sys . specifieds_symbols == { self . specified_symbol } ) #NEWLINE# assert ( sys . states == me . dynamicsymbols ( 'x0, v0' ) ) #NEWLINE# assert ( sys . evaluate_ode_function is None ) #NEWLINE# assert ( sys . eom_method is self . kane ) #NEWLINE# assert ( sys . ode_solver is odeint ) #NEWLINE# assert ( sys . specifieds == dict ( ) ) #NEWLINE# assert ( sys . initial_conditions == dict ( ) ) #NEWLINE# assert ( sys . constants == dict ( ) ) #NEWLINE# assert ( sys . times == list ( ) ) #NEWLINE# ic = { #NEWLINE# #INDENT# me . dynamicsymbols ( 'x0' ) : 3.6 , #NEWLINE# me . dynamicsymbols ( 'v0' ) : 4.3 , #NEWLINE# #UNINDENT# } #NEWLINE# sys = System ( self . kane , ode_solver = odeint , specifieds = { #NEWLINE# #INDENT# self . specified_symbol : np . ones ( 1 ) , #NEWLINE# #UNINDENT# } , initial_conditions = ic , constants = self . constant_map ) #NEWLINE# assert ( sys . eom_method is self . kane ) #NEWLINE# assert ( list ( sys . specifieds . keys ( ) ) == [ me . dynamicsymbols ( 'f0' ) ] ) #NEWLINE# testing . assert_allclose ( list ( sys . specifieds . values ( ) ) , [ np . ones ( 1 ) ] ) #NEWLINE# assert ( sys . initial_conditions . keys ( ) == ic . keys ( ) ) #NEWLINE# testing . assert_allclose ( list ( sys . initial_conditions . values ( ) ) , list ( ic . values ( ) ) ) #NEWLINE# assert ( sys . constants . keys ( ) == self . constant_map . keys ( ) ) #NEWLINE# testing . assert_allclose ( list ( sys . constants . values ( ) ) , list ( self . constant_map . values ( ) ) ) #NEWLINE# sys = System ( self . kane , ode_solver = odeint , specifieds = { #NEWLINE# #INDENT# 'symbols' : [ self . specified_symbol ] , #NEWLINE# 'values' : np . ones ( 1 ) , #NEWLINE# #UNINDENT# } , initial_conditions = ic , constants = self . constant_map )