4th order Runge-Kutta Ralston
user-callable method to stop the integration
User-callable method to stop the integration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me |
get status code and message
Get the status of an integration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(in) | :: | me | |||
integer, | intent(out), | optional | :: | istatus |
status code ( |
|
character(len=:), | intent(out), | optional, | allocatable | :: | message |
status message |
Returns true if there was an error. Can use rk_class_status to get more info.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(in) | :: | me |
initialize the class (set n,f, and report)
Initialize the rk_fixed_step_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_fixed_step_class), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | n |
number of variables |
||
procedure(deriv_func) | :: | f |
derivative function |
|||
procedure(report_func), | optional | :: | report |
for reporting the steps |
||
procedure(event_func), | optional | :: | g |
for stopping at an event |
||
logical, | intent(in), | optional | :: | stop_on_errors |
stop the program for any errors (default is False) |
|
integer, | intent(in), | optional | :: | max_number_of_steps |
max number of steps allowed |
|
integer, | intent(in), | optional | :: | report_rate |
how often to call report function:
|
|
class(root_method), | intent(in), | optional | :: | solver |
the root-finding method to use for even finding.
if not present, then |
Main integration routine for the rk_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_fixed_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 |
abs(time step) |
||
real(kind=wp), | intent(in) | :: | tf |
final time |
||
real(kind=wp), | intent(out), | dimension(:) | :: | xf |
final state |
Event-finding integration routine for the rk_class. Integrates until g(t,x)=0, or until t=tf (whichever happens first).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_fixed_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 |
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(:) | :: | xf |
final state (at tf) |
|
real(kind=wp), | intent(out) | :: | gf |
g value at tf |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rkr4_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 |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rkr4_class), | intent(in) | :: | me |
properties of the method