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

slider(golf) Golf Simulation slider(golf)

NAME

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

DESCRIPTION

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.

SUPERCLASS

object

INSTANCE VARIABLES

position is the position vector of the body.

direction is the direction of the initial speed vector. It is two dimensional vector in xy plane.

surface is the name of the golf green object.

speed is the speed of the body (absolute value, not the vector).

friction is the coefficient of friction.

state is the six dimensional vector of the system state: three dimensions for position and three dimensions for velocity vector.

surface_get_normal is the connection for "normal?" message of golf green object. It is a private variable.

surface_get_z is the connection for "z?" message of golf green object. It is a private variable.

surface_set_xy is the connection for "xy=" message of golf green object. It is a private variable.

init_speed is the value of initial speed of the body.

MESSAGES

direction=argument sets the value of velocity direction value, two dimensional vector.

direction? returns the value of direction.

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

friction? returns the value of the instance variable friction.

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

init_speed? returns the value of the instance variable init_speed.

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

position? returns the value of the instance variable position.

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

speed? returns the value of the instance variable speed.

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

state? returns the value of the instance variable state.

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

surface? returns the value of the instance variable surface.

value? returns the value of the right side of the equation, d(state)/dt.

EXAMPLE

scalar new: s1 = 45; -- angle in degrees golf_green new: agreen green_file= mohawk4 prefix= mohawk4 flip = -1 elevations! normals! ; slider new: slider1 surface = agreen

friction= .16 ; rkqc_solver new: solver1 function= slider1 eps = .01 min_step = .00001 speed_guard = .2 data_capacity = 300 data_min_step = .001 guess_step = .01 ; slider1 speed= 10 init_speed = 10 direction= ([s1 = angle cos?],[s1 = angle sin?]) position = (40,30,1.9) ; solver1 start= 0 end= 3 solve! data: ball_data ;

SEE ALSO

rkqc_solver, golf_green


Please send comments and suggestions to
consult@rpi.edu