Coverage for /usr/lib/python3/dist-packages/scipy/integrate/__init__.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-06-14 15:55 +0200

1""" 

2============================================= 

3Integration and ODEs (:mod:`scipy.integrate`) 

4============================================= 

5 

6.. currentmodule:: scipy.integrate 

7 

8Integrating functions, given function object 

9============================================ 

10 

11.. autosummary:: 

12 :toctree: generated/ 

13 

14 quad -- General purpose integration 

15 quad_vec -- General purpose integration of vector-valued functions 

16 dblquad -- General purpose double integration 

17 tplquad -- General purpose triple integration 

18 nquad -- General purpose N-D integration 

19 fixed_quad -- Integrate func(x) using Gaussian quadrature of order n 

20 quadrature -- Integrate with given tolerance using Gaussian quadrature 

21 romberg -- Integrate func using Romberg integration 

22 newton_cotes -- Weights and error coefficient for Newton-Cotes integration 

23 qmc_quad -- N-D integration using Quasi-Monte Carlo quadrature 

24 IntegrationWarning -- Warning on issues during integration 

25 AccuracyWarning -- Warning on issues during quadrature integration 

26 

27Integrating functions, given fixed samples 

28========================================== 

29 

30.. autosummary:: 

31 :toctree: generated/ 

32 

33 trapezoid -- Use trapezoidal rule to compute integral. 

34 cumulative_trapezoid -- Use trapezoidal rule to cumulatively compute integral. 

35 simpson -- Use Simpson's rule to compute integral from samples. 

36 romb -- Use Romberg Integration to compute integral from 

37 -- (2**k + 1) evenly-spaced samples. 

38 

39.. seealso:: 

40 

41 :mod:`scipy.special` for orthogonal polynomials (special) for Gaussian 

42 quadrature roots and weights for other weighting factors and regions. 

43 

44Solving initial value problems for ODE systems 

45============================================== 

46 

47The solvers are implemented as individual classes, which can be used directly 

48(low-level usage) or through a convenience function. 

49 

50.. autosummary:: 

51 :toctree: generated/ 

52 

53 solve_ivp -- Convenient function for ODE integration. 

54 RK23 -- Explicit Runge-Kutta solver of order 3(2). 

55 RK45 -- Explicit Runge-Kutta solver of order 5(4). 

56 DOP853 -- Explicit Runge-Kutta solver of order 8. 

57 Radau -- Implicit Runge-Kutta solver of order 5. 

58 BDF -- Implicit multi-step variable order (1 to 5) solver. 

59 LSODA -- LSODA solver from ODEPACK Fortran package. 

60 OdeSolver -- Base class for ODE solvers. 

61 DenseOutput -- Local interpolant for computing a dense output. 

62 OdeSolution -- Class which represents a continuous ODE solution. 

63 

64 

65Old API 

66------- 

67 

68These are the routines developed earlier for SciPy. They wrap older solvers 

69implemented in Fortran (mostly ODEPACK). While the interface to them is not 

70particularly convenient and certain features are missing compared to the new 

71API, the solvers themselves are of good quality and work fast as compiled 

72Fortran code. In some cases, it might be worth using this old API. 

73 

74.. autosummary:: 

75 :toctree: generated/ 

76 

77 odeint -- General integration of ordinary differential equations. 

78 ode -- Integrate ODE using VODE and ZVODE routines. 

79 complex_ode -- Convert a complex-valued ODE to real-valued and integrate. 

80 

81 

82Solving boundary value problems for ODE systems 

83=============================================== 

84 

85.. autosummary:: 

86 :toctree: generated/ 

87 

88 solve_bvp -- Solve a boundary value problem for a system of ODEs. 

89""" # noqa: E501 

90 

91 

92from ._quadrature import * 

93from ._odepack_py import * 

94from ._quadpack_py import * 

95from ._ode import * 

96from ._bvp import solve_bvp 

97from ._ivp import (solve_ivp, OdeSolution, DenseOutput, 

98 OdeSolver, RK23, RK45, DOP853, Radau, BDF, LSODA) 

99from ._quad_vec import quad_vec 

100 

101# Deprecated namespaces, to be removed in v2.0.0 

102from . import dop, lsoda, vode, odepack, quadpack 

103 

104__all__ = [s for s in dir() if not s.startswith('_')] 

105 

106from scipy._lib._testutils import PytestTester 

107test = PytestTester(__name__) 

108del PytestTester