<<<<<<<<<<<<<<<<<

bv_slider(golf) Golf Simulation bv_slider(golf)

NAME

bv_slider - Object that computes the state of a body sliding on a surface.

DESCRIPTION

Bv_slider is used in Golf Simulation scripts to represent function computing the right side of the system of ordinary differential equations that governs the sliding of the body on a surface. Since it is used in conjunction with rk_shooter, it also contains some information about boundary conditions.

SUPERCLASS

slider

INSTANCE VARIABLES

init_position is the initial position of the body (three dimensional vector).

init_direction is the initial direction of the speed vector; defined as a two dimensional vector.

delta is the two dimensional vector specifying the increment in speed (delta[0]) and angle (delta[1]) for the initial values.

final_position is the final position of the body for the boundary value problem (three dimensional vector).

done is the instance variable indicating that body final position differs from final_position less than on eps.

index is the instance variable indicating initial value variation: index = 0 corresponds to speed increment; index = 1 corresponds to angle increment; index = 2 is indicator for updating the initial speed and angle base values.

score is the instance variable representing the difference between position and final_position vectors (only two first components are taken into account).

dfdv is the matrix (2x2) of partial derivatives of changes in score relative to changes in initial speed and angle.

init_angle is the instance variable specifying the initial angle.

eps is the instance variable against which norm of the score vector is compared to decide if shooting cycle is successful.

next is the instance variable indicating termination of the shooting cycle.

MESSAGES

delta=argument sets the value of two dimensional vector delta.

delta? returns the value of instance variable delta.

done? returns the value of the instance variable done.

eps=argument sets the value of the instance variable eps.

eps? returns the value of the instance variable eps.

final_position=argument sets the value of the instance variable final_position.

final_position? returns the value of the instance variable final_position.

init_angle=argument sets the value of the instance variable init_angle.

init_angle? returns the value of the instance variable init_angle.

init_direction=argument sets the value of the instance variable init_direction. User specifies the init_angle and it is converted to init_direction internally.

init_direction? returns the value of the instance variable init_direction.

init_position=argument sets the value of the instance variable init_position.

init_position? returns the value of the instance variable init_position.

score! computes the score vector. Sets index and next to 0. Sets done to 1 is norm of score is less than eps

and to 0 otherwise.

score? computes and returns score vector.

start! this method does the following: (a) sets position instance variable to init_position; (b) sets speed instance variable to init_speed; and (c) sets the direction instance variable to init_direction.

vary! this method does increment init_speed by delta[0] if index is equal to 0; it increments init_angle by delta[1] if index is equal to 1; then it sends message "start!" to itself.

EXAMPLE

/* this script requires green data file mohawk4 for golf green elevation data */ golf_green new: agreen green_file= mohawk4 prefix= mohawk4 flip = -1 elevations! normals! ; rk_shooter new: shooter1 function= bv0 start = 0 end = 30 eps = .01 min_step = .00001 speed_guard = 0.2 data_capacity = 300 data_min_step = .001 guess_step = .01 ; bv_slider new: bv0 surface = agreen eps = 0.05 delta = (.01, .01) friction = .16 init_speed = 10 init_angle = 90 init_position = (30,40,2) final_position = (50,70,3) ; shooter1 shoot!;

SEE ALSO

rk_shooter, golf_green


Please send comments and suggestions to
consult@rpi.edu