HAVSIN

The HAVSIN function defines a haversine function. It is used most often to represent a smooth transition between two functions.

Format

HAVSIN (x, x0, h0, x1, h1)

Arguments

 
x
The independent variable.
x0
A real variable that specifies the x value at which the haversine function begins.
x1
A real variable that specifies the x value at which the haversine function ends.
h0
The initial value of the haversine function.
h1
The final value of the haversine function.

Extended Definition

The HAVSIN function is used most often to represent a smooth transition between two functions (see the figure below). As an example, a HAVSIN may be used to smoothly ramp up the motion in a joint from h0 to some constant value h1.
Haversine Function
The equation defining HAVSIN is:
a = (h0 + h1)/2
b = (h1 - h0)/2
c = (x - x0)/(x1 - x0)
 
Tip:  
The HAVSIN function behavior is similar to the STEP function. It has a discontinuous second derivative and therefore is not recommended for use in displacement level motions.

Examples

MOTION/1, JOINT=21, VELOCITY
, FUNCTION=HAVSIN(TIME, 1, 0, 2, 1)
This MOTION statement defines a smooth transition in velocity from time 1 to time 2. Note that the motion is specified in velocity rather than displacement.
See other General available.