#NEWLINE# def test_scalar_sequences( self ) : #NEWLINE# #INDENT# lq_scalar = self . lq_scalar #NEWLINE# x0 = 2 #NEWLINE# ( x_seq , u_seq , w_seq ) = lq_scalar . compute_sequence ( x0 ) #NEWLINE# u_0 = ( ( ( ( ( ( ( - 2 ) * lq_scalar . A ) * lq_scalar . B ) * lq_scalar . beta ) * lq_scalar . Rf ) / ( ( 2 * lq_scalar . Q ) + ( ( ( x_seq . beta * lq_scalar . Rf ) * 2 ) * ( lq_scalar . B ** 2 ) ) ) ) * x0 ) #NEWLINE# x_1 = ( ( ( lq_scalar . A * x0 ) + ( lq_scalar . B * u_0 ) ) + w_seq [ ( 0 , ( - 1 ) ) ] ) #NEWLINE# assert_allclose ( u_0 , u_seq , rtol = 0.0001 ) #NEWLINE# assert_allclose ( x_1 , x_seq [ ( 0 , ( - 1 ) ) ] , rtol = 0.0001 )