#NEWLINE# def get_motion_params( frame , **kwargs ) : #NEWLINE# #INDENT# "\n    Returns the three motion parameters - (acceleration, velocity, and\n    position) as vectorial functions of time in the given frame.\n\n    If a higher order differential function is provided, the lower order\n    functions are used as boundary conditions. For example, given the\n    acceleration, the velocity and position parameters are taken as\n    boundary conditions.\n\n    The values of time at which the boundary conditions are specified\n    are taken from timevalue1(for position boundary condition) and\n    timevalue2(for velocity boundary condition).\n\n    If any of the boundary conditions are not provided, they are taken\n    to be zero by default (zero vectors, in case of vectorial inputs). If\n    the boundary conditions are also functions of time, they are converted\n    to constants by substituting the time values in the dynamicsymbols._t\n    time Symbol.\n\n    This function can also be used for calculating rotational motion\n    parameters. Have a look at the Parameters and Examples for more clarity.\n\n    Parameters\n    ==========\n\n    frame : ReferenceFrame\n        The frame to express the motion parameters in\n\n    acceleration : Vector\n        Acceleration of the object/frame as a function of time\n\n    velocity : Vector\n        Velocity as function of time or as boundary condition\n        of velocity at time = timevalue1\n\n    position : Vector\n        Velocity as function of time or as boundary condition\n        of velocity at time = timevalue1\n\n    timevalue1 : sympyfiable\n        Value of time for position boundary condition\n\n    timevalue2 : sympyfiable\n        Value of time for velocity boundary condition\n\n    Examples\n    ========\n\n    >>> from sympy.physics.vector import ReferenceFrame, get_motion_params, dynamicsymbols\n    >>> from sympy import symbols\n    >>> R = ReferenceFrame('R')\n    >>> v1, v2, v3 = dynamicsymbols('v1 v2 v3')\n    >>> v = v1*R.x + v2*R.y + v3*R.z\n    >>> get_motion_params(R, position = v)\n    (v1''*R.x + v2''*R.y + v3''*R.z, v1'*R.x + v2'*R.y + v3'*R.z, v1*R.x + v2*R.y + v3*R.z)\n    >>> a, b, c = symbols('a b c')\n    >>> v = a*R.x + b*R.y + c*R.z\n    >>> get_motion_params(R, velocity = v)\n    (0, a*R.x + b*R.y + c*R.z, a*t*R.x + b*t*R.y + c*t*R.z)\n    >>> parameters = get_motion_params(R, acceleration = v)\n    >>> parameters[1]\n    a*t*R.x + b*t*R.y + c*t*R.z\n    >>> parameters[2]\n    a*t**2/2*R.x + b*t**2/2*R.y + c*t**2/2*R.z\n\n    " #NEWLINE# def _process_vector_differential( vectdiff , condition , variable , ordinate , frame ) : #NEWLINE# #INDENT# '\n        Helper function for get_motion methods. Finds derivative of vectdiff wrt\n        variable, and its integral using the specified boundary condition at\n        value of variable = ordinate.\n        Returns a tuple of - (derivative, function and integral) wrt vectdiff\n\n        ' #NEWLINE# if ( condition != 0 ) : #NEWLINE# #INDENT# condition = express ( condition , frame , variables = True ) #NEWLINE# #UNINDENT# if ( vectdiff == Vector ( 0 ) ) : #NEWLINE# #INDENT# return ( 0 , 0 , condition ) #NEWLINE# #UNINDENT# vectdiff1 = express ( vectdiff , frame ) #NEWLINE# vectdiff2 = time_derivative ( vectdiff , frame ) #NEWLINE# vectdiff0 = Vector ( 0 ) #NEWLINE# lims = ( variable , ordinate , variable ) #NEWLINE# for dim in frame : #NEWLINE# #INDENT# function1 = vectdiff1 . dot ( dim ) #NEWLINE# abscissa = dim . dot ( condition ) . subs ( { #NEWLINE# #INDENT# variable : ordinate , #NEWLINE# #UNINDENT# } ) #NEWLINE# vectdiff0 += ( ( integrate ( function1 , lims ) + abscissa ) * dim ) #NEWLINE# #UNINDENT# return ( vectdiff2 , vectdiff , vectdiff0 ) #NEWLINE# #UNINDENT# _check_frame ( frame ) #NEWLINE# if ( 'acceleration' in kwargs ) : #NEWLINE# #INDENT# mode = 2 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'velocity' in kwargs ) : #NEWLINE# #INDENT# mode = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mode = 0 #NEWLINE# #UNINDENT# #UNINDENT# conditions = [ 'acceleration' , 'velocity' , 'position' , 'timevalue' , 'timevalue1' , 'timevalue2' ] #NEWLINE# for ( i , x ) in enumerate ( conditions ) : #NEWLINE# #INDENT# if ( x not in kwargs ) : #NEWLINE# #INDENT# if ( i < 3 ) : #NEWLINE# #INDENT# kwargs [ x ] = Vector ( 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kwargs [ x ] = S ( 0 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( i < 3 ) : #NEWLINE# #INDENT# _check_vector ( kwargs [ x ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kwargs [ _process_vector_differential ] = sympify ( kwargs [ x ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( mode == 2 ) : #NEWLINE# #INDENT# vel = _process_vector_differential ( kwargs [ 'acceleration' ] , kwargs [ 'velocity' ] , dynamicsymbols . _t , kwargs [ 'timevalue2' ] , frame ) [ 2 ] #NEWLINE# pos = _process_vector_differential ( vel , kwargs [ 'position' ] , dynamicsymbols . _t , kwargs [ 'timevalue1' ] , frame ) [ 2 ] #NEWLINE# return ( kwargs [ 'acceleration' ] , vel , pos ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( mode == 1 ) : #NEWLINE# #INDENT# return _process_vector_differential ( kwargs [ 'velocity' ] , kwargs [ 'position' ] , dynamicsymbols . _t , kwargs [ 'timevalue1' ] , frame ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# vel = time_derivative ( kwargs [ 'position' ] , frame ) #NEWLINE# acc = time_derivative ( vel , frame ) #NEWLINE# return ( acc , vel , kwargs [ 'position' ] )