library.ode Submodule

Module Summary

Interfaces for the NAG Mark 29.2 ode Chapter.

ode - Ordinary Differential Equations

This module is concerned with the numerical solution of ordinary differential equations. There are two main types of problem: those in which all boundary conditions are specified at one point (initial value problems), and those in which the boundary conditions are distributed between two or more points (boundary value problems and eigenvalue problems). Functions are available for initial value problems, two-point boundary value problems and Sturm–Liouville eigenvalue problems.

See Also

naginterfaces.library.examples.ode :

This subpackage contains examples for the ode module. See also the Examples subsection.

Functionality Index

Differentiation of a function discretized on Chebyshev Gauss–Lobatto points: bvp_ps_lin_cgl_deriv()

Linear constant coefficient boundary value problem

Chebyshev spectral integration method

Chebyshev coefficients generator for a function discretized on Chebyshev Gauss–Lobatto grid: bvp_ps_lin_coeffs()

Chebyshev coefficients to function values on Chebyshev Gauss–Lobatto grid: bvp_ps_lin_cgl_vals()

Chebyshev Gauss–Lobatto grid generator: bvp_ps_lin_cgl_grid()

Chebyshev integration solver for linear constant coefficient boundary value problem: bvp_ps_lin_solve()

Clenshaw–Curtis quadrature weights generator at Chebyshev Gauss–Lobatto points: bvp_ps_lin_quad_weights()

Evaluation on uniform grid of function by Barycentric Lagrange interpolation: bvp_ps_lin_grid_vals()

value of th Chebyshev polynomial: bvp_ps_lin_cheb_eval()

Second-order Sturm–Liouville problems

regular/singular system, finite/infinite range

eigenvalue and eigenfunction: sl2_breaks_funs()

eigenvalue only: sl2_breaks_vals()

regular system, finite range, user-specified break-points

eigenvalue only: sl2_reg_finite()

System of first-order ordinary differential equations, initial value problems

-interpolant: ivp_stiff_c1_interp()

comprehensive integrator functions for stiff systems

continuation to call dae_dassl_gen(): dae_dassl_cont()

explicit ordinary differential equations

banded Jacobian: ivp_stiff_exp_bandjac()

full Jacobian: ivp_stiff_exp_fulljac()

sparse Jacobian: ivp_stiff_exp_sparjac()

explicit ordinary differential equations (reverse communication)

full Jacobian: ivp_stiff_exp_revcom()

implicit ordinary differential equations coupled with algebraic equations

banded Jacobian: ivp_stiff_imp_bandjac()

banded Jacobian selector for DASSL integrator: dae_dassl_linalg()

DASSL integrator: dae_dassl_gen()

full Jacobian: ivp_stiff_imp_fulljac()

integrator setup for DASSL: dae_dassl_setup()

sparse Jacobian: ivp_stiff_imp_sparjac()

implicit ordinary differential equations coupled with algebraic equations (reverse communication): ivp_stiff_imp_revcom()

comprehensive integrator functions using Adams’ method with root-finding option

diagnostic function: ivp_adams_diag()

diagnostic function for root-finding: ivp_adams_rootdiag()

direct communication: ivp_adams_roots()

interpolant: ivp_adams_interp()

reverse communication: ivp_adams_roots_revcom()

setup function: ivp_adams_setup()

comprehensive integrator functions using Runge–Kutta methods

diagnostic function: ivp_rkts_diag()

diagnostic function for global error assessment: ivp_rkts_errass()

interpolant, reverse communication: ivp_rk_interp_setup()

interpolant and interpolation, direct communication: ivp_rkts_interp()

interpolation, reverse communication: ivp_rk_interp_eval()

over a range with intermediate output: ivp_rkts_range()

over a step, direct communication: ivp_rkts_onestep()

over a step, reverse communication: ivp_rk_step_revcomm()

reset end of range: ivp_rkts_reset_tend()

setup function: ivp_rkts_setup()

compute weighted norm of local error estimate: ivp_stiff_errest()

enquiry function for use with sparse Jacobian: ivp_stiff_sparjac_enq()

integrator diagnostic function: ivp_stiff_integ_diag()

integrator setup for backward differentiation formulae method for SPRINT integrator: ivp_stiff_bdf()

integrator setup for Blend method for SPRINT integrator: ivp_stiff_blend()

integrator setup for DASSL method for SPRINT integrator: ivp_stiff_dassl()

linear algebra diagnostic function for sparse Jacobians: ivp_stiff_sparjac_diag()

linear algebra setup for banded Jacobians: ivp_stiff_bandjac_setup()

linear algebra setup for full Jacobians: ivp_stiff_fulljac_setup()

linear algebra setup for sparse Jacobians: ivp_stiff_sparjac_setup()

natural interpolant: ivp_stiff_interp()

natural interpolant (for use by MONITR subfunction): ivp_stiff_nat_interp()

setup function for continuation calls to integrator: ivp_stiff_contin()

simple driver functions

Runge–Kutta–Merson method

until a function of the solution is zero: ivp_rkm_zero_simple()

until a specified component attains a given value: ivp_rkm_val_simple()

Runge–Kutta method

until (optionally) a function of the solution is zero, with optional intermediate output: ivp_rk_zero_simple()

variable-order variable-step Adams’ method

until (optionally) a function of the solution is zero, with optional intermediate output: ivp_adams_zero_simple()

variable-order variable-step backward differentiation formulae method for stiff systems

until (optionally) a function of the solution is zero, with optional intermediate output: ivp_bdf_zero_simple()

System of ordinary differential equations, boundary value problems

collocation and least squares

single th-order linear equation: bvp_coll_nth()

system of first-order linear equations: bvp_coll_sys()

system of th-order linear equations: bvp_coll_nth_comp()

comprehensive functions using a collocation technique

continuation function: bvp_coll_nlin_contin()

diagnostic function: bvp_coll_nlin_diag()

general nonlinear problem solver (thread safe): bvp_coll_nlin_solve()

interpolation function: bvp_coll_nlin_interp()

setup function: bvp_coll_nlin_setup()

finite difference technique with deferred correction

general linear problem: bvp_fd_lin_gen()

general nonlinear problem, with continuation facility: bvp_fd_nonlin_gen()

simple nonlinear problem: bvp_fd_nonlin_fixedbc()

shooting and matching technique

boundary values to be determined: bvp_shoot_bval()

general parameters to be determined: bvp_shoot_genpar()

general parameters to be determined, allowing interior matching-point: bvp_shoot_genpar_intern()

general parameters to be determined, subject to extra algebraic equations: bvp_shoot_genpar_algeq()

System of second-order ordinary differential equations

Runge–Kutta–Nystrom method

diagnostic function: ivp_2nd_rkn_diag()

integrator: ivp_2nd_rkn()

interpolating solutions: ivp_2nd_rkn_interp()

setup function: ivp_2nd_rkn_setup()

For full information please refer to the NAG Library document



Example for naginterfaces.library.ode.ivp_bdf_zero_simple().

Solves a stiff system of ordinary differential equations by the Backward Differentiation Formulae.

Demonstrates termination by root-finding condition and intermediate solution output.

>>> main()
naginterfaces.library.ode.ivp_bdf_zero_simple Python Example Results.
Solve stiff Robertson problem until a stopping criterion is met.
      x                       y
    0.00      1.00000      0.00000      0.00000
    2.00      0.94161      0.00003      0.05837
    4.00      0.90551      0.00002      0.09446
Stopping criterion met at x =   4.377
Solution is       0.90000      0.00002      0.09998

Example for naginterfaces.library.ode.ivp_stiff_exp_fulljac().

Explicit ODEs, stiff initial value problem, full Jacobian.

>>> main()
naginterfaces.library.ode.ivp_stiff_exp_fulljac Python Example Results.
Integrate the stiff Robertson problem.
naginterfaces.base.ode.ivp_stiff_exp_fulljac:  INITIAL STEP SIZE IS ...
At time 10.0 the corresponding y is (0.8414, 0.0000, 0.1586).