odespy.rkf45

Module for wrapping rkf45.py.

class odespy.rkf45.RKF45(f, **kwargs)[source]

Bases: odespy.solvers.Adaptive

Wrapper for rkf45.f, a FORTRAN solver designed to solve non-stiff and mildly stiff differential equations by the well-known Runge-Kutta-Fehlberg (4,5) method.

The FORTRAN source rkf45.f can be obtained from Netlib.

Required input arguments:

Name Description
f Right-hand side f(u,t) defining the ODE.

Optional input arguments:

Name Description
f_args Extra positional arguments to f: f(u, t, *f_args, **f_kwargs). (default: ())
f_kwargs Extra keyword arguments to f: f(u, t, *f_args, **f_kwargs). (default: {})
complex_valued True if f is complex valued. (default: False)
disk_storage Indicates whether u is stored in memory or in file. If string, it is the filename; if False or “”, u is kept in memory; if True, a default filename tmp_odspy.dat is used. (default: False)
verbose Integer reflecting output of intermediate quantities. (default: 0)
u_exact Function of t returning exact solution. (default: None)
rtol Relative tolerance for solution. (default: 1e-06)
atol Absolute tolerance for solution. (default: 1e-08)
f_f77

Fortran subroutine for f. This subroutine has the signature:

      subroutine f_f77(neq,t,u,udot)
Cf2py intent(hide)   neq
Cf2py intent(out)    udot
      integer neq
      double precision t,u(neq),udot(neq)
      udot = ...
      return
      end

Methods

adjust_parameters()
advance()
check_conditional_parameters() This function is used to check whether conditional parameters are provided when specified condition fulfilled.
check_extra(**kwargs) A parameter may have a keyword extra_check for user-given functions that performs consistency checks on the parameter.
check_input_range(**kwargs) Check whether all existing inputs are in right specified range.
check_input_types(**kwargs) Check whether all existing inputs are of right specified type.
compile_string_functions(f, **kwargs) Compile functions which are supplied as Fortran strings.
constant_time_step() Check if self.t has a uniform partition.
get([parameter_name, print_info]) Return value of specified input parameters.
get_parameter_info([print_info]) Return a dictionary containing all properties of all legal parameters in current subclass (i.e., the parameters in self._parameters).
has_u_t_all() Return True if self.u_all and self.t_all, defined in
initialize() Import extension module _rkf45 and check that it exists.
initialize_for_solve()
set([strict]) Assign values to one or more parameters, specified as keyword arguments.
set_initial_condition(U0) Function set_initial_condition() is used to set initial value of
solve(time_points[, terminate]) Compute discrete solution u of the ODE problem at time points
switch_to(solver_target[, print_info]) Create a new solver instance which switch to another subclass with same values of common attributes.
validate_data() This function is used for extra checking and validating of attributes before the computations start.
__module__ = 'odespy.rkf45'
adjust_parameters()[source]
advance()[source]
initialize()[source]

Import extension module _rkf45 and check that it exists.

initialize_for_solve()[source]
quick_description = 'Adaptive Runge-Kutta-Fehlberg (4,5) method (rkf45.f)'