Gova823 commited on
Commit
a87de3f
·
verified ·
1 Parent(s): 38fc399

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -44,8 +44,8 @@ def calculate_derivative(func_str):
44
  # Calculate the derivative
45
  derivative = sp.diff(func, x)
46
  # Convert sympy expressions to numerical functions
47
- func_lambdified = sp.lambdify(x, func, "numpy")
48
- derivative_lambdified = sp.lambdify(x, derivative, "numpy")
49
  return func_lambdified, derivative_lambdified
50
  except sp.SympifyError:
51
  st.error("Invalid function input. Please enter a valid mathematical expression.")
 
44
  # Calculate the derivative
45
  derivative = sp.diff(func, x)
46
  # Convert sympy expressions to numerical functions
47
+ func_lambdified = sp.lambdify(x_values, func, "numpy")
48
+ derivative_lambdified = sp.lambdify(x_values, derivative, "numpy")
49
  return func_lambdified, derivative_lambdified
50
  except sp.SympifyError:
51
  st.error("Invalid function input. Please enter a valid mathematical expression.")