Runga-Kutta Feagin 14(12) method.
initialize the class (set n,f, and report)
Initialize the rk_variable_step_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_variable_step_class), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | n |
number of equations |
||
procedure(deriv_func) | :: | f |
derivative function |
|||
real(kind=wp), | intent(in), | dimension(:) | :: | rtol |
relative tolerance (if size=1, then same tol used for all equations) |
|
real(kind=wp), | intent(in), | dimension(:) | :: | atol |
absolute tolerance (if size=1, then same tol used for all equations) |
|
class(stepsize_class), | intent(in) | :: | stepsize_method |
method for varying the step size |
||
integer, | intent(in), | optional | :: | hinit_method |
which method to use for
automatic initial step size
computation.
1 = use |
|
procedure(report_func), | optional | :: | report |
for reporting the steps |
||
procedure(event_func), | optional | :: | g |
for stopping at an event |
destructor
Destructor for rk_variable_step_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_variable_step_class), | intent(out) | :: | me |
main integration routine
Main integration routine for the rk_variable_step_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_variable_step_class), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | t0 |
initial time |
||
real(kind=wp), | intent(in), | dimension(:) | :: | x0 |
initial state |
|
real(kind=wp), | intent(in) | :: | h |
initial abs(time step) |
||
real(kind=wp), | intent(in) | :: | tf |
final time |
||
real(kind=wp), | intent(out), | dimension(:) | :: | xf |
final state |
|
integer, | intent(out), | optional | :: | ierr |
0 = no errors, <0 = error. if not present, an error will stop program. |
integration with event finding
Event-finding integration routine for the rk_variable_step_class. Integrates until g(t,x)=0, or until t=tf (whichever happens first).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_variable_step_class), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | t0 |
initial time |
||
real(kind=wp), | intent(in), | dimension(me%n) | :: | x0 |
initial state |
|
real(kind=wp), | intent(in) | :: | h |
abs(time step) |
||
real(kind=wp), | intent(in) | :: | tmax |
max final time if event not located |
||
real(kind=wp), | intent(in) | :: | tol |
function tolerance for root finding |
||
real(kind=wp), | intent(out) | :: | tf |
actual final time reached |
||
real(kind=wp), | intent(out), | dimension(me%n) | :: | xf |
final state (at tf) |
|
real(kind=wp), | intent(out) | :: | gf |
g value at tf |
||
integer, | intent(out), | optional | :: | ierr |
0 = no errors, <0 = error. if not present, an error will stop program. |
Feagin's RK14(12) - a 14th-order method with an embedded 12th-order method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rkf1412_class), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | t |
initial time |
||
real(kind=wp), | intent(in), | dimension(me%n) | :: | x |
initial state |
|
real(kind=wp), | intent(in) | :: | h |
time step |
||
real(kind=wp), | intent(out), | dimension(me%n) | :: | xf |
state at time |
|
real(kind=wp), | intent(out), | dimension(me%n) | :: | terr |
truncation error estimate |
Returns the order of the rkf1412 method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rkf1412_class), | intent(in) | :: | me |
order of the method
type,extends(rk_variable_step_class),public :: rkf1412_class !! Runga-Kutta Feagin 14(12) method. contains procedure :: step => rkf1412 procedure :: order => rkf1412_order end type rkf1412_class