[Science and technology calculation by Python] Taylor expansion, mathematical formulas, sympy

Taylor expansion around x = 0 and x = 1.5 of sin (x) using sympy.


from sympy import *      
"""
Use the series function.
series("function",variable, "x=Where to deploy",Censoring order of expansion)
#By default x=Around 0
"""
x=Symbol('x')                  #letter'x'Is defined as the variable x
y=Symbol('y')                 #letter'y'Is defined as the variable y
series(sin(x),x) #Default configuration

スクリーンショット 2017-07-18 14.12.03.png

series(sin(x),x, 0, 12) # x=O around 0(x^12)Expand to

スクリーンショット 2017-07-18 14.12.06.png

series(sin(x),x, 1.5, 12)  # x=1.O around 5(x^12)Expand to

スクリーンショット 2017-07-18 14.12.10.png

Recommended Posts

[Science and technology calculation by Python] Taylor expansion, mathematical formulas, sympy
[Science and technology calculation by Python] Integral, mathematical formula, sympy
[Science and technology calculation by Python] (Partial) differential, mathematical formula, sympy
[Scientific / technical calculation by Python] Solving ordinary differential equations, mathematical formulas, sympy
[Scientific / technical calculation by Python] Derivation of analytical solutions for quadratic and cubic equations, mathematical formulas, sympy
Understanding with mathematical formulas and Python LiNGAM (ICA version)
Expansion by argument of python dictionary
Multiple integrals with Python and Sympy
"Manim" that can draw animation of mathematical formulas and graphs with Python
[Control engineering] Calculation of transfer functions and state space models by Python