STEP

STEP approximates a step function with a cubic polynomial.

Use

Called By

Any user-written subroutine

Prerequisite

None

Calling Sequence

CALL STEP (x, x0, h0, x1, h1, iord, value, errflg)

Input Arguments

 
x
A double-precision variable that specifies the independent variable.
x0
A double-precision variable that specifies the x value at which the step function begins.
h0
A double-precision variable that specifies the value of the function before the step.
x1
A double-precision variable that specifies the x value at which the step function ends.
h1
A double-precision variable that specifies the value of the function after the step.
iord
An integer variable that defines the order of the derivative that STEP is to return. The order is usually zero, but it can be one or two.

Output Arguments

 
errflg
A logical (true or false) variable that STEP returns to the calling subroutine. If STEP detects an error in the subroutine call statement, it sets errflg to true before it returns errflg to the calling subroutine.
value
A double-precision value the subroutine returns. The value returned depends on IORD as follows:

Extended Definition

Figure 1 below demonstrates the step function. For a comparison of STEP and STEP5, and the first derivatives of STEP and STEP5, see:
STEP (C++ or FORTRAN) function
STEP5 (C++ or FORTRAN) function
Figure 1. Step Function
The value x is the independent variable, x0 and x1 define the variable values at which the step begins and ends, h0 and h1 are the initial value and the final value of the step. The equation that defines STEP follows.
For an example of a SENSUB evaluation subroutine that calls STEP, see SENSUB.
 
Caution:  
The value x1 must not equal x0. Equal values of x1 and x0 imply a discontinuous step, which STEP cannot fit.