#NEWLINE# def test_backward_diff( self ) : #NEWLINE# #INDENT# ac = np . eye ( 2 ) #NEWLINE# bc = ( 0.5 * np . ones ( ( 2 , 1 ) ) ) #NEWLINE# cc = np . array ( [ [ 0.75 , 1.0 ] , [ 1.0 , 1.0 ] , [ 1.0 , 0.25 ] ] ) #NEWLINE# dc = np . array ( [ [ 0.0 ] , [ 0.0 ] , [ ( - 0.33 ) ] ] ) #NEWLINE# dt_requested = 0.5 #NEWLINE# ad_truth = ( 2.0 * np . eye ( 2 ) ) #NEWLINE# bd_truth = ( 0.5 * np . ones ( ( 2 , 1 ) ) ) #NEWLINE# cd_truth = np . array ( [ [ 1.5 , 2.0 ] , [ 2.0 , 2.0 ] , [ 2.0 , 0.5 ] ] ) #NEWLINE# dd_truth = np . array ( [ [ 0.875 ] , [ 1.0 ] , [ 0.295 ] ] ) #NEWLINE# ( ad , bd , cd , dd , dt ) = c2d ( ( ac , bc , cc , dc ) , dt_requested , method = 'backward_diff' ) #NEWLINE# assert_array_almost_equal ( ad_truth , ad ) #NEWLINE# assert_array_almost_equal ( bd_truth , bd ) #NEWLINE# assert_array_almost_equal ( cd_truth , cd ) #NEWLINE# assert_array_almost_equal ( bd_truth , dd )