Skip to content

Instantly share code, notes, and snippets.

@gabriel-tincu
Created October 11, 2017 13:26
Show Gist options
  • Save gabriel-tincu/573cc7570003ccbc71ba320553b46700 to your computer and use it in GitHub Desktop.
Save gabriel-tincu/573cc7570003ccbc71ba320553b46700 to your computer and use it in GitHub Desktop.
import mpmath
import sympy as sp
lambda_exp = sp.lambdify(symbols, expr_string, modules=['mpmath'])
values = extract_values(model, symbols)
for i, k in enumerate(symbols):
for j, v in enumerate(symbols):
degrees = [0] * len(symbols)
degrees[i] = 1
degrees[j] = 1
response = mpmath.diff(lambda_exp, values, degrees)
# do something with it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment