feat: derivates
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@ from cmath import log as complex_log # used for complex numbers
|
||||
from math import e, exp, log
|
||||
|
||||
# Sympy is powerful since it does not make aproximations, it keeps every primitive as it is, this means that it's slower but more precisse
|
||||
from sympy import limit, oo, symbols
|
||||
from sympy import diff, limit, oo, symbols
|
||||
|
||||
|
||||
def t_summ():
|
||||
@@ -50,3 +50,13 @@ def t_calculate_e_limit():
|
||||
x = symbols("x")
|
||||
f = (1 + 1 / x) ** x
|
||||
return limit(f, x, oo)
|
||||
|
||||
# Calculate the slope by taking a close enough point
|
||||
def t_calculate_derivative(f, x, step_size):
|
||||
return (f(x + step_size) - f(x)) / (x +step_size - x)
|
||||
|
||||
def t_build_derivate(f):
|
||||
return diff(f)
|
||||
|
||||
def t_build_partial_derivate(f,symbol):
|
||||
return diff(f, symbol)
|
||||
|
||||
Reference in New Issue
Block a user