#NEWLINE# def test_variable_limits( self ) : #NEWLINE# #INDENT# scale = 0.1 #NEWLINE# def func2( x0 , x1 , x2 , x3 , t0 , t1 ) : #NEWLINE# #INDENT# val = ( ( ( ( ( x0 * x1 ) * ( x3 ** 2 ) ) + np . sin ( x2 ) ) + 1 ) + ( 1 if ( ( ( x0 + ( t1 * x1 ) ) - t0 ) > 0 ) else 0 ) ) #NEWLINE# return val #NEWLINE# #UNINDENT# def lim0( x1 , x2 , x3 , t0 , t1 ) : #NEWLINE# #INDENT# return [ ( ( scale * ( ( ( ( x1 ** 2 ) + x2 ) + ( ( np . cos ( x3 ) * t0 ) * t1 ) ) + 1 ) ) - 1 ) , ( ( scale * ( ( ( ( x1 ** 2 ) + x2 ) + ( ( np . cos ( x3 ) * t0 ) * t1 ) ) + 1 ) ) + 1 ) ] #NEWLINE# #UNINDENT# def lim1( x2 , x3 , t0 , t1 ) : #NEWLINE# #INDENT# return [ ( ( scale * ( ( t0 * x2 ) + ( t1 * x3 ) ) ) - 1 ) , ( ( scale * ( ( t0 * x2 ) + ( t1 * x3 ) ) ) + 1 ) ] #NEWLINE# #UNINDENT# def lim2( x3 , t0 , t1 ) : #NEWLINE# #INDENT# return [ ( ( scale * ( x3 + ( ( t0 ** 2 ) * ( t1 ** 3 ) ) ) ) - 1 ) , ( ( scale * ( x3 + ( ( t0 ** 2 ) * ( t1 ** 3 ) ) ) ) + 1 ) ] #NEWLINE# #UNINDENT# def lim3( t0 , t1 ) : #NEWLINE# #INDENT# return [ ( ( scale * ( t0 + t1 ) ) - 1 ) , ( ( scale * ( t0 + t1 ) ) + 1 ) ] #NEWLINE# #UNINDENT# def opts0( x1 , x2 , x3 , t0 , t1 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'points' : [ ( t0 - ( t1 * x1 ) ) ] , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# def opts1( x2 , x3 , t0 , t1 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# def opts2( x3 , t0 , t1 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# def opts3( t0 , t1 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# res = nquad ( func2 , [ lim0 , lim1 , lim2 , lim3 ] , args = ( 0 , 0 ) , opts = [ opts0 , opts1 , opts2 , opts3 ] ) #NEWLINE# assert_quad ( res , 25.066666666666663 )