Skip to content

A simple program to visualize Taylor series approximation.

Notifications You must be signed in to change notification settings

alochaus/taylor-series

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

taylor-series

A simple program to visualize Taylor series approximation.

screenshot

Dependencies

  • matplotlib
  • numpy
  • sympy

How to use

Step 1: enter a function

You have to type your function using Python's mathematical operators, e.g., x**2 + 7 - 3*x. https://en.wikibooks.org/wiki/Python_Programming/Basic_Math#Mathematical_Operators

You can use the following trigonometric functions inside your function:

  • sin(x)
  • cos(x)
  • tan(x)
  • sec(x)
  • csc(x)
  • cot(x)
  • asin(x)
  • acos(x)
  • atan(x)
  • acsc(x)
  • acot(x)

Note: Even though factorial isn't a trigonometric function you can also use it by calling factorial().

Step 2: enter "a"

Whats "a"?

"a" is the starting point of the approximation.

taylor-series

Step 3: enter the the degree of the Taylor polynomial

Enter the degree of each polynomial one at a time. In order to finally plot the graph, end it with a -1 so that the program knows it is ready.

$ ./Desktop/taylor-series/main.py 
Enter a function:
f(x) = tan(cos(x)-2*sin(x/2))
a = 3
Enter the degree of the Taylor polynomial: 3
Enter the degree of the Taylor polynomial: 5
Enter the degree of the Taylor polynomial: 7
Enter the degree of the Taylor polynomial: -1

Releases

No releases published

Packages

No packages published

Languages