"""
数値計算ライブラリィ
"""
scipy.org: https://scipy.org/
docs: https://docs.scipy.org/doc/
scipy.org: https://docs.scipy.org/doc/scipy/reference/index.html
#==============
#Integrate
# https://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html
#==============
>>> help(integrate)
Methods for Integrating Functions given function object.
# quad -- General purpose integration.
scipy.integrate.quad(func, a, b, args=(), full_output=0, epsabs=1.49e-08, epsrel=1.49e-08, limit=50, points=None, weight=None, wvar=None, wopts=None, maxp1=50, limlst=50)[source]
# dblquad -- General purpose double integration.
# tplquad -- General purpose triple integration.
# fixed_quad -- Integrate func(x) using Gaussian quadrature of order n.
# quadrature -- Integrate with given tolerance using Gaussian quadrature.
scipy.integrate.quadrature(func, a, b, args=(), tol=1.49e-08, rtol=1.49e-08, maxiter=50, vec_func=True, miniter=1)[source]
# romberg -- Integrate func using Romberg integration.
scipy.integrate.romberg(function, a, b, args=(), tol=1.48e-08, rtol=1.48e-08, show=False, divmax=10, vec_func=False)[source]
# Methods for Integrating Functions given fixed samples.
trapz -- Use trapezoidal rule to compute integral from samples.
cumtrapz -- Use trapezoidal rule to cumulatively compute integral.
simps -- Use Simpson's rule to compute integral from samples.
romb -- Use Romberg Integration to compute integral from
(2**k + 1) evenly-spaced samples.
See the special module's orthogonal polynomials (special) for Gaussian
quadrature roots and weights for other weighting factors and regions.
Interface to numerical integrators of ODE systems.
odeint -- General integration of ordinary differential equations.
ode -- Integrate ODE using VODE and ZVODE routines.
#==============
# optimize
# https://docs.scipy.org/doc/scipy/reference/optimize.html
#==============
#minimize
Minimization of scalar function of one or more variables.
scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None, hess=None, hessp=None, bounds=None, constraints=(), tol=None, callback=None, options=None)[source]
minimize(method=’Nelder-Mead’)
minimize(method=’Powell’)
minimize(method=’CG’)
minimize(method=’BFGS’)
minimize(method=’Newton-CG’)
minimize(method=’L-BFGS-B’)
minimize(method=’TNC’)
minimize(method=’COBYLA’)
minimize(method=’SLSQP’)
minimize(method=’trust-constr’)
minimize(method=’dogleg’)
minimize(method=’trust-ncg’)
minimize(method=’trust-krylov’)
minimize(method=’trust-exact’)
#==============
# Newton method
# https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.newton.html
#==============
scipy.optimize.newton(func, x0, fprime=None, args=(), tol=1.48e-08, maxiter=50, fprime2=None, x1=None, rtol=0.0, full_output=False, disp=True)
#==============
#Root finding
#==============
#root_scalar(f[, args, method, bracket, …])
Find a root of a scalar function.
root_scalar(method=’brentq’)
root_scalar(method=’brenth’)
root_scalar(method=’bisect’)
root_scalar(method=’ridder’)
root_scalar(method=’newton’)
root_scalar(method=’toms748’)
root_scalar(method=’secant’)
root_scalar(method=’halley’)
#brentq(f, a, b[, args, xtol, rtol, maxiter, …])
Find a root of a function in a bracketing interval using Brent's method.
#brenth(f, a, b[, args, xtol, rtol, maxiter, …])
Find a root of a function in a bracketing interval using Brent's method with hyperbolic extrapolation.
#ridder(f, a, b[, args, xtol, rtol, maxiter, …])
Find a root of a function in an interval using Ridder’s method.
#bisect(f, a, b[, args, xtol, rtol, maxiter, …])
Find root of a function within an interval using bisection.
#newton(func, x0[, fprime, args, tol, …])
Find a zero of a real or complex function using the Newton-Raphson (or secant or Halley’s) method.
#toms748(f, a, b[, args, k, xtol, rtol, …])
Find a zero using TOMS Algorithm 748 method.