Webnucleo.org

Mail Lists | Developers
small logo

Documentation from the file



newton/0.4/idl/stepfunc.pro



Routine
Name: stepfunc.pro

Description: 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: hnew is an IDL double. hnew is the new time step to be used for the next itteration.

Example: This example demonstrates the basic syntax of the stepfunc function.

          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
               

-top-




Valid XHTML 1.1        Copyright © 2001-2012, Clemson University. All rights reserved.        Valid CSS!
Page last modified on 2007/07/06 10:20