This toy project plots Taylor Approximation for given function and the original function.
Dependences are listed in requirements file.
Code was written for Python3 but should be fine with Python2, as well.
To see the demo, enter command below.
python taylor_expansion.py
Or you might want to enter the function manually, add special functions from sympy functions. Open python interpreter in terminal. Don't forget to import.
import taylor_expansion as te
from sympy.functions import sin
import sympy as sy
x = sy.Symbol('x')
To plot sinx function enter below
te.plot(appr_order=8, x_upper_bound=20, function=sin(x))
To plot x^2 + x^3 - 3
te.plot(appr_order=0, x_upper_bound=4, function=x**2+x**3-3)
TODOs:
Add better types of invokation as soon as I have time to discover...