FLINT 0.9.9
Fortran Library for numerical INTegration of differential equations
|
StepSize Module. More...
Functions/Subroutines | |
subroutine | stepsz0hairer (h, p, n, x0, y0, f0, sc, hsign, hmax, fcalls, pdiffeqsys, params) |
Subroutine for computing the starting step size using Hairer's algorithm. | |
real(wp) function | stepszhairer (h, islaststeprejected, q, e, stepszparams) |
Pure function for computing the new step size using Hairer's algorithm. | |
Variables | |
real(wp), parameter | sf = 0.9_WP |
Safety factor. | |
real(wp), parameter | sfmin = 0.333_WP |
Minimum safety factor, so we dont decrease the step size too fast. | |
real(wp), parameter | sfmax = 6.0_WP |
Maximum safety factor, so we dont increase the step size too fast | |
real(wp), parameter | hbyhoptold = 1.0e-4_WP |
Lund stabilization PI control term (see Hairer's code) | |
StepSize Module.
This module provides procedures for step size computation.
subroutine stepsize::stepsz0hairer | ( | real(wp), intent(out) | h, |
integer, intent(in) | p, | ||
integer, intent(in) | n, | ||
real(wp), intent(in) | x0, | ||
real(wp), dimension(n), intent(in) | y0, | ||
real(wp), dimension(n), intent(in) | f0, | ||
real(wp), dimension(n), intent(in) | sc, | ||
real(wp), intent(in) | hsign, | ||
real(wp), intent(in) | hmax, | ||
integer, intent(out) | fcalls, | ||
class(diffeqsys), intent(inout), pointer | pdiffeqsys, | ||
real(wp), dimension(:), intent(in), optional | params ) |
Subroutine for computing the starting step size using Hairer's algorithm.
For details on the algorithm, see Hairer's book "Solving ODE I" or his code dop853.f at http://www.unige.ch/~hairer/prog/nonstiff/dop853.f.
[out] | h | Computed step size |
[in] | p | Order of the method, which is used to advance the integration. For example, for Dormand-Prince 8(7) ERK method, p=8. |
[in] | n | dimension of the DiffEq system |
[in] | x0 | Initial value of the independent variable |
[in] | y0 | Initial condition |
[in] | f0 | DiffEq Function evaluated at Y0 |
[in] | sc | Error Scale factor |
[in] | hsign | Must be either +1.0 or -1.0 depending on the forward or backward integration, respectively |
[in] | hmax | Maximum allowed step size |
[out] | fcalls | Number of Calls that this routine makes to DiffEq function "F" |
[in,out] | pdiffeqsys | DiffEq system |
[in] | params | Real parameter array to be passed to DEFunc |
In Hairer's dop853 code, he actually uses instead of as the power of for reasons unknown. He uses for his dop853.
Definition at line 53 of file StepSz.f90.
real(wp) function stepsize::stepszhairer | ( | real(wp), intent(in) | h, |
logical, intent(in) | islaststeprejected, | ||
integer, intent(in) | q, | ||
real(wp), intent(in) | e, | ||
real(wp), dimension(6), intent(inout) | stepszparams ) |
Pure function for computing the new step size using Hairer's algorithm.
For details on the algorithm, see Hairer's book "Solving ODE I" or his code dop853.f at http://www.unige.ch/~hairer/prog/nonstiff/dop853.f.
[in] | h | current step size |
[in] | islaststeprejected | If true then the step size is decreased else increased. |
[in] | q | q = min(p,phat) but Hairer uses q=8 in DOP853. |
[in] | e | Error norm |
[in,out] | stepszparams | Contains safety factor and Lund stabilization related parameters |
Definition at line 124 of file StepSz.f90.
References hbyhoptold, sf, sfmax, sfmin, and stepszhairer().
Referenced by stepszhairer().
real(wp), parameter stepsize::hbyhoptold = 1.0e-4_WP |
Lund stabilization PI control term (see Hairer's code)
Definition at line 44 of file StepSz.f90.
Referenced by stepszhairer().
real(wp), parameter stepsize::sf = 0.9_WP |
real(wp), parameter stepsize::sfmax = 6.0_WP |
Maximum safety factor, so we dont increase the step size too fast
Definition at line 41 of file StepSz.f90.
Referenced by stepszhairer().
real(wp), parameter stepsize::sfmin = 0.333_WP |
Minimum safety factor, so we dont decrease the step size too fast.
Definition at line 38 of file StepSz.f90.
Referenced by stepszhairer().