feat: derivates

This commit is contained in:
2025-11-16 18:45:08 +01:00
parent 420a9049b3
commit 1fb7616c93
4 changed files with 26 additions and 1 deletions

View File

@@ -1,4 +1,8 @@
from sympy import diff, limit, oo, symbols
from modules.math import (
t_build_partial_derivate,
t_build_derivate,
t_calculate_e,
t_calculate_e_limit,
t_compound_interest,
@@ -23,3 +27,14 @@ if __name__=="__main__":
print(t_limit())
print(t_calculate_e_limit())
print(t_calculate_e_limit().evalf())
x = symbols("x")
derivative = t_build_derivate(x ** 2)
value_on_two = derivative.subs(x,2)
print(derivative, value_on_two)
# Partial derivates are applied to one variable at a time
y = symbols("y")
z = symbols("z")
partial_derivative_y = t_build_partial_derivate((3 * y ** 3) + 2 * z ** 2, y)
partial_derivative_z = t_build_partial_derivate((3 * y ** 3) + 2 * z ** 2, z)
print(partial_derivative_y, partial_derivative_z)