GNU Scientific Library – Reference Manual: Driver

Next: ODE Example programs, Previous: Evolution, Up: Ordinary Differential Equations [Index]

### 27.5 Driver

The driver object is a high level wrapper that combines the evolution, control and stepper objects for easy use.

Function: gsl_odeiv2_driver * gsl_odeiv2_driver_alloc_y_new (const gsl_odeiv2_system * sys, const gsl_odeiv2_step_type * T, const double hstart, const double epsabs, const double epsrel)
Function: gsl_odeiv2_driver * gsl_odeiv2_driver_alloc_yp_new (const gsl_odeiv2_system * sys, const gsl_odeiv2_step_type * T, const double hstart, const double epsabs, const double epsrel)
Function: gsl_odeiv2_driver * gsl_odeiv2_driver_alloc_standard_new (const gsl_odeiv2_system * sys, const gsl_odeiv2_step_type * T, const double hstart, const double epsabs, const double epsrel, const double a_y, const double a_dydt)
Function: gsl_odeiv2_driver * gsl_odeiv2_driver_alloc_scaled_new (const gsl_odeiv2_system * sys, const gsl_odeiv2_step_type * T, const double hstart, const double epsabs, const double epsrel, const double a_y, const double a_dydt, const double scale_abs[])

  These functions return a pointer to a newly allocated instance of a driver object. The functions automatically allocate and initialise the evolve, control and stepper objects for ODE system sys using stepper type T. The initial step size is given in hstart. The rest of the arguments follow the syntax and semantics of the control functions with same name (`gsl_odeiv2_control_*_new`).

Function: int gsl_odeiv2_driver_set_hmin (gsl_odeiv2_driver * d, const double hmin)

  The function sets a minimum for allowed step size hmin for driver d. Default value is 0.

Function: int gsl_odeiv2_driver_set_hmax (gsl_odeiv2_driver * d, const double hmax)

  The function sets a maximum for allowed step size hmax for driver d. Default value is `GSL_DBL_MAX`.

Function: int gsl_odeiv2_driver_set_nmax (gsl_odeiv2_driver * d, const unsigned long int nmax)

  The function sets a maximum for allowed number of steps nmax for driver d. Default value of 0 sets no limit for steps.

Function: int gsl_odeiv2_driver_apply (gsl_odeiv2_driver * d, double * t, const double t1, double y[])

  This function evolves the driver system d from t to t1. Initially vector y should contain the values of dependent variables at point t. If the function is unable to complete the calculation, an error code from `gsl_odeiv2_evolve_apply` is returned, and t and y contain the values from last successful step.

  If maximum number of steps is reached, a value of `GSL_EMAXITER` is returned. If the step size drops below minimum value, the function returns with `GSL_ENOPROG`. If the user-supplied functions defined in the system sys returns `GSL_EBADFUNC`, the function returns immediately with the same return code. In this case the user must call `gsl_odeiv2_driver_reset` before calling this function again.

Function: int gsl_odeiv2_driver_apply_fixed_step (gsl_odeiv2_driver * d, double * t, const double h, const unsigned long int n, double y[])

  This function evolves the driver system d from t with n steps of size h. If the function is unable to complete the calculation, an error code from `gsl_odeiv2_evolve_apply_fixed_step` is returned, and t and y contain the values from last successful step.

Function: int gsl_odeiv2_driver_reset (gsl_odeiv2_driver * d)

  This function resets the evolution and stepper objects.

Function: int gsl_odeiv2_driver_reset_hstart (gsl_odeiv2_driver * d, const double hstart)

  The routine resets the evolution and stepper objects and sets new initial step size to hstart. This function can be used e.g. to change the direction of integration.

Function: int gsl_odeiv2_driver_free (gsl_odeiv2_driver * d)

  This function frees the driver object, and the related evolution, stepper and control objects.

Next: ODE Example programs, Previous: Evolution, Up: Ordinary Differential Equations [Index]