#NEWLINE# def test_root_derivs_array( self ) : #NEWLINE# #INDENT# prob = Problem ( ) #NEWLINE# prob . root = SellarDerivativesGrouped ( ) #NEWLINE# prob . driver = ScipyOptimizer ( ) #NEWLINE# prob . driver . options [ 'optimizer' ] = 'SLSQP' #NEWLINE# prob . driver . options [ 'tol' ] = 1e-08 #NEWLINE# prob . driver . options [ 'disp' ] = False #NEWLINE# prob . driver . add_desvar ( 'z' , lower = np . array ( [ ( - 10.0 ) , 0.0 ] ) , upper = np . array ( [ 10.0 , 10.0 ] ) ) #NEWLINE# prob . driver . add_desvar ( 'x' , lower = 0.0 , upper = 10.0 ) #NEWLINE# prob . driver . add_objective ( 'obj' ) #NEWLINE# prob . driver . add_constraint ( 'con1' , upper = 0.0 ) #NEWLINE# prob . driver . add_constraint ( 'con2' , upper = 0.0 ) #NEWLINE# prob . driver . add_recorder ( self . recorder ) #NEWLINE# self . recorder . options [ 'record_metadata' ] = False #NEWLINE# self . recorder . options [ 'record_derivs' ] = True #NEWLINE# prob . setup ( check = False ) #NEWLINE# prob . run ( ) #NEWLINE# prob . cleanup ( ) #NEWLINE# J1 = self . recorder . deriv_iters [ 0 ] [ 'Derivatives' ] #NEWLINE# assert_rel_error ( self , J1 [ 0 ] [ 0 ] , 9.61001155 , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 0 ] [ 1 ] , 1.78448534 , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 0 ] [ 2 ] , 2.98061392 , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 1 ] [ 0 ] , ( - 9.61002285 ) , 1e-05 ) #NEWLINE# assert_rel_error ( J1 , J1 [ 1 ] [ 1 ] , ( - 0.78449158 ) , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 1 ] [ 2 ] , ( - 0.98061433 ) , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 2 ] [ 0 ] , 1.94989079 , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 2 ] [ 1 ] , 1.0775421 , 1e-05 ) #NEWLINE# assert_rel_error ( self , J1 [ 2 ] [ 2 ] , 0.09692762 , 1e-05 )