Documentation from the file
newton/0.4/idl/stepfunc.pro
| Routine |
|---|
Name: stepfunc.proDescription: Function that propagates an array (y) consisting of n_elements(y)/2 coordinate variables and n_elements(y)/2 derivatives of these coords a single time step (h) in time. In addition, the time step h is adaptive with respect to the input parameter hint. Two arrays are supplied to stepfun.pro: y and y2. y is the array when propagated one time step of h, and y2 is two time steps of h/2. stepfunc then compares the difference in the two results and modifies the time step, h, for the next itteration. Syntax:
hnew = stepfunc( y, y2, h, hint )
Output:
h = 0.001;
hint = 0.1;
y = [1.2, 1.3, 0.3, 0.4]
y2 = [1.5, 1.1, 0.3, 0.45]
hnew= stepfunc( y, y2, h, hint )
print, 'New time step', hnew
|
|
|