__init__.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. """
  2. =============================================
  3. Integration and ODEs (:mod:`scipy.integrate`)
  4. =============================================
  5. .. currentmodule:: scipy.integrate
  6. Integrating functions, given function object
  7. ============================================
  8. .. autosummary::
  9. :toctree: generated/
  10. quad -- General purpose integration
  11. quad_vec -- General purpose integration of vector-valued functions
  12. cubature -- General purpose multi-dimensional integration of array-valued functions
  13. dblquad -- General purpose double integration
  14. tplquad -- General purpose triple integration
  15. nquad -- General purpose N-D integration
  16. tanhsinh -- General purpose elementwise integration
  17. fixed_quad -- Integrate func(x) using Gaussian quadrature of order n
  18. newton_cotes -- Weights and error coefficient for Newton-Cotes integration
  19. lebedev_rule
  20. qmc_quad -- N-D integration using Quasi-Monte Carlo quadrature
  21. IntegrationWarning -- Warning on issues during integration
  22. Integrating functions, given fixed samples
  23. ==========================================
  24. .. autosummary::
  25. :toctree: generated/
  26. trapezoid -- Use trapezoidal rule to compute integral.
  27. cumulative_trapezoid -- Use trapezoidal rule to cumulatively compute integral.
  28. simpson -- Use Simpson's rule to compute integral from samples.
  29. cumulative_simpson -- Use Simpson's rule to cumulatively compute integral from samples.
  30. romb -- Use Romberg Integration to compute integral from
  31. -- (2**k + 1) evenly-spaced samples.
  32. .. seealso::
  33. :mod:`scipy.special` for orthogonal polynomials (special) for Gaussian
  34. quadrature roots and weights for other weighting factors and regions.
  35. Summation
  36. =========
  37. .. autosummary::
  38. :toctree: generated/
  39. nsum
  40. Solving initial value problems for ODE systems
  41. ==============================================
  42. The solvers are implemented as individual classes, which can be used directly
  43. (low-level usage) or through a convenience function.
  44. .. autosummary::
  45. :toctree: generated/
  46. solve_ivp -- Convenient function for ODE integration.
  47. RK23 -- Explicit Runge-Kutta solver of order 3(2).
  48. RK45 -- Explicit Runge-Kutta solver of order 5(4).
  49. DOP853 -- Explicit Runge-Kutta solver of order 8.
  50. Radau -- Implicit Runge-Kutta solver of order 5.
  51. BDF -- Implicit multi-step variable order (1 to 5) solver.
  52. LSODA -- LSODA solver from ODEPACK Fortran package.
  53. OdeSolver -- Base class for ODE solvers.
  54. DenseOutput -- Local interpolant for computing a dense output.
  55. OdeSolution -- Class which represents a continuous ODE solution.
  56. Old API
  57. -------
  58. These are the routines developed earlier for SciPy. They wrap older solvers
  59. implemented in Fortran (mostly ODEPACK). While the interface to them is not
  60. particularly convenient and certain features are missing compared to the new
  61. API, the solvers themselves are of good quality and work fast as compiled
  62. Fortran code. In some cases, it might be worth using this old API.
  63. .. autosummary::
  64. :toctree: generated/
  65. odeint -- General integration of ordinary differential equations.
  66. ode -- Integrate ODE using VODE and ZVODE routines.
  67. complex_ode -- Convert a complex-valued ODE to real-valued and integrate.
  68. ODEintWarning -- Warning raised during the execution of `odeint`.
  69. Solving boundary value problems for ODE systems
  70. ===============================================
  71. .. autosummary::
  72. :toctree: generated/
  73. solve_bvp -- Solve a boundary value problem for a system of ODEs.
  74. """ # noqa: E501
  75. from ._quadrature import *
  76. from ._odepack_py import *
  77. from ._quadpack_py import *
  78. from ._ode import *
  79. from ._bvp import solve_bvp
  80. from ._ivp import (solve_ivp, OdeSolution, DenseOutput,
  81. OdeSolver, RK23, RK45, DOP853, Radau, BDF, LSODA)
  82. from ._quad_vec import quad_vec
  83. from ._tanhsinh import nsum, tanhsinh
  84. from ._cubature import cubature
  85. from ._lebedev import lebedev_rule
  86. # Deprecated namespaces, to be removed in v2.0.0
  87. from . import dop, lsoda, vode, odepack, quadpack
  88. __all__ = [s for s in dir() if not s.startswith('_')]
  89. from scipy._lib._testutils import PytestTester
  90. test = PytestTester(__name__)
  91. del PytestTester