STEP5

STEP5 approximates a step function with a quintic polynomial.

Use

Called By

Any user-written subroutine

Prerequisite

None

Calling Sequence

CALL STEP5 (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 STEP5 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 STEP5 returns to the calling subroutine. If STEP5 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 STEP5 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. STEP5 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 and values of the step. The equation defining the STEP5 function is:
The STEP5 subroutine calling sequence is identical to the STEP subroutine. For an example of a SENSUB evaluation subroutine that calls STEP5, see SENSUB.
 
Caution:  
The value x1 must not equal x0. Equal values of x1 and x0 imply a discontinuous step, which STEP5 cannot fit.